From ad08d93da75b41011d609a8ecd2a7748af6737f9 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 11 May 2014 17:23:27 +0200 Subject: [PATCH] Add rendering to scenes and fix handle_event. --- naja/engine.py | 4 ++-- naja/scenes/scene.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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 -- 2.34.1