本文整理汇总了Python中GameState.GameState.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python GameState.__init__方法的具体用法?Python GameState.__init__怎么用?Python GameState.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameState.GameState
的用法示例。
在下文中一共展示了GameState.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from GameState import GameState [as 别名]
# 或者: from GameState.GameState import __init__ [as 别名]
def __init__(self):
GameState.__init__(self)
self.time = 0.0
self.playerSprites = pygame.sprite.Group()
self.playerSprites.add(BorderPlayer(
Globals.WIDTH, Globals.HEIGHT, 0, 0, Player.INDEX_DOWN))
self.playerSprites.add(BorderPlayer(
Globals.WIDTH, Globals.HEIGHT,
Globals.WIDTH, 0, Player.INDEX_LEFT))
self.playerSprites.add(
BorderPlayer(Globals.WIDTH, Globals.HEIGHT,
0, Globals.HEIGHT, Player.INDEX_RIGHT))
self.playerSprites.add(
BorderPlayer(Globals.WIDTH, Globals.HEIGHT,
Globals.WIDTH, Globals.HEIGHT, Player.INDEX_UP))
示例2: __init__
# 需要导入模块: from GameState import GameState [as 别名]
# 或者: from GameState.GameState import __init__ [as 别名]
def __init__(self):
GameState.__init__(self)
self.size = Title.INIT_SIZE
self.delta = 1
self.time_delta = 0
self.font = pygame.font.Font(None, self.size)
self.title_surf = self.font.render(GAME_TITLE, True, TITLE_COLOR)
self.title_rect = self.title_surf.get_rect()
self.title_rect.centerx = Globals.SCREEN.get_rect().centerx
self.title_rect.centery = Globals.SCREEN.get_rect().centery
self.alt_surf = Title.ALT_FONT.render(Title.ALT_TITLE, True,
Title.ALT_COLOR)
self.alt_rect = self.alt_surf.get_rect()
self.alt_rect.centerx = Globals.SCREEN.get_rect().centerx
self.alt_rect.centery = self.title_rect.bottom + Title.MAX_DELTA + Title.ALT_PADDING
示例3: __init__
# 需要导入模块: from GameState import GameState [as 别名]
# 或者: from GameState.GameState import __init__ [as 别名]
def __init__(self):
GameState.__init__(self)
self.size = HowToPlay.INIT_SIZE
self.delta = 1
self.time_delta = 0
self.font = pygame.font.Font(None, self.size)
self.title_surf = self.font.render(TITLE, True, TITLE_COLOR)
self.title_rect = self.title_surf.get_rect()
self.title_rect.centerx = Globals.SCREEN.get_rect().centerx
self.title_rect.top = Globals.SCREEN.get_rect().top + TITLE_PADDING
self.alt_surf = HowToPlay.ALT_FONT.render(HowToPlay.ALT_TITLE, True,
HowToPlay.ALT_COLOR)
self.alt_rect = self.alt_surf.get_rect()
self.alt_rect.centerx = Globals.SCREEN.get_rect().centerx
self.alt_rect.centery = self.title_rect.bottom + HowToPlay.MAX_DELTA + \
HowToPlay.ALT_PADDING
示例4: __init__
# 需要导入模块: from GameState import GameState [as 别名]
# 或者: from GameState.GameState import __init__ [as 别名]
def __init__(self):
GameState.__init__(self)
self.color = pygame.color.Color("black")
self.time = 0.0
self.highscoreManager = HighscoreManager()
示例5: __init__
# 需要导入模块: from GameState import GameState [as 别名]
# 或者: from GameState.GameState import __init__ [as 别名]
def __init__(self):
GameState.__init__(self)
self.color = pygame.color.Color("black")
示例6: __init__
# 需要导入模块: from GameState import GameState [as 别名]
# 或者: from GameState.GameState import __init__ [as 别名]
def __init__(self):
GameState.__init__(self)
self.color = pygame.color.Color("black")
self.time = 0
self.selection = 0
Globals.play_menu_sound()
示例7: __init__
# 需要导入模块: from GameState import GameState [as 别名]
# 或者: from GameState.GameState import __init__ [as 别名]
def __init__(self, display):
GameState.__init__(self, display)
self.board = Board()
self.shape = Shape(self.board, self.randomShape())