Commit 52086e55 by BellCodeEditor

auto save

parent 1d671d36
Showing with 11 additions and 12 deletions
...@@ -18,7 +18,7 @@ hero4 = pygame.image.load('hero4.png') ...@@ -18,7 +18,7 @@ hero4 = pygame.image.load('hero4.png')
hero5 = pygame.image.load('hero5.png') hero5 = pygame.image.load('hero5.png')
a=[hero1,hero2,hero3,hero4,hero5] a=[hero1,hero2,hero3,hero4,hero5]
jumps = 'running' jumps="running"
y=400 y=400
index = 0 index = 0
...@@ -29,18 +29,16 @@ while True: ...@@ -29,18 +29,16 @@ while True:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if event. == locals.: if key.type == locals.K_SPACE:
jumps ='jump' jumps="up"
if jumps='jump': if jumps=="up":
if y>=150: if y>150:
y-=5 y-=5
jumps ='down' jumps="down"
if jumps='down': if jumps=="down":
if t<=400: if y<400:
y+=5 y+=5
jumps = 'running' jumps="running"
...@@ -52,7 +50,7 @@ while True: ...@@ -52,7 +50,7 @@ while True:
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
screen.blit(b, (150, 400)) screen.blit(b, (150, y))
# 刷新画面 # 刷新画面
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