--- /dev/null
+"""
+Dummy scene that overlays a static rendering of a a game scene
+"""
+
+import pygame.locals as pgl
+import pygame
+
+from naja.constants import KEYS, PALETTE, SCREEN
+from naja.events import SceneChangeEvent, LoadGameEvent
+from naja.sound import sound
+from naja.scenes.scene import Scene
+from naja.scenes.game import GameScene
+from naja.gamestate import GameState
+from naja.widgets.image_box import PreRenderedImageBox
+from naja.widgets.text import TextWidget, TextBoxWidget
+
+
+class DummyGameScene(Scene):
+
+ def __init__(self, state=None):
+ super(DummyGameScene, self).__init__(state)
+ if not state:
+ game_state = GameState.new(max_health=4, wins_required=4)
+ else:
+ game_state = state
+ game = GameScene(game_state, play_sound=False)
+ game_surface = pygame.surface.Surface(SCREEN)
+ game.render(game_surface)
+ # Force tiles past the animation stage
+ game.board_widget.force_skip_animation()
+ game.render(game_surface)
+ self.add(PreRenderedImageBox((0, 0), game_surface))
+
+ def handle_scene_event(self, ev):
+ from naja.scenes.menu import MenuScene
+ if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
+ # drop current state
+ LoadGameEvent.post(None)
+ SceneChangeEvent.post(MenuScene)
+ return