Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson8_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
ee24fc9b
authored
Feb 25, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e1de809d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
my_game.py
my_game.py
View file @
ee24fc9b
...
@@ -12,13 +12,13 @@ class Block(pygame.sprite.Sprite):
...
@@ -12,13 +12,13 @@ class Block(pygame.sprite.Sprite):
pygame
.
init
()
# 初始化
pygame
.
init
()
# 初始化
# 创建一个窗口
# 创建一个窗口
class
Player
(
pygame
.
sprite
.
Sprite
):
class
Player
(
pygame
.
sprite
.
Sprite
):
def
_
int_
(
self
,
image
)
def
_
_init__
(
self
,
image
):
super
()
.
__init__
()
super
()
.
__init__
()
self
.
image
=
image
self
.
image
=
image
image
的
get_rect
方法,可以返回
pygame
.
Rect
(
0
,
0
,)
#
image的get_rect方法,可以返回pygame.Rect(0,0,)
self
.
rect
=
self
.
image
.
get_rect
()
self
.
rect
=
self
.
image
.
get_rect
()
self
.
rect
.
x
=
150
self
.
rect
.
x
=
150
self
.
rect
.
y
=
400
self
.
rect
.
y
=
400
screen
=
pygame
.
display
.
set_mode
((
1000
,
600
))
screen
=
pygame
.
display
.
set_mode
((
1000
,
600
))
FPS
=
pygame
.
time
.
Clock
()
# pygame时钟,控制游戏速度(帧数)
FPS
=
pygame
.
time
.
Clock
()
# pygame时钟,控制游戏速度(帧数)
...
...
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