Commit 2258d89f by BellCodeEditor

save project

parent b0c8a7ce
Showing with 7 additions and 4 deletions
...@@ -50,6 +50,9 @@ road_x = 0 ...@@ -50,6 +50,9 @@ road_x = 0
bg_x = 0 bg_x = 0
time = 0 time = 0
gamestate = True gamestate = True
score=0
speed=8
old_score=score
block_list =pygame.sprite.Group() # 创建精灵组 block_list =pygame.sprite.Group() # 创建精灵组
...@@ -70,8 +73,8 @@ while True: ...@@ -70,8 +73,8 @@ while True:
if index >= 5: if index >= 5:
index = 0 index = 0
if gamestate == True: if gamestate == True
if jumpState == "up": # 起跳状态 if jumpState ="up": # 起跳状态
if t > 0: if t > 0:
y -= t y -= t
wukong.rect.y = y wukong.rect.y = y
...@@ -120,8 +123,8 @@ while True: ...@@ -120,8 +123,8 @@ while True:
if sprite.rect.with.width<wukong.rect.x: if sprite.rect.with.width<wukong.rect.x:
score+=sprite.score score+=sprite.score
sprite.score=0 sprite.score=0
print(sprite) print(s)
if stone
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0)) scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
screen.blit(scoreSurf,(850,20)) 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