Commit e53ef021 by BellCodeEditor

auto save

parent f2c1e616
Showing with 9 additions and 4 deletions
...@@ -7,18 +7,22 @@ bg=pygame.image.load('bg.png') ...@@ -7,18 +7,22 @@ bg=pygame.image.load('bg.png')
right=pygame.image.load('right.png') right=pygame.image.load('right.png')
food=pygame.image.load('apple.png') food=pygame.image.load('apple.png')
body=pygame.image.load('body.png') body=pygame.image.load('body.png')
FPS=pygame.time.Clock()
x,y=240,120
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((660,480)) screen=pygame.display.set_mode((660,480))
while True: while True:
x+=30
for event in pygame.event.get(): for event in pygame.event.get():
print(event) print(event)
if event.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
screen.blit(bg,(0,0)) screen.blit(bg,(0,0))
screen.blit(right,(180,270)) screen.blit(right,(x,y))
screen.blit(body,(150,270)) screen.blit(body,(210,120))
screen.blit(body,(120,270)) screen.blit(body,(180,120))
screen.blit(body,(120,300)) screen.blit(body,(180,90))
screen.blit(food,(540,300)) screen.blit(food,(540,300))
pygame.display.update() pygame.display.update()
FPS.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