From 605bd1327b63e7b4f239371bb87f12da2b89138e Mon Sep 17 00:00:00 2001
From: BellCodeEditor <bellcode_dev@bell.ai>
Date: Sun, 17 Oct 2021 14:40:44 +0800
Subject: [PATCH] save project

---
 snake.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/snake.py b/snake.py
index 693f54a..15caae8 100644
--- a/snake.py
+++ b/snake.py
@@ -52,14 +52,15 @@ while True:
     else:
         y += 30
     position.append((x, y))
-    position.pop(0)
     # 将背景图画上去
     screen.blit(background, (0, 0))
     if x == apple_x and y == apple_y:
         unm1 = random.randint(0,21)
         unm2 = random.randint(0,15) 
         apple_x = unm1*30
-        apple_y = unm2*30       
+        apple_y = unm2*30
+    else:
+        position.pop(0)       
     # 将贪吃蛇的头画上去
     screen.blit(snake_head, position[-1])
     # 将贪吃蛇的身体画上去
--
libgit2 0.25.0