Commit f0d006e7 by BellCodeEditor

save project

parent 2b8bcb8b
Showing with 16 additions and 1 deletions
import pygame
from pygame import locals
import random
import json
class Block(pygame.sprite.Sprite):
def __init__(self,image1,image2,image3):
......@@ -51,6 +52,14 @@ score=0
old_score=0
Block_list=pygame.sprite.Group()
with open('record.txt','r',encoding='utf-8') as f:
content=f.read()
record=json.loads(content)
one=record['第1名']
two=record['第2名']
thr=record['第3名']
while True:
for event in pygame.event.get():
......@@ -123,7 +132,13 @@ while True:
score+=prop.score
prop.score=0
f = basic_font.render('分数:'+str(score),True,(255,0,0))
screen.blit(f,(850,20))
screen.blit(f,(880,20))
a = basic_font.render('第一名:'+str(one),True,(255,0,0))
screen.blit(a,(880,50))
b = basic_font.render('第二名:'+str(two),True,(255,0,0))
screen.blit(b,(880,80))
c = basic_font.render('第三名:'+str(thr),True,(255,0,0))
screen.blit(c,(880,110))
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