Commit 494c8bcd by BellCodeEditor

save project

parent 214fd3dc
Showing with 13 additions and 5 deletions
import pygame
from pygame import locals
import random
import json
pygame.init() # 初始化
class Block(pygame.sprite.Sprite): # 障碍物精灵类
......@@ -58,11 +58,12 @@ old=0
block_list =pygame.sprite.Group() # 创建精灵组
with open("record.txt",'r',encoding='uft-8') as f:
with open("record.txt",'r',encoding='utf-8') as f:
n=f.read()
one = n["第1名"]
two = n["第2名"]
three = n["第3名"]
n1 = json.loads(n)
one = n1["第1名"]
two = n1["第2名"]
three = n1["第3名"]
print(one,two,three)
while True:
for event in pygame.event.get():
......@@ -138,6 +139,13 @@ while True:
fs = zt.render("分数"+str(score),True,(255,255,255))
screen.blit(fs,(880,20))
fs = zt.render("分数"+str(one),True,(255,255,255))
screen.blit(fs,(880,50))
fs = zt.render("分数"+str(two),True,(255,255,255))
screen.blit(fs,(880,80))
fs = zt.render("分数"+str(three),True,(255,255,255))
screen.blit(fs,(880,110))
# 刷新画面
pygame.display.update()
FPS.tick(60)
......
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