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.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp
index b9a46db..04034f7 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -14,9 +14,19 @@ void state_t::start(void)
human = new human_t;
human->place(&world, v2f_t(0.5, 0.5));
units.insert(human);
+ human = new human_t;
+ human->place(&world, v2f_t(1.5, 0.5));
+ units.insert(human);
+ human = new human_t;
+ human->place(&world, v2f_t(2.5, 0.5));
+ units.insert(human);
alien = new alien_t;
alien->place(&world, v2f_t(15.5, -2.5));
+ alien = new alien_t;
+ alien->place(&world, v2f_t(14.5, -2.5));
+ alien = new alien_t;
+ alien->place(&world, v2f_t(13.5, -2.5));
}
void state_t::stop(void)
@@ -44,6 +54,9 @@ void state_t::select(rectf_t x)
if (unit->type != unit_t::UNIT_HUMAN)
continue;
+ if (unit->dead)
+ continue;
+
unit->selected = selection_cookie;
selected_units.insert(unit);
}
@@ -68,6 +81,9 @@ void state_t::tick(double now_, double dt_)
for (unit_t *unit : units) {
rectf_t wake_range;
+ if (unit->dead)
+ continue;
+
wake_range[0] = unit->x - v2f_t(10, 10);
wake_range[1] = unit->x + v2f_t(10, 10);
@@ -78,6 +94,10 @@ void state_t::tick(double now_, double dt_)
continue;
enemy = (unit_t*)ent;
+
+ if (enemy->dead)
+ continue;
+
enemy->wake_time = now;
if (enemy->awake)