Commit c91f5516 by BellCodeEditor

auto save

parent f8d7bdb3
Showing with 2 additions and 4 deletions
......@@ -23,7 +23,6 @@ x, y = 240, 120
position = [(180, 90), (180, 120), (210, 120), (x, y)]
setheading = "right"
snake_head = right
while True:
for event in pygame.event.get():
......@@ -57,9 +56,7 @@ while True:
if x == apple_x and y == apple_y:
num1 = random.randint(1,22)
num2 = random.randint(1,16)
apple_x = num1*30 - 30
apple_y = num2*30 - 30
else:
apple_x =
position.pop(0)
# 将背景图画上去
......@@ -69,6 +66,7 @@ while True:
# 将贪吃蛇的身体画上去
for i in range(len(position)-1):
screen.blit(body, position[i])
# 将果实画上去
screen.blit(food, (apple_x, apple_y))
# 刷新画面
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment