Gameboard scene.
"""
- def __init__(self, state):
+ def __init__(self, state, play_sound=True):
super(GameScene, self).__init__(state)
self.add(PlayerBitsWidget((0, 0), state))
info = InfoAreaWidget((480, 0), state)
- self.add(BoardWidget((0, 60), state, info))
+ self.board_widget = BoardWidget((0, 60), state, info)
+ self.add(self.board_widget)
self.add(GameBitsWidget((0, 540), state))
self.add(info)
self.add(RobotWidget(state))
- sound.play_sound('startup.ogg')
- background_track = random.choice(TUNES)
- sound.play_music(background_track, 0.25)
+ if play_sound:
+ sound.play_sound('startup.ogg')
+ background_track = random.choice(TUNES)
+ sound.play_music(background_track, 0.25)
def handle_scene_event(self, ev):
from naja.scenes.menu import MenuScene
idx = 0
self.update_card_pos(moves[idx])
+ def force_skip_animation(self):
+ for tile in self._tiles:
+ tile.animation = 0
+
def handle_event(self, ev):
if self.state.gameboard.player_mode == ACT:
return super(BoardWidget, self).handle_event(ev)