summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp
index bfc698d..a3af9ed 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -73,7 +73,7 @@ public:
link(world);
}
- void keep_moving(double now)
+ void keep_moving(double now, double dt)
{
float time;
@@ -83,7 +83,7 @@ public:
if (move.blocked && now < move.next_attempt)
return;
- time = 0.15; // FIXME
+ time = dt * 10;
while (time > 0.0f) {
v2f_t delta, next, x_new;
@@ -241,12 +241,13 @@ void state_t::command(v2f_t x)
unit->start_moving(x, now);
}
-void state_t::tick(double now_)
+void state_t::tick(double now_, double dt_)
{
now = now_;
+ dt = dt_;
for (unit_t *unit : units)
- unit->keep_moving(now);
+ unit->keep_moving(now, dt);
}
} //namespace game