class MenuScene(Scene):
def __init__(self):
- self.tw = TextWidget((10, 10), 'Haai', colour=(255, 255, 255))
-
- def render(self, surface):
- self.tw.render(surface)
+ super(MenuScene, self).__init__()
+ self.widgets.append(TextWidget((10, 10), 'Haai',
+ colour=(255, 255, 255)))
def handle_event(self, ev):
pass
E.g. Splash screen, game board, credits, win, lose.
"""
def __init__(self):
- pass
+ self.widgets = []
def enter(self):
pass
pass
def render(self, surface):
- pass
+ self.render_widgets(surface)
+
+ def render_widgets(self, surface):
+ for widget in self.widgets:
+ widget.render(surface)
def handle_event(self, ev):
pass