summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kurator/src/Battle.cpp4
-rw-r--r--kurator/src/components.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp
index 6c86c25..8ecd571 100644
--- a/kurator/src/Battle.cpp
+++ b/kurator/src/Battle.cpp
@@ -59,7 +59,7 @@ Battle::update(const float dt)
auto& registry = battle->registry();
auto timers = registry.view<Timed>();
for (auto&& [entity, timer] : timers.each()) {
- timer.left -= dt;
+ timer.left -= timer.scaled ? dt * time_factor : dt;
if (timer.left < 0.0)
registry.destroy(entity);
}
@@ -145,7 +145,7 @@ Battle::on_hit(const sim::Hit& hit)
registry.emplace<UIOffset>(popup, 0, 0);
registry.emplace<PopMove>(popup, sim::Point{0.0, -20}, 0.9998);
const auto line = registry.create();
- registry.emplace<Timed>(line, 0.2);
+ registry.emplace<Timed>(line, 0.2, true);
registry.emplace<Line>(line, RED, source.position, victim.position);
}
diff --git a/kurator/src/components.h b/kurator/src/components.h
index 5c4a32d..0da3d6b 100644
--- a/kurator/src/components.h
+++ b/kurator/src/components.h
@@ -14,6 +14,7 @@ namespace kurator
struct Timed
{
double left;
+ bool scaled = false;
};