diff options
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/game.cpp b/src/game.cpp index 59b8ad9..725d6f0 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -30,10 +30,8 @@ void state_t::start(void) human_t &human = *(--humans.end()); - human.bounds.left = 0.33f; - human.bounds.top = 0; - human.bounds.width = 0.66f; - human.bounds.height = 1.0f; + human.bounds.v[0] = v2f_t(0.33f, 0); + human.bounds.v[1] = human.bounds.v[0] + v2f_t(0.66f, 1.0f); human.render_bounds = human.bounds; human.link(&world); } @@ -47,11 +45,15 @@ void state_t::tick(void) human.walking = false; if (human.stalin < 0) { + v2f_t delta; + human.walking = true; human.angle += (rand() & 2 ? 0.2f : -0.2f); human.unlink(); - human.bounds.left += cos(human.angle) * 0.04; - human.bounds.top += sin(human.angle) * 0.04; + delta = v2f_t(cos(human.angle), sin(human.angle)) * 0.04; + human.bounds[0] += delta; + human.bounds[1] += delta; + human.render_bounds = human.bounds; human.link(&world); } |