From 99a9620eac621fe519c30d1212c4b0b705ebb1f4 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 6 Sep 2016 17:44:05 +0200 Subject: [PATCH] Advance time --- tabakrolletjie/engine.py | 3 +++ tabakrolletjie/scenes/base.py | 3 +++ 2 files changed, 6 insertions(+) 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 """ -- 2.34.1