Lights can now be turned on and off at night.
[tabakrolletjie.git] / tabakrolletjie / scenes / night.py
index c558fc0fcb429091cf2e3d7c11004230905cad56..6c30603b713303ebf3635228426cd461e3d7b2bb 100644 (file)
@@ -32,9 +32,9 @@ class NightScene(BaseScene):
             if ev.key in (pgl.K_q, pgl.K_ESCAPE):
                 from .menu import MenuScene
                 SceneChangeEvent.post(scene=MenuScene())
-            elif ev.key == pgl.K_t:
-                for light in self._lights:
-                    light.toggle()
+        elif ev.type == pgl.MOUSEBUTTONDOWN:
+            if ev.button == 1:
+                self._lights.toggle_nearest(ev.pos)
 
     @debug_timer("night.tick")
     def tick(self, gamestate):