aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.s19
1 files changed, 19 insertions, 0 deletions
diff --git a/main.s b/main.s
index 6138de9..4b8e5d8 100644
--- a/main.s
+++ b/main.s
@@ -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