diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-04 22:53:35 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-04 22:53:35 +0100 |
| commit | 0c5af85cc0cb9bb39a3a72548e735b92daf0a28f (patch) | |
| tree | 0879318ea266ae1c756529645a3e8fefbd059824 /src/player.s | |
| parent | 196f2ac744fa8e0b6ce2da555e01178d04bfb322 (diff) | |
| download | jetpac.nes-0c5af85cc0cb9bb39a3a72548e735b92daf0a28f.tar.gz jetpac.nes-0c5af85cc0cb9bb39a3a72548e735b92daf0a28f.zip | |
Add collision with the player
This allows for explosions to run after making the player to disappear,
and it re-runs the entering scene timer.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/player.s')
| -rw-r--r-- | src/player.s | 32 |
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 |
