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()
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
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()
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