aboutsummaryrefslogtreecommitdiff
path: root/src/player.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-05 18:47:08 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-05 18:47:08 +0100
commit11847f52aed5bda1966b7d28e009430dc58d2561 (patch)
tree49012edd92bcf40add6b784c3aa66ac1ae1a9bf3 /src/player.s
parentdbcbd43287a28bf087e20e660edd5ba40b5c27ec (diff)
downloadjetpac.nes-11847f52aed5bda1966b7d28e009430dc58d2561.tar.gz
jetpac.nes-11847f52aed5bda1966b7d28e009430dc58d2561.zip
Add the Game Over screen
This is still missing the support for player 2, but I've left traces about it. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/player.s')
-rw-r--r--src/player.s18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/player.s b/src/player.s
index 73ff20e..7e215a5 100644
--- a/src/player.s
+++ b/src/player.s
@@ -834,14 +834,19 @@
;; That's just german for "the Bart, the".
.proc die_bart_die
- ;; Decrement the life.
+ ;; Decrement the life. If we reach zero, then there's no point on
+ ;; signaling the NMI code to render this change.
+ ;;
;; TODO: this is just considering the first player only!.
dec Player::zp_lifes
- beq @over
+ beq @skip_life_update
+
+ ;; Notify NMI code to render lifes again, as they have changed.
lda Player::zp_state
ora #%00001000
sta Player::zp_state
+ @skip_life_update:
;; Move the player's sprites out of the screen.
ldx #0
lda #$FF
@@ -863,14 +868,5 @@
lda Player::zp_screen_x
sta Globals::zp_arg3
JAL Explosions::create
-
- @over:
- ;; Set the proper flag for game over.
- ;; TODO: game over (coin)
- lda Globals::zp_flags
- ora #%00000010
- sta Globals::zp_flags
-
- rts
.endproc
.endscope