Commit 5fd446ab by BellCodeEditor

save project

parent fed9e09d
Showing with 12 additions and 2 deletions
......@@ -2,9 +2,7 @@ import pygame
from pygame import locals
import random
import json
pygame.init() # 初始化
class Block(pygame.sprite.Sprite): # 障碍物精灵类
def __init__(self, image1, image2, image3):
super().__init__()
......@@ -129,11 +127,23 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200))
gamestate = False
if score>three:
if score>one:
record["第1名"]=score
record["第2名"]=oen
record["第3名"]=two
elif score>two:
record["第2名"]=score
record["第3名"]=two
else:
record["第3名"]=score
json.dunps("record",ensure_ascii=Flase)
else:
if (sprite.rect.x + sprite.rect.width) < wukong.rect.x:
score += sprite.score
sprite.score = 0
if score > old_score:
score_audio.play()
old_score = score
......
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