Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson9_diy3

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 5dbaeb12 authored 2 months ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 8c386633
Hide whitespace changes
Inline Side-by-side
Showing with 10 additions and 0 deletions
  • my_game.py
  • score.txt
my_game.py
View file @ 5dbaeb12
import pygame import pygame
from pygame import locals from pygame import locals
import random import random
import json
pygame.init() # 初始化 pygame.init() # 初始化
...@@ -57,6 +58,13 @@ old_score = score ...@@ -57,6 +58,13 @@ old_score = score
block_list =pygame.sprite.Group() # 创建精灵组 block_list =pygame.sprite.Group() # 创建精灵组
with open('score.txt','r',encoding='utf-8')as f:
content = f.read()
record = json.locals(content)
one = content["第1名"]
two = content["第2名"]
three = content["第3名"]
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
......
This diff is collapsed. Click to expand it.
score.txt 0 → 100644
View file @ 5dbaeb12
{"第1名": 0, "第2名": 0, "第3名": 0}
\ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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