瀏覽代碼

Prevents the snake from disappearing when its eating an apple.

Sacha Ligthert 2 年之前
父節點
當前提交
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