Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson7_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
83387a6a
authored
May 27, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
fe320d9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
my_game.py
my_game.py
View file @
83387a6a
...
...
@@ -6,7 +6,7 @@ pygame.init() # 鍒濆鍖?
# 鍒涘缓涓€涓獥鍙?
screen
=
pygame
.
display
.
set_mode
((
1000
,
600
))
FPS
=
pygame
.
time
.
Clock
()
# pygame鏃堕挓锛屾帶鍒舵父鎴忛€熷害锛堝抚鏁帮級
pygame
.
display
.
set_caption
(
"
鎮熺┖閰疯窇
"
)
pygame
.
display
.
set_caption
(
"
悟空跑酷
"
)
# 杞藉叆鍥剧墖
background
=
pygame
.
image
.
load
(
'bg.png'
)
# 鑳屾櫙
road
=
pygame
.
image
.
load
(
'road.png'
)
# 璺?
...
...
@@ -23,8 +23,12 @@ index = 0
while
True
:
for
event
in
pygame
.
event
.
get
():
if
event
.
type
==
locals
.
QUIT
:
# 鎺ユ敹鍒伴€€鍑轰簨浠跺悗閫€鍑虹▼搴?
exit
()
if
event
.
type
==
locals
.
KEYDOWN
:
if
event
.
key
==
locals
.
K_SPACE
:
``
wukong
=
hero
[
index
]
index
+=
1
...
...
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