Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson9_diy4
This project
Loading...
Sign in
Toggle navigation
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
8bfba5ba
authored
Apr 08, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
701b51b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
my_game.py
score.txt
my_game.py
View file @
8bfba5ba
...
...
@@ -123,7 +123,7 @@ while True:
else
:
duqu2
[
"第3名"
]
=
defen
with
open
(
'score.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
scorejsonw
:
xinjson
=
dumps
(
duqu2
)
xinjson
=
dumps
(
duqu2
,
ensure_ascii
=
False
)
scorejsonw
.
write
(
xinjson
)
else
:
if
zaw
.
rect
.
x
+
zaw
.
rect
.
width
<
wukong
.
rect
.
x
:
...
...
@@ -135,11 +135,11 @@ while True:
road_x
=
0
if
bg_x
<=-
1000
:
bg_x
=
0
text2
=
ziti
.
render
(
'第一名:'
+
str
(
one
),
True
,(
255
,
255
,
255
))
text2
=
ziti
.
render
(
'第一名:'
+
str
(
duqu2
[
"第1名"
]
),
True
,(
255
,
255
,
255
))
screen
.
blit
(
text2
,(
850
,
30
))
text3
=
ziti
.
render
(
'第二名:'
+
str
(
two
),
True
,(
255
,
255
,
255
))
text3
=
ziti
.
render
(
'第二名:'
+
str
(
duqu2
[
"第2名"
]
),
True
,(
255
,
255
,
255
))
screen
.
blit
(
text3
,(
850
,
50
))
text4
=
ziti
.
render
(
'第三名:'
+
str
(
three
),
True
,(
255
,
255
,
255
))
text4
=
ziti
.
render
(
'第三名:'
+
str
(
duqu2
[
"第3名"
]
),
True
,(
255
,
255
,
255
))
screen
.
blit
(
text4
,(
850
,
70
))
# 刷新画面
...
...
score.txt
View file @
8bfba5ba
{"\u7b2c1\u540d": 2, "\u7b2c2\u540d": 0, "\u7b2c3\u540d": 0}
\ No newline at end of file
{"第1名": 14, "第2名": 2, "第3名": 0}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment