Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson9_diy3
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
10be6be3
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
002ed809
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
my_game.py
my_game.py
View file @
10be6be3
...
@@ -55,7 +55,7 @@ gamestate = True
...
@@ -55,7 +55,7 @@ gamestate = True
score
=
0
score
=
0
block_list
=
pygame
.
sprite
.
Group
()
# 创建精灵组
block_list
=
pygame
.
sprite
.
Group
()
# 创建精灵组
f
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
20
)
f
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
20
)
speed
=
8
speed
=
10
sound
=
pygame
.
mixer
.
Sound
(
'score.wav'
)
sound
=
pygame
.
mixer
.
Sound
(
'score.wav'
)
while
True
:
while
True
:
for
event
in
pygame
.
event
.
get
():
for
event
in
pygame
.
event
.
get
():
...
@@ -116,7 +116,7 @@ while True:
...
@@ -116,7 +116,7 @@ while True:
screen
.
blit
(
sprite
.
image
,
(
sprite
.
rect
.
x
,
sprite
.
rect
.
y
))
screen
.
blit
(
sprite
.
image
,
(
sprite
.
rect
.
x
,
sprite
.
rect
.
y
))
if
sprite
.
rect
.
x
<=
0
-
sprite
.
rect
.
width
:
if
sprite
.
rect
.
x
<=
0
-
sprite
.
rect
.
width
:
sound
.
play
()
sound
.
play
()
speed
=
8
+
score
//
3
speed
=
10
+
score
//
3
score
+=
1
score
+=
1
sprite
.
kill
()
sprite
.
kill
()
if
pygame
.
sprite
.
collide_rect
(
wukong
,
sprite
):
# 精灵碰撞检测
if
pygame
.
sprite
.
collide_rect
(
wukong
,
sprite
):
# 精灵碰撞检测
...
...
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