X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fscenes%2Fscene.py;h=4841ab5a628cb3a318ab0c947d1d537f9f0ee03b;hb=a351c6c8a07779878dc5dd598e28cd06f6622529;hp=d85dbab5db8937da03e7213a403ea73438cc9b91;hpb=c78d27a40453bd280d5e40919c11412559f3ff31;p=naja.git diff --git a/naja/scenes/scene.py b/naja/scenes/scene.py index d85dbab..4841ab5 100644 --- a/naja/scenes/scene.py +++ b/naja/scenes/scene.py @@ -2,6 +2,8 @@ Base Scene class. """ +from naja.widgets.base import Container + class Scene(object): """ @@ -9,8 +11,30 @@ class Scene(object): E.g. Splash screen, game board, credits, win, lose. """ - def __init__(self): + def __init__(self, state): + self.state = state + self.container = Container() + + def add(self, widget): + self.container.add(widget) + + def enter(self): + pass + + def exit(self): pass - def handle_event(self): + def render_scene(self, surface): + pass + + def render(self, surface): + self.render_scene(surface) + self.container.render(surface) + + def handle_event(self, ev): + if self.container.handle_event(ev): + return + self.handle_scene_event(ev) + + def handle_scene_event(ev): pass