/** * Turns the lights on/off (makes the walls invisible) * I never liked this "feature", because it only encouraged mapping the world by hand, * which is just a PITA. Not fun, and doesn't add any value (from my point of view). * Therefore, I only DIM the lights, the walls are still visible. Feel free to change the * code in your version if you like the original (change 0.1 to 0.0 below).z */ class XORSwitch : Collectable { static var on = true override fun collected( movement : Movement ) { actor.die() } override fun end() { super.end() on = !on for ( wall in PlayDirector.instance.mainStage.findRolesByClass( Wall ) ) { wall.actor.color.alpha = if ( on ) 1.0 else 0.1 } } }