Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson8_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
8c6da6c9
authored
Apr 05, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a2c74e13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
my_game.py
record.txt
my_game.py
View file @
8c6da6c9
...
@@ -81,4 +81,18 @@ while True:
...
@@ -81,4 +81,18 @@ while True:
screen
.
blit
(
obstacle
,
(
rect
.
x
,
rect
.
y
))
screen
.
blit
(
obstacle
,
(
rect
.
x
,
rect
.
y
))
# 刷新画面
# 刷新画面
pygame
.
display
.
update
()
pygame
.
display
.
update
()
FPS
.
tick
(
30
)
FPS
.
tick
(
30
)
\ No newline at end of file
time
+=
1
if
time
>=
60
:
r
=
ramdon
.
randint
(
0
,
100
)
if
r
>
40
:
obstacle
=
Block
(
bush
,
cacti
,
stone
)
block_list
.
add
(
obstacle
)
time
=
0
for
prop
in
block_list
:
prop
.
rect
.
x
-=
8
screen
.
blit
(
prop
.
image
,(
prop
.
rect
.
x
,
prop
.
rect
.
y
))
if
prop
.
rect
.
x
<=
0
-
prop
.
rect
.
width
:
prop
.
kill
()
pygame
.
display
.
update
()
FPS
.
tick
(
60
)
\ No newline at end of file
record.txt
View file @
8c6da6c9
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