Make scenes take the game state.
[naja.git] / naja / scenes / scene.py
1 """
2 Base Scene class.
3 """
4
5
6 class Scene(object):
7     """
8     A scene within the game.
9
10     E.g. Splash screen, game board, credits, win, lose.
11     """
12     def __init__(self, state):
13         self.state = state
14         self.widgets = []
15
16     def enter(self):
17         pass
18
19     def exit(self):
20         pass
21
22     def render(self, surface):
23         self.render_widgets(surface)
24
25     def render_widgets(self, surface):
26         for widget in self.widgets:
27             widget.render(surface)
28
29     def handle_event(self, ev):
30         pass