diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-07-10 23:06:59 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-07-10 23:06:59 +0100 |
commit | 1ae6a63f79edd72aa39c7f7e2bca5182a68592b4 (patch) | |
tree | 5c928964bd367019bdbd76db27841211680f7f0d /src/game.c | |
parent | acb17f540cd8bc3a1e50ae4ab22b97620b55673b (diff) | |
download | gold-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.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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) |