We set defaults in new_game() don't pass parameters that aren't needed
[naja.git] / naja / scenes / scene.py
1 """
2 Base Scene class.
3 """
4
5 from naja.widgets.base import Container
6
7
8 class Scene(object):
9     """
10     A scene within the game.
11
12     E.g. Splash screen, game board, credits, win, lose.
13     """
14     def __init__(self, state):
15         self.state = state
16         self.container = Container()
17
18     def add(self, widget):
19         self.container.add(widget)
20
21     def enter(self):
22         pass
23
24     def exit(self):
25         pass
26
27     def render_scene(self, surface):
28         pass
29
30     def render(self, surface):
31         self.render_scene(surface)
32         self.container.render(surface)
33
34     def handle_event(self, ev):
35         if self.container.handle_event(ev):
36             return
37         self.handle_scene_event(ev)
38
39     def handle_scene_event(ev):
40         pass