Commit 091180b2 by BellCodeEditor

save project

parent 199f9591
Showing with 7 additions and 2 deletions
...@@ -16,6 +16,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -16,6 +16,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'), pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
a=0
index = 0 index = 0
pygame.display.set_caption("悟空酷跑") pygame.display.set_caption("悟空酷跑")
while True: while True:
...@@ -23,11 +24,14 @@ while True: ...@@ -23,11 +24,14 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
a=a+1
if a==5:
a=0
b=hero[a]
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
screen.blit(hero, (150, 400)) screen.blit(b, (150, 400))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ 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