コード例 #1
0
 def ready(self, *args, **kwargs):
     self.num_players = kwargs.get('players', 4)
     self.timer = GameTimer()
     self.sequence_manager = SceneManager()
     self.sequence_manager.set_scenes({'ready':ReadySequence(self),
                                       'game':GameSequence(self),
                                       'result':ResultSequence(self),
                                       'pause':PauseSequence(self),
                                       })
     self.bgm = BGM(u"../resources/music/main_intro.wav", -1, u"../resources/music/main_loop.wav")
     self.sequence_manager.change_scene('ready')
     self.timer.play()
コード例 #2
0
class GameScene(Scene):
    BACKGROUND = (153,255,255)
    def ready(self, *args, **kwargs):
        self.num_players = kwargs.get('players', 4)
        self.timer = GameTimer()
        self.sequence_manager = SceneManager()
        self.sequence_manager.set_scenes({'ready':ReadySequence(self),
                                          'game':GameSequence(self),
                                          'result':ResultSequence(self),
                                          'pause':PauseSequence(self),
                                          })
        self.bgm = BGM(u"../resources/music/main_intro.wav", -1, u"../resources/music/main_loop.wav")
        self.sequence_manager.change_scene('ready')
        self.timer.play()
    def update(self):
        self.bgm.play()
        self.sequence_manager.current_scene.update()
        super(GameScene, self).update()
    def draw(self):
        super(GameScene, self).draw()
        rect = self.sequence_manager.current_scene.draw()
        return rect
コード例 #3
0
ファイル: game.py プロジェクト: maraigue/MachiMatch
 def ready(self, *args, **kwargs):
     self.world = World()
     self.navigations = []
     self.timer = GameTimer()
     self.sequence_manager = SceneManager()
     self.sequence_manager.set_scenes({'ready':ReadySequence(self),
                                       'game':GameSequence(self),
                                       'result':ResultSequence(self),
                                       'pause':PauseSequence(self),
                                       })
     self.sequence_manager.change_scene('ready')
     for player in self.world.players:
         self.navigations.append(Navigation(player))
     self.timer.play()
コード例 #4
0
ファイル: game.py プロジェクト: maraigue/MachiMatch
class GameScene(Scene):
    BACKGROUND = (153,255,255)
    def ready(self, *args, **kwargs):
        self.world = World()
        self.navigations = []
        self.timer = GameTimer()
        self.sequence_manager = SceneManager()
        self.sequence_manager.set_scenes({'ready':ReadySequence(self),
                                          'game':GameSequence(self),
                                          'result':ResultSequence(self),
                                          'pause':PauseSequence(self),
                                          })
        self.sequence_manager.change_scene('ready')
        for player in self.world.players:
            self.navigations.append(Navigation(player))
        self.timer.play()
    def update(self):
        self.sequence_manager.current_scene.update()
        super(GameScene, self).update()
    def draw(self):
        super(GameScene, self).draw()
        rect = self.sequence_manager.current_scene.draw()
        return rect