Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson9_diy2
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
5ad3123f
authored
a year ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d1378544
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
my_game.py
my_game.py
View file @
5ad3123f
...
@@ -42,7 +42,7 @@ hero = [pygame.image.load('hero1.png'),
...
@@ -42,7 +42,7 @@ hero = [pygame.image.load('hero1.png'),
pygame
.
image
.
load
(
'hero4.png'
),
pygame
.
image
.
load
(
'hero4.png'
),
pygame
.
image
.
load
(
'hero5.png'
)]
pygame
.
image
.
load
(
'hero5.png'
)]
basic_font
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
32
)
basic_font
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
32
)
score_audio
=
pygame
.
mixer
.
Sound
score_audio
=
pygame
.
mixer
.
Sound
(
'score.wav'
)
index
=
0
index
=
0
y
=
400
y
=
400
jumpState
=
"runing"
jumpState
=
"runing"
...
@@ -76,14 +76,14 @@ while True:
...
@@ -76,14 +76,14 @@ while True:
if
t
>
0
:
if
t
>
0
:
y
-=
t
y
-=
t
wukong
.
rect
.
y
=
y
wukong
.
rect
.
y
=
y
t
-=
1
t
-=
1
.5
else
:
else
:
jumpState
=
"down"
jumpState
=
"down"
if
jumpState
==
"down"
:
# 降落状态
if
jumpState
==
"down"
:
# 降落状态
if
t
<=
30
:
if
t
<=
30
:
y
+=
t
y
+=
t
wukong
.
rect
.
y
=
y
wukong
.
rect
.
y
=
y
t
+=
1
t
+=
1
.5
else
:
else
:
jumpState
=
"runing"
jumpState
=
"runing"
t
=
30
t
=
30
...
...
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