From: Neil Date: Tue, 6 Sep 2016 15:44:05 +0000 (+0200) Subject: Advance time X-Git-Tag: tabakrolletjie-v1.0.0~237 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=99a9620eac621fe519c30d1212c4b0b705ebb1f4;p=tabakrolletjie.git Advance time --- diff --git a/tabakrolletjie/engine.py b/tabakrolletjie/engine.py index 4aac2e8..4dac1dd 100644 --- a/tabakrolletjie/engine.py +++ b/tabakrolletjie/engine.py @@ -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) diff --git a/tabakrolletjie/scenes/base.py b/tabakrolletjie/scenes/base.py index 118d6e2..71f7d6c 100644 --- a/tabakrolletjie/scenes/base.py +++ b/tabakrolletjie/scenes/base.py @@ -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 """