Commit c17d7781 by BellCodeEditor

save project

parent 9e74b6df
Showing with 15 additions and 2 deletions
import pygame import pygame
from pygame import locals from pygame import locals
import random import random
import json
pygame.init() pygame.init()
...@@ -43,8 +44,13 @@ hero = [pygame.image.load('hero1.png'), ...@@ -43,8 +44,13 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
#o=Block(stone,cacti,apple) #o=Block(stone,cacti,apple)
with open('record.txt','r',encoding='utf-8') as f:
content=f.read()
content=json.loads(content)
one=content['第1名']
two=content['第2名']
three=content['第3名']
block_list=pygame.sprite.Group() block_list=pygame.sprite.Group()
c
time=0 time=0
index = 0 index = 0
JumpSpeed= 30 JumpSpeed= 30
...@@ -144,7 +150,14 @@ while True: ...@@ -144,7 +150,14 @@ while True:
scoreWord=word.render(info+str(word2),True,(255,255,255)) scoreWord=word.render(info+str(word2),True,(255,255,255))
screen.blit(scoreWord, (730,10)) screen.blit(scoreWord, (730,10))
score1=word.render('First:'+str(one),True,(255,255,255))
screen.blit(score1, (800,50))
score1=word.render('Second:'+str(two),True,(255,255,255))
screen.blit(score1, (800,90))
score1=word.render('Third:'+str(three),True,(255,255,255))
screen.blit(score1, (800,130))
pygame.display.update() pygame.display.update()
FPS.tick(80) FPS.tick(80)
......
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