Commit 9f65c214 by BellCodeEditor

save project

parent 5a68dac5
Showing with 5 additions and 1 deletions
...@@ -54,6 +54,7 @@ while True: ...@@ -54,6 +54,7 @@ while True:
if jumpState == "runing": if jumpState == "runing":
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
jumpState = "up" jumpState = "up"
spead = 8 + score//3
if jumpState == "up": # 起跳状态 if jumpState == "up": # 起跳状态
if t > 0: if t > 0:
...@@ -80,7 +81,7 @@ while True: ...@@ -80,7 +81,7 @@ while True:
if bg_x <-1000: if bg_x <-1000:
bg_x=0 bg_x=0
screen.blit(background, (bg_x, 0)) # 远处背景 screen.blit(background, (bg_x, 0)) # 远处背景
road_x -=8 road_x -=spead
if road_x <-1000: if road_x <-1000:
road_x=0 road_x=0
screen.blit(road, (road_x, 500)) # 路 screen.blit(road, (road_x, 500)) # 路
...@@ -93,6 +94,9 @@ while True: ...@@ -93,6 +94,9 @@ while True:
if(sprite.rect.x + sprite.rect.width) < wukong.rect.x: if(sprite.rect.x + sprite.rect.width) < wukong.rect.x:
score += sprite.score score += sprite.score
sprite.screen = 0 sprite.screen = 0
if score > old_score:
score_audio.play()
old_score = score
if aa.rect.x <= 0-aa.rect.width: # 障碍物消失 if aa.rect.x <= 0-aa.rect.width: # 障碍物消失
# 创建障碍物对象 # 创建障碍物对象
aa=Block(bush,cacti,stone) aa=Block(bush,cacti,stone)
......
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