diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-10-06 21:40:31 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-10-06 21:40:31 -0400 |
commit | e3fae4da977856f5c953d9e3b3ea0bce51789a17 (patch) | |
tree | a390fde25cc019b5a19f2a96b061f7100fd9b02b /main.s | |
parent | a13dde134922a3ec5b16be1bb65a689f552b5418 (diff) | |
download | nes-snake-e3fae4da977856f5c953d9e3b3ea0bce51789a17.tar.gz nes-snake-e3fae4da977856f5c953d9e3b3ea0bce51789a17.zip |
check for collisions against the (currently invisible) wall
Diffstat (limited to 'main.s')
-rw-r--r-- | main.s | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -197,6 +197,25 @@ apply_direction: ADC head_x, y ; head_x offset by 1 is head_y STA head_x, y +check_collisions + LDA head_x + CMP #$18 + BCC collision + CMP #$E8 + BCS collision + + LDA head_y + CMP #$18 + BCC collision + CMP #$E8 + BCS collision + + JMP end_game_loop + +collision: + LDA #$00 + STA game_state + end_game_loop: RTS |