Ensure that the flash starts ON after ever mode change
[naja.git] / naja / utils.py
index 7ad4f582c2188a9c6fdcc914fa535eddd70fdc3f..925442a7a12eef328f723b40f026070a37214f7d 100644 (file)
@@ -42,8 +42,7 @@ def warp_to_game_state(game_state):
 class Flashlight(object):
     def __init__(self, rate):
         self.rate = rate
-        self.ticks = 0
-        self.on = False
+        self.reset()
 
     def tick(self):
         self.ticks += 1
@@ -52,3 +51,7 @@ class Flashlight(object):
             self.ticks = 0
             return True
         return False
+
+    def reset(self):
+        self.ticks = 0
+        self.on = True