当前位置: 首页>>代码示例>>Python>>正文


Python GameState.__init__方法代码示例

本文整理汇总了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))
开发者ID:elanas,项目名称:TheCrazySix,代码行数:17,代码来源:Title.py

示例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
开发者ID:elanas,项目名称:TheCrazySix,代码行数:18,代码来源:Title.py

示例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
开发者ID:elanas,项目名称:TheCrazySix,代码行数:19,代码来源:HowToPlay.py

示例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()
开发者ID:elanas,项目名称:TheCrazySix,代码行数:7,代码来源:Highscore.py

示例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")
开发者ID:elanas,项目名称:TheCrazySix,代码行数:5,代码来源:LoseGame.py

示例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()
开发者ID:elanas,项目名称:TheCrazySix,代码行数:8,代码来源:Menu.py

示例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())
开发者ID:TerranceN,项目名称:Pygame_Example_Tetris,代码行数:6,代码来源:GS_Game.py


注:本文中的GameState.GameState.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。