From 6f18c3bae8c64ad52b541f95dde10110697e8b20 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 8 Jul 2023 12:46:24 +0100 Subject: Don't draw the player out of screen We don't have clipping now, so we can't draw out of the screen. Also we want to NOT draw the player during the gameover delay. --- src/player.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/player.c b/src/player.c index 7394857..8c1765a 100644 --- a/src/player.c +++ b/src/player.c @@ -95,7 +95,7 @@ static void player_dying() for (uint8_t i = 0; i < steps; i++) { /* exit screen */ - if (y > MAP_H * MAP_TILE_H) + if (y == MAP_H * MAP_TILE_H - 16) { /* if there are lifes left, respawn */ if (dec_lives()) @@ -106,6 +106,8 @@ static void player_dying() /* stop falling */ gravity = GRAVITY_OFF; + /* don't draw the player; XXX: magic number */ + invuln = 4; return; } y++; -- cgit v1.2.3