From 53b3e700cac7f3c4eedc423948a5e9a978130a7f Mon Sep 17 00:00:00 2001 From: giomba Date: Fri, 22 Dec 2017 12:14:37 +0100 Subject: [PATCH] Updated comments on eat-food and self-eat detection --- snake.asm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/snake.asm b/snake.asm index 8d9e185..c6e7dec 100644 --- a/snake.asm +++ b/snake.asm @@ -310,7 +310,9 @@ overEndCheck: ldy #0 - ; Check for food eat / wall hit (actually doing food check only) + ; Check for food eat / wall hit / self-eat + ; - - - - - - - - - - - - - - - - - - - - - - + ; --- Food eat --- lda snakeX ; calc head location in memory sta calcTileX lda snakeY @@ -318,7 +320,7 @@ overEndCheck: jsr calcTileMem lda (tileMem),y ; read content of head memory location cmp foodTile - bne checkSelfEat ; if memory does not contain food, then skip to next test... + bne checkSelfEat ; if memory does not contain food, then skip to self-eat test... ldx length ; else, increment snake length, inx stx length @@ -361,11 +363,11 @@ foodNoLow: jmp checkEndSelfEat checkEndFood: + ; --- Self eat --- checkSelfEat: cmp snakeTile bne checkEndSelfEat jmp gameover - checkEndSelfEat: ; Draw snake head