Commit 8d842d83 by BellCodeEditor

save project

parent db47e7a1
Showing with 2 additions and 18 deletions
...@@ -53,20 +53,4 @@ while True: ...@@ -53,20 +53,4 @@ while True:
y += 30 y += 30
if x == apple_y if x == apple_y
apple_x = random.randint(0,660) apple
apple_y = random.randint(0,480) \ No newline at end of file
position.append((x, y))
position.pop(0)
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇的头画上去
screen.blit(snake_head, position[-1])
# 将贪吃蛇的身体画上去
for i in range(len(position)-1):
screen.blit(body, position[i])
# 将果实画上去
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.update()
FPSCLOCK.tick(3)
\ No newline at end of file
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