From 0f415a94e31f45fdba643e351e19798bbc6c2f20 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 26 Dec 2022 03:40:31 +0100 Subject: Laser effect now hits the target a bit smoother --- kurator/src/Battle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp index 6b3ac99..8cced8b 100644 --- a/kurator/src/Battle.cpp +++ b/kurator/src/Battle.cpp @@ -82,7 +82,7 @@ Battle::update(const float dt) } auto lines = registry.view(); for (auto&& [entity, line] : lines.each()) - line.position += 1.0 / line.duration * dt * time_factor; + line.position += (1.0 + line.hlength) / line.duration * dt * time_factor; balance.update(registry); ImGui::SetNextWindowPos({GetScreenWidth()/2.0f, GetScreenHeight()-100.0f}, ImGuiCond_Once, {0.5f, 0.5f}); ImGui::SetNextWindowSize({240.0f, 0.0f}, ImGuiCond_Once); -- cgit v1.1