Commit 6318a37c by BellCodeEditor

save project

parent a667caed
Showing with 6 additions and 5 deletions
......@@ -3,6 +3,7 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
x,y=240,360
a=[(150,360),(180,360),(210,360),(x,y)]
# 创建一个窗口
screen=pygame.display.set_mode((660,480))
FPSCLOCK=pygame.time.Clock()
......@@ -16,11 +17,12 @@ while True:
if event.type == locals.QUIT:
exit()
x+=30
a.append((x,y))
a.pop(0)
screen.blit(background,(0,0))
screen.blit(right,(x,y))
screen.blit(right,a[-1])
for i in range(len(a)-1):
screen.blit(body,a[i])
screen.blit(food,(330,420))
screen.blit(body,(210,360))
screen.blit(body,(180,360))
screen.blit(body,(150,360))
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