Commit 8cf2fca4 by BellCodeEditor

save project

parent ebf64d6a
Showing with 6 additions and 0 deletions
...@@ -10,6 +10,7 @@ body=pygame.image.load("body.png") ...@@ -10,6 +10,7 @@ body=pygame.image.load("body.png")
apple=pygame.image.load("apple.png") apple=pygame.image.load("apple.png")
x,y=240,120 x,y=240,120
position=[(180,90)(180,120)(210,120)(x,y)]
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((660,480)) screen = pygame.display.set_mode((660,480))
...@@ -18,10 +19,14 @@ while True: ...@@ -18,10 +19,14 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
x+=30 x+=30
position.append((x,y))
position.pop(0)
screen.blit(background,(0,0)) screen.blit(background,(0,0))
screen.blit(right,(x,y)) screen.blit(right,(x,y))
screen.blit(body,(90,150)) screen.blit(body,(90,150))
screen.blit(apple,(120,240)) screen.blit(apple,(120,240))
pygame.display.update() pygame.display.update()
for i in range(len(position)-1):
screen.bilt(body,position[i])
FPSCLOCK.tick(3) 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