Commit c26d084f by BellCodeEditor

save project

parent b4d735df
Showing with 5 additions and 3 deletions
...@@ -63,13 +63,15 @@ while True: ...@@ -63,13 +63,15 @@ while True:
for i in range(len(position)-1): for i in range(len(position)-1):
screen.blit(body, position[i]) screen.blit(body, position[i])
if x==ax and y==ay: if x==ax and y==ay:
ax=random.randint(0,660) a2=random.randint(1,22)
ay=random.randint(0,480) a1=random.randint(1,16)
ax=30*a1-30
ay=30*a2-30
# 将果实画上去 # 将果实画上去
screen.blit(food, (ax, ay)) screen.blit(food, (ax, ay))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(1000) FPSCLOCK.tick(7)
......
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