Commit 7fa48131 by BellCodeEditor

auto save

parent 980256bd
Showing with 10 additions and 10 deletions
......@@ -40,7 +40,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
#my.font=pygame.font.Font("STKAITI.TTF")
my_font=pygame.font.Font("STKAITI.TTF",8)
index = 0
y = 400
......@@ -53,12 +53,12 @@ gamestate = True
score=0
speed=8
block_list =pygame.sprite.Group() # 创建精灵组
with open('record.txt','r',encoding="utf-8")as f:
content=f.read()
with open('record.txt','r',encoding="utf-8")as file:
content=file.read()
record=json.loads(content)
one=record["第名"]
two=record["第名"]
three=record["第名"]
one=record["第1名"]
two=record["第2名"]
three=record["第3名"]
while True:
for event in pygame.event.get():
......@@ -138,10 +138,10 @@ while True:
if score>old.score:
score_sound.play()
old_score=score
text=my.font.render("分数:"+str(score),True,(0,0,0))
#if score>old.score:
# score_sound.play()
# old_score=score
text=my_font.render("分数:"+str(score),True,(0,0,0))
screen.blit(text,(900,20))
text=my.font.render("分数:"+str(score),True,(0,0,0))
......
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