Commit e1b1eefe by BellCodeEditor

save project

parent 8d5dd569
Showing with 10 additions and 5 deletions
...@@ -9,7 +9,7 @@ apple = pygame.image.load('apple.png') ...@@ -9,7 +9,7 @@ apple = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
# 创建一个窗口 # 创建一个窗口
x, y = 240, 120 x, y = 240, 120
pos = [(180,90),(180,120),(210,120),(x,y)]
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
print(event) print(event)
...@@ -17,11 +17,16 @@ while True: ...@@ -17,11 +17,16 @@ while True:
exit() exit()
screen.blit(background,(0,0)) screen.blit(background,(0,0))
x+=30 x+=30
screen.blit(right,(x,y)) pos.append((x,y))
pos.pop(0)
screen.blit(right,pos[-1])
for i in range(len(pos)-1):
screen.blit(body,(pos[i]))
# screen.blit(body,(150,120))
# screen.blit(body,(180,90))
# screen.blit(body,(150,90))
screen.blit(apple,(120,300)) screen.blit(apple,(120,300))
screen.blit(body,(150,120))
screen.blit(body,(180,90))
screen.blit(body,(150,90))
pygame.display.update() pygame.display.update()
aaz = pygame.time.Clock() aaz = pygame.time.Clock()
aaz.tick(3) aaz.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