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