Add rendering to scenes and fix handle_event.
authorSimon Cross <hodgestar@gmail.com>
Sun, 11 May 2014 15:23:27 +0000 (17:23 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sun, 11 May 2014 15:23:27 +0000 (17:23 +0200)
naja/engine.py
naja/scenes/scene.py

index 2278fa0e234de3f34aa505f7c206c267eeccbb30..7529efd357b6c47d0ced7970d45b12476ce59bb8 100644 (file)
@@ -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):
index 13cafc302bbd8f09277c92e982e524e17ab2c559..c82427d565790299f5cab195958a84df635a46d3 100644 (file)
@@ -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