Commit 76c44bb1 by BellCodeEditor

save project

parent 7f582064
Showing with 9 additions and 9 deletions
......@@ -4,30 +4,30 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
pygame.display.set_mode((660,480))
FPSCLOCK.pygame.time.Clock()
FPSCLOCK=pygame.time.Clock()
background=pygame.image.load('bg.png')
right=pygame.image.load('right.png')
food=pygame.image.load('apple.png')
body=pygame.image.load('body.png')
x,y = 240,120
position = [(180,90),(180,120),(210,120),(x,y)]
while True:
for event in pygame.event.get():
print(event)
if event.type == locals.QUIT
if event.type == locals.QUIT:
exit()
x += 30
position.append((x,y))
position.pop(0)
screem.blit(background,(0,0))
screem.blit(right,(x,y))
screem.blit(body,())
for i in range(len(position)-1):
screem.blit(body,position[i])
pygame
FPSCLOCK.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