Commit 8e6026f0 by BellCodeEditor

save project

parent 4ef80165
Showing with 10 additions and 2 deletions
import random
ap1=360
ap2=300
import pygame
from pygame import locals
......@@ -46,7 +49,10 @@ while True:
elif heading=='up':
y-=30
else:
y+=30
y+=30
if x==ap1 and y==ap2:
ap1=random.(randint(0,21))30
ap2=random.(randint(0,15))*30
snake.append((x,y))
snake.pop(0)
# 将背景图画上去
......@@ -58,9 +64,10 @@ while True:
screen.blit(body, snake[i])
# 将果实画上去
screen.blit(food, (360, 300))
screen.blit(food, (ap1, ap2))
# 刷新画面
pygame.display.update()
FPS.tick(5)
\ 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