Commit 963d9f0e by BellCodeEditor

auto save

parent 80349b8b
Showing with 2 additions and 14 deletions
......@@ -2,7 +2,6 @@ import pygame
from pygame import locals
import random
pygame.init() # 初始化
class Block(pygame.sprite.Sprite): # 障碍物精灵类
......@@ -58,13 +57,6 @@ old_score=0
speedx=8
audio_player=pygame.mixer.Sound("score.wav")
with open("record.txt",'r",encoding="utf-8") as f3:
content=f3.read()
record=json.loads(content)
one=record["第1名"]
t=record["第2名"]
one=record["第3名"]
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -139,12 +131,7 @@ while True:
old_score=score
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
screen.blit(scoreSurf,(850,20))
scoreSurf2 = basic_font.render("第1名:"+str(one),True,(255,0,0))
screen.blit(scoreSurf2,(850,50))
scoreSurf3 = basic_font.render("第2名:"+str(two),True,(255,0,0))
screen.blit(scoreSurf3,(850,80))
scoreSurf4 = basic_font.render("第3名:"+str(three),True,(255,0,0))
screen.blit(scoreSurf4,(850,110))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
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