Commit 846612e2 by BellCodeEditor

save project

parent 5dbf159a
Showing with 10 additions and 10 deletions
...@@ -134,15 +134,15 @@ while True: ...@@ -134,15 +134,15 @@ while True:
record["1"] = score record["1"] = score
record["2"] = one record["2"] = one
record["3"] = two record["3"] = two
elif score > two: elif score > two:
record["2"] = score record["2"] = score
record["3"] = two record["3"] = two
else: else:
record["3"] = score record["3"] = score
record = json.dumps(record, ensure_ascii=False) record = json.dumps(record, ensure_ascii=False)
with open("record.txt","w",encoding='utf-8') as f: with open("record.txt","w",encoding='utf-8') as f:
f.write(record) f.write(record)
else: else:
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.score = 0 sprite.score = 0
...@@ -150,7 +150,7 @@ while True: ...@@ -150,7 +150,7 @@ while True:
if score > old_score: if score > old_score:
score_audio.play() score_audio.play()
old_score = score old_score = score
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