summaryrefslogtreecommitdiff
path: root/src/game/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r--src/game/game.cpp22
1 files changed, 11 insertions, 11 deletions
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++;
}
}