Updated comments on eat-food and self-eat detection
This commit is contained in:
parent
e479dcb5fe
commit
53b3e700ca
@ -310,7 +310,9 @@ overEndCheck:
|
|||||||
|
|
||||||
ldy #0
|
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
|
lda snakeX ; calc head location in memory
|
||||||
sta calcTileX
|
sta calcTileX
|
||||||
lda snakeY
|
lda snakeY
|
||||||
@ -318,7 +320,7 @@ overEndCheck:
|
|||||||
jsr calcTileMem
|
jsr calcTileMem
|
||||||
lda (tileMem),y ; read content of head memory location
|
lda (tileMem),y ; read content of head memory location
|
||||||
cmp foodTile
|
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,
|
ldx length ; else, increment snake length,
|
||||||
inx
|
inx
|
||||||
stx length
|
stx length
|
||||||
@ -361,11 +363,11 @@ foodNoLow:
|
|||||||
jmp checkEndSelfEat
|
jmp checkEndSelfEat
|
||||||
checkEndFood:
|
checkEndFood:
|
||||||
|
|
||||||
|
; --- Self eat ---
|
||||||
checkSelfEat:
|
checkSelfEat:
|
||||||
cmp snakeTile
|
cmp snakeTile
|
||||||
bne checkEndSelfEat
|
bne checkEndSelfEat
|
||||||
jmp gameover
|
jmp gameover
|
||||||
|
|
||||||
checkEndSelfEat:
|
checkEndSelfEat:
|
||||||
|
|
||||||
; Draw snake head
|
; Draw snake head
|
||||||
|
Loading…
Reference in New Issue
Block a user