Эх сурвалжийг харах

Prevents the snake from disappearing when its eating an apple.

Sacha Ligthert 2 жил өмнө
parent
commit
3902d2b0a9
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      game.go

+ 1 - 1
game.go

@@ -97,8 +97,8 @@ func gameDirector(screen tcell.Screen, style tcell.Style, keypresses chan int, g
 		// Draw the screen
 		drawBox(screen, 0, 0, screenx-1, screeny-1, style)
 		drawCoords(screen, style, &snakex, &snakey)
-		drawSnake(screen, style, snakex, snakey)
 		drawApple(screen, style, apple.x, apple.y)
+		drawSnake(screen, style, snakex, snakey)
 		drawScore(screen, style, score)
 
 		// Draw the screen