Exemplo n.º 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()
Exemplo n.º 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
Exemplo n.º 3
0
 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()
Exemplo n.º 4
0
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