From e26b9da6eb050eda3943d8451a71c32ae6aad3d8 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 10 Sep 2016 20:07:13 +0200 Subject: [PATCH] Consume power at FPS rate --- tabakrolletjie/scenes/night.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tabakrolletjie/scenes/night.py b/tabakrolletjie/scenes/night.py index 115630a..8038276 100644 --- a/tabakrolletjie/scenes/night.py +++ b/tabakrolletjie/scenes/night.py @@ -17,7 +17,7 @@ from ..loader import loader from ..transforms import Overlay from ..turnip import Turnip from ..widgets import ImageButton -from ..constants import NIGHT_LENGTH, DEBUG, FONTS, SCREEN_SIZE +from ..constants import NIGHT_LENGTH, DEBUG, FONTS, SCREEN_SIZE, FPS class NightScene(BaseScene): @@ -158,7 +158,7 @@ class NightScene(BaseScene): if self._total_ticks < NIGHT_LENGTH: self._mould.tick(gamestate, self._space, self._lights) self._lights.tick() - if self._total_ticks % 60 == 0: + if self._total_ticks % FPS == 0: self._battery.current -= int( self._lights.total_power_usage()) self.check_battery() -- 2.34.1