Consume power at FPS rate
authorNeil <neil@dip.sun.ac.za>
Sat, 10 Sep 2016 18:07:13 +0000 (20:07 +0200)
committerNeil <neil@dip.sun.ac.za>
Sat, 10 Sep 2016 18:07:13 +0000 (20:07 +0200)
tabakrolletjie/scenes/night.py

index 115630ab65ef5e143e0266665b12d7e0af8570b9..803827665d534eb2627aef88dc47bb4d42a6d1a6 100644 (file)
@@ -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()