Commit bbe9499f by BellCodeEditor

auto save

parent 59336384
Showing with 23 additions and 1 deletions
...@@ -4,4 +4,26 @@ import pygame ...@@ -4,4 +4,26 @@ import pygame
pygame.init() pygame.init()
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((800,600)) screen=pygame.display.set_mode((660,480))
kk=pygame.time.Clock()
x,y=240,120
position=[(180,90),(180,120),(210,120),(x,y)]
a=pygame.image.load('bg.png')
b=pygame.image.load('right.png')
c=pygame.image.load('apple.png')
d=pygame.image.load('body.png')
while True:
for i in pygame.event.get():
if i.type==pygame.QUIT:
exit()
x+=30
position.append((x,y))
position.pop(0)
screen.blit(a,(0,0))
screen.blit(b,position[-1])
for i in range(len(position)-1):
screen.blit(d,position[i])
screen.blit(c,(330,330))
pygame.display.update()
kk.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