aboutsummaryrefslogtreecommitdiff
path: root/src/player.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.s')
-rw-r--r--src/player.s32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/player.s b/src/player.s
index df2ee68..a821f0e 100644
--- a/src/player.s
+++ b/src/player.s
@@ -114,6 +114,11 @@
;; Initialize the player's sprite. Note that for the sprite to look
;; correctly on screen you still need to call `Player::update` afterwards.
.proc init
+ ;; Make sure that the 'dead' bit from the global flags is zeroed out.
+ lda Globals::zp_flags
+ and #%11101111
+ sta Globals::zp_flags
+
;; Initial state.
lda #%01000100
sta zp_state
@@ -822,4 +827,31 @@
rts
.endproc
+
+ ;; That's just german for "the Bart, the".
+ .proc die_bart_die
+ ;; TODO: dec lifes
+
+ ;; Move the player's sprites out of the screen.
+ ldx #0
+ lda #$FF
+ sta OAM::m_sprites, x
+ sta OAM::m_sprites + 4, x
+ sta OAM::m_sprites + 8, x
+ sta OAM::m_sprites + 12, x
+ sta OAM::m_sprites + 16, x
+ sta OAM::m_sprites + 20, x
+
+ ;; Set the player as dead.
+ lda #$10
+ ora Globals::zp_flags
+ sta Globals::zp_flags
+
+ ;; Create an explosion.
+ lda Player::zp_screen_y
+ sta Globals::zp_arg2
+ lda Player::zp_screen_x
+ sta Globals::zp_arg3
+ JAL Explosions::create
+ .endproc
.endscope