From: Neil Date: Sat, 10 Sep 2016 18:07:13 +0000 (+0200) Subject: Consume power at FPS rate X-Git-Tag: tabakrolletjie-v1.0.0~58^2 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=e26b9da6eb050eda3943d8451a71c32ae6aad3d8;p=tabakrolletjie.git Consume power at FPS rate --- 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()