aboutsummaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-10 23:06:59 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-10 23:06:59 +0100
commit1ae6a63f79edd72aa39c7f7e2bca5182a68592b4 (patch)
tree5c928964bd367019bdbd76db27841211680f7f0d /src/game.c
parentacb17f540cd8bc3a1e50ae4ab22b97620b55673b (diff)
downloadgold-mine-run-1ae6a63f79edd72aa39c7f7e2bca5182a68592b4.tar.gz
gold-mine-run-1ae6a63f79edd72aa39c7f7e2bca5182a68592b4.zip
Draw entities in order
This makes a difference on the less powerful machines and helps avoiding flickering.
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/game.c b/src/game.c
index 1e376a6..7d64224 100644
--- a/src/game.c
+++ b/src/game.c
@@ -186,8 +186,8 @@ next_stage:
blit_target(TARGET_SCREEN);
put_text(136, 100, "READY?", 1);
+ entities_sort();
entities_draw();
- player_draw();
/* wait some time */
wait_frames(96);
@@ -197,7 +197,6 @@ next_stage:
blit_copy_all();
entities_draw();
- player_draw();
timer_start(GAME_TIME_MAX, &clock_updated);
@@ -264,21 +263,20 @@ next_stage:
}
if (time && tmonster)
{
- tmonster->used = 0;
+ tmonster->used = USED_FREE;
tmonster = NULL;
}
}
entities_update();
+ entities_sort();
wait_vsync();
/* prevent interrupts so updating the audio doesn't result in sprite
* flickering on the less powered machines */
disable();
- player_erase();
entities_draw();
- player_draw();
enable();
if (gameover)