From: Simon Cross Date: Sun, 11 May 2014 15:23:27 +0000 (+0200) Subject: Add rendering to scenes and fix handle_event. X-Git-Tag: 0.1~425 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=ad08d93da75b41011d609a8ecd2a7748af6737f9;p=naja.git Add rendering to scenes and fix handle_event. --- diff --git a/naja/engine.py b/naja/engine.py index 2278fa0..7529efd 100644 --- a/naja/engine.py +++ b/naja/engine.py @@ -17,8 +17,8 @@ class Engine(object): elif SceneChangeEvent.matches(ev): self.change_scene(ev.scene) else: - self._scene.handle_event() - # TODO: work + self._scene.handle_event(ev) + self._scene.render(self._surface) pygame.display.flip() def change_scene(self, scene): diff --git a/naja/scenes/scene.py b/naja/scenes/scene.py index 13cafc3..c82427d 100644 --- a/naja/scenes/scene.py +++ b/naja/scenes/scene.py @@ -18,5 +18,8 @@ class Scene(object): def exit(self): pass - def handle_event(self): + def render(self, surface): + pass + + def handle_event(self, ev): pass