diff options
Diffstat (limited to 'src/player.c')
-rw-r--r-- | src/player.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/player.c b/src/player.c index a4d346e..155d8bd 100644 --- a/src/player.c +++ b/src/player.c @@ -8,6 +8,9 @@ IMPL_INIT(player, 0) { IMPL(update) { IMPL_UNUSED; + if (g->queue_restart_scene) + return; + const int kleft = TZR_IsKeyDown(SDL_SCANCODE_A) || TZR_IsKeyDown(SDL_SCANCODE_LEFT); const int kright = TZR_IsKeyDown(SDL_SCANCODE_D) || @@ -28,7 +31,16 @@ IMPL(update) { g->queue_next_scene = 1; printf("YO\n"); } + move(); + + if (collide_spike(0, 0)) + this->dead += 1; + else + this->dead = 0; + + if (this->dead > 3) + g->queue_restart_scene = 60; } IMPL(draw) { |