Commit ee24fc9b by BellCodeEditor

save project

parent e1de809d
Showing with 7 additions and 7 deletions
...@@ -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
imageget_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时钟,控制游戏速度(帧数)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment