Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson7_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
9ec8f0c1
authored
3 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
4f54aa1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
my_game.py
my_game.py
View file @
9ec8f0c1
...
...
@@ -21,7 +21,7 @@ y=400
jumpState
=
"runing"
t
=
30
road_x
=
0
ba
ckground
_x
=
0
ba_x
=
0
obstacle
=
random
.
choice
([
apple
,
stone
,
cacti
])
rect
=
obstacle
.
get_rect
()
rect
.
y
=
500
-
rect
.
height
...
...
@@ -53,9 +53,7 @@ while True:
y
=
400
if
jumpState
==
"runing"
:
if
not
y
==
400
:
y
=
400
y
=
400
wukong
=
hero
[
index
]
if
jumpState
==
"runing"
:
...
...
@@ -64,13 +62,13 @@ while True:
index
=
0
# 将背景图画上去
screen
.
blit
(
background
,
(
ba
ckground
_x
,
0
))
screen
.
blit
(
background
,
(
ba_x
,
0
))
road_x
-=
8
if
road_x
<=-
1000
:
road_x
=
0
ba
ckground
_x
-=
2
if
ba
ckground
_x
<=-
1000
:
ba
ckground
_x
=
0
ba_x
-=
2
if
ba_x
<=-
1000
:
ba_x
=
0
screen
.
blit
(
road
,
(
road_x
,
500
))
screen
.
blit
(
wukong
,
(
150
,
y
))
...
...
This diff is collapsed.
Click to expand it.
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