Drain power at night.
authorSimon Cross <hodgestar@gmail.com>
Sat, 10 Sep 2016 16:54:11 +0000 (18:54 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 10 Sep 2016 16:54:11 +0000 (18:54 +0200)
tabakrolletjie/scenes/night.py

index 99b903b84300d2e205e82f8568829e07b4e4a177..692ecf1924b828ebcc094b1ba5afb289a992bdb5 100644 (file)
@@ -106,7 +106,6 @@ class NightScene(BaseScene):
                 self._to_day()
             if ev.button == 1:
                 self._lights.toggle_nearest(ev.pos, surfpos=True)
-                print self._lights.lit_by(ev.pos, surfpos=True)
 
                 # Check tools
                 for tool in self._tools:
@@ -154,7 +153,9 @@ class NightScene(BaseScene):
             if self._total_ticks < NIGHT_LENGTH:
                 self._mould.tick(gamestate, self._space, self._lights)
                 self._lights.tick()
-                print "Power usage: ", self._lights.total_power_usage()
+                if self._total_ticks % 60 == 0:
+                    self._battery.current -= int(
+                        self._lights.total_power_usage())
                 self._total_ticks += 1
             else:
                 self._end_night()