diff --git a/mato8.asm b/mato8.asm index 94b4146..973996e 100644 --- a/mato8.asm +++ b/mato8.asm @@ -153,12 +153,16 @@ spawn_fruit: ld i, single_pixel drw fruit_x_reg, fruit_y_reg, 1 - ; Did we spawn over the snake? - se vf, 0 - jp spawn_fruit + ; Did we spawn succesfully? + sne vf, 0 ret + ; No, we spawned over the snake. Erase and try again + ld i, single_pixel + drw fruit_x_reg, fruit_y_reg, 1 + jp spawn_fruit + turn_up: ; Don't allow 180° turns (which would kill the snake instantly) se v1, direction_down