Commit a9393942 by BellCodeEditor

save project

parent f07e26cb
Showing with 9 additions and 2 deletions
...@@ -17,7 +17,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -17,7 +17,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
y=400
index = 0 index = 0
asd=0 asd=0
while True: while True:
...@@ -25,14 +25,20 @@ while True: ...@@ -25,14 +25,20 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type==locals.QUIT:
if event.key
wokong=hero[asd] wokong=hero[asd]
asd=asd+1 asd=asd+1
if asd >=5: if asd >=5:
asd=0 asd=0
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
screen.blit(wokong, (150, 400)) screen.blit(wokong, (150, y))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(30) FPS.tick(30)
\ 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