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
37648294
authored
3 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c066a5a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
my_game.py
record.txt
my_game.py
View file @
37648294
...
...
@@ -77,6 +77,9 @@ while True:
if
jumpState
==
"runing"
:
if
event
.
key
==
locals
.
K_SPACE
:
jumpState
=
"up"
if
event
.
type
==
locals
.
MOUSEBUTTONDOWN
:
mouse_x
,
mouse_y
=
event
.
pos
speed
=
8
+
score
//
3
...
...
@@ -92,14 +95,14 @@ while True:
if
t
>
0
:
y
-=
t
wukong
.
rect
.
y
=
y
t
-=
2.3
t
-=
1.7
else
:
jumpState
=
"down"
if
jumpState
==
"down"
:
# 降落状态
if
t
<=
30
:
y
+=
t
wukong
.
rect
.
y
=
y
t
+=
2.3
t
+=
1.7
else
:
jumpState
=
"runing"
t
=
30
...
...
This diff is collapsed.
Click to expand it.
record.txt
View file @
37648294
{"第1名": 4, "第2名": 2, "第3名": 1}
\ No newline at end of file
{"第1名": 46, "第2名": 35, "第3名": 16}
\ No newline at end of file
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