Commit 849b49a4 by BellCodeEditor

save project

parent ea58216b
Showing with 4 additions and 4 deletions
...@@ -44,7 +44,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -44,7 +44,7 @@ hero = [pygame.image.load('hero1.png'),
index = 0 index = 0
y = 400 y = 400
jumpState = "runing" jumpState = "runing"
t = 35 t = 36
road_x = 0 road_x = 0
bg_x = 0 bg_x = 0
time = 0 time = 0
...@@ -86,13 +86,13 @@ while True: ...@@ -86,13 +86,13 @@ while True:
else: else:
jumpState = "down" jumpState = "down"
if jumpState == "down": # 降落状态 if jumpState == "down": # 降落状态
if t <= 35: if t <= 36:
y += t y += t
wukong.rect.y = y wukong.rect.y = y
t += 2 t += 2
else: else:
jumpState = "runing" jumpState = "runing"
t = 35 t = 36
# 将背景图画上去 # 将背景图画上去
bg_x -= 1 bg_x -= 1
...@@ -126,7 +126,7 @@ while True: ...@@ -126,7 +126,7 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束 gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200)) screen.blit(gameover, (400, 200))
gamestate = False gamestate = False
else: else: #在循环判断精灵碰撞的else里面进行增加分数效果
if sprite.rect.x + sprite.rect.width < wukong.rect.x: if sprite.rect.x + sprite.rect.width < wukong.rect.x:
sn += sprite.sn sn += sprite.sn
sprite.sn = 0 sprite.sn = 0
......
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