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