Commit 6e59c33c by BellCodeEditor

save project

parent 44a15c30
Showing with 3 additions and 3 deletions
File added
...@@ -105,7 +105,7 @@ while True: ...@@ -105,7 +105,7 @@ while True:
if time >= 60: # 创建障碍物精灵 if time >= 60: # 创建障碍物精灵
time = 0 time = 0
num = random.randint(0,50) num = random.randint(0,50)
if num > 20: if num > 10:
obstacle = Block(bush,cacti,stone) obstacle = Block(bush,cacti,stone)
block_list.add(obstacle) block_list.add(obstacle)
for sprite in block_list: # 遍历、展示障碍物精灵 for sprite in block_list: # 遍历、展示障碍物精灵
...@@ -119,8 +119,8 @@ while True: ...@@ -119,8 +119,8 @@ while True:
gamestate = False gamestate = False
else: else:
if (sprite.rect.x+ sprite.rect.width)<wukong.rect.x: if (sprite.rect.x+ sprite.rect.width)<wukong.rect.x:
score+=i.score score+=sprite.score
i.score=0 sprite.score=0
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