Commit aa9e5875 by BellCodeEditor

save project

parent ad298bb1
Showing with 8 additions and 6 deletions
......@@ -77,14 +77,14 @@ while True:
if t > 0:
y -= t
wukong.rect.y = y
t -= 2
t -= 1
else:
jumpState = "down"
if jumpState == "down": # 降落状态
if t <= 30:
y += t
wukong.rect.y = y
t += 2
t += 1
else:
jumpState = "runing"
t =30
......@@ -118,10 +118,12 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200))
gamestate = False
if obstacle.rect.x - obstacle.rect.width <= wukong.rect.x :
#pygame.mixer.music.play()
score += obstacle.score
obstacle.score = 0
if sprite.rect.x + sprite.rect.width < wukong.rect.x :
score += sprite.score
sprite.score = 0
print(score)
if sprite.rect.x + sprite.rect.width in range(wukong.rect.x-7,wukong.rect.x+7) :
pygame.mixer.music.play()
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
screen.blit(scoreSurf,(850,20))
......
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