Commit da808905 by BellCodeEditor

auto save

parent 56fcbba4
Showing with 4 additions and 5 deletions
import pygame
from pygame import locals
import random
# 初始化pygame,为使用硬件做准备
pygame.init()
x,y=240,120
......@@ -19,6 +19,7 @@ while True:
x+=30
ada.append((x,y))
ada.pop(0)
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
......@@ -31,11 +32,9 @@ while True:
for i in range(len(ada)-1):
screen.blit(body,ada[i])
screen.blit(food, (360, 300))
if x<0 or x>630 or y<0 or y>450:
exit()
if x<0
# 将果实画上去
# 刷新画面
pygame.display.update()
FPSLOCK.tick(3)
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