Advance time
authorNeil <neil@dip.sun.ac.za>
Tue, 6 Sep 2016 15:44:05 +0000 (17:44 +0200)
committerNeil <neil@dip.sun.ac.za>
Tue, 6 Sep 2016 15:44:05 +0000 (17:44 +0200)
tabakrolletjie/engine.py
tabakrolletjie/scenes/base.py

index 4aac2e8e8bb7297ce86e317e4c8e68e5528f5212..4dac1ddb5273fa09c4208e6e1389d513a3dcabbd 100644 (file)
@@ -38,6 +38,9 @@ class Engine(object):
                 else:
                     self._scene.event(ev, self._gamestate)
 
+            # Advance time on the world
+            # Time is assumed to flow perfectly, so no dt parameter for now
+            self._scene.tick(self._gamestate)
             self._scene.render(self._screen, self._gamestate)
             pygame.display.flip()
             clock.tick(FPS)
index 118d6e29a33c5de3f7f2054de267d73489056d1f..71f7d6ccc3d2615700e4be37c1d4a4e008d6be76 100644 (file)
@@ -13,3 +13,6 @@ class BaseScene(object):
 
     def render(self, screen, gamestate):
         """ Render the scene. """
+
+    def tick(self, gamestate):
+        """ Update the world based on time """