From 12143c33141a9c35e8eb01609062655f560b4bc1 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Thu, 14 Dec 2017 12:43:17 +0100 Subject: Get rid of all the time parameters in game. --- src/game/game.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/game/game.cpp') diff --git a/src/game/game.cpp b/src/game/game.cpp index 5643b3a..c2c2c19 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -11,21 +11,21 @@ void state_t::start(void) world.generator = worldgen; - human = new human_t; + human = new human_t(this); human->place(&world, v2f_t(0.5, 0.5)); units.insert(human); - human = new human_t; + human = new human_t(this); human->place(&world, v2f_t(1.5, 0.5)); units.insert(human); - human = new human_t; + human = new human_t(this); human->place(&world, v2f_t(2.5, 0.5)); units.insert(human); - alien = new alien_t; + alien = new alien_t(this); alien->place(&world, v2f_t(15.5, -2.5)); - alien = new alien_t; + alien = new alien_t(this); alien->place(&world, v2f_t(14.5, -2.5)); - alien = new alien_t; + alien = new alien_t(this); alien->place(&world, v2f_t(13.5, -2.5)); } @@ -70,7 +70,7 @@ void state_t::command(v2f_t x) if (unit->dead) continue; - unit->start_moving(snap, now); + unit->start_moving(snap); } } @@ -109,19 +109,19 @@ void state_t::tick(double now_, double dt_) enemy->awake = true; awake_units.insert(enemy); - enemy->wake(now, unit); + enemy->wake(unit); } - unit->think(now, dt); + unit->think(); } for (auto i = std::begin(awake_units); i != std::end(awake_units);) { if (now - (*i)->wake_time >= 5.0) { (*i)->awake = false; - (*i)->sleep(now); + (*i)->sleep(); i = awake_units.erase(i); } else { - (*i)->think(now, dt); + (*i)->think(); i++; } } -- cgit