Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson7_diy1
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
f8672113
authored
Dec 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
6bc775a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
mygame.py
score.txt
mygame.py
0 → 100644
View file @
f8672113
import
pygame
from
pygame
import
locals
screen
=
pygame
.
display
.
set_mode
((
1000
,
600
))
pygame
.
display
.
set_caption
(
"悟空酷跑"
)
fps
=
pygame
.
time
.
Clock
()
bg
=
pygame
.
image
.
load
(
"bg.png"
)
bush
=
pygame
.
image
.
load
(
"bush.png"
)
cacti
=
pygame
.
image
.
load
(
"cacti.png"
)
stone
=
pygame
.
image
.
load
(
"stone.png"
)
road
=
pygame
.
image
.
load
(
"road.png"
)
hero
=
[
pygame
.
image
.
load
(
"hero1.png"
),
pygame
.
image
.
load
(
"hero2.png"
),
pygame
.
image
.
load
(
"hero3.png"
),
pygame
.
image
.
load
(
"hero4.png"
),
pygame
.
image
.
load
(
"hero5.png"
)]
index
=
0
wukong
=
hero
[
index
]
while
True
:
for
event
in
pygame
.
event
.
get
():
if
event
.
type
==
locals
.
QUIT
:
exit
()
index
+=
1
if
index
>
4
:
index
=
0
wukong
=
hero
[
index
]
screen
.
blit
(
bg
,(
0
,
0
))
screen
.
blit
(
road
,(
0
,
500
))
screen
.
blit
(
wukong
,(
150
,
400
))
pygame
.
display
.
update
()
fps
.
tick
(
60
)
\ No newline at end of file
score.txt
View file @
f8672113
{"第1名": 0, "第2名": 0, "第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