Lengthen the snake when it eats a fruit
This commit is contained in:
parent
76ceb71e93
commit
4a63bf5467
|
@ -156,7 +156,7 @@ move_snake:
|
||||||
ld i, single_pixel
|
ld i, single_pixel
|
||||||
drw head_x_reg, head_y_reg, 1
|
drw head_x_reg, head_y_reg, 1
|
||||||
se vf, 0
|
se vf, 0
|
||||||
call collision
|
jp collision
|
||||||
drw tail_x_reg, tail_y_reg, 1
|
drw tail_x_reg, tail_y_reg, 1
|
||||||
|
|
||||||
; Load the direction the snake was moving at tail's location
|
; Load the direction the snake was moving at tail's location
|
||||||
|
@ -257,7 +257,8 @@ collision:
|
||||||
jp tail_collision
|
jp tail_collision
|
||||||
|
|
||||||
eat_fruit:
|
eat_fruit:
|
||||||
; TODO: Lenghten snake
|
; Jumping to collision skips tail moving code, so we get the snake
|
||||||
|
; lengthening for free
|
||||||
ld v0, 1
|
ld v0, 1
|
||||||
ld st, v0
|
ld st, v0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue