Switches: the texture on a used line flips to its pair, and a switch that can be used again flips back a second later. A line that works once is marked used.
step/3 is a Cauldron2D.Thinkers step for a :button, the timer that flips a switch
back.
Summary
Functions
Flip the switch on line index, used by thing actor_id. repeat? starts the timer
that flips it back; otherwise the line is marked used. exit? makes the exit sound.
Mark line index used, so it does nothing again, when once?.
One tic of a switch's timer; when it runs out the switch flips back.
Functions
@spec flip(ElixirDoom.World.t(), non_neg_integer(), boolean(), boolean(), term()) :: ElixirDoom.World.t()
Flip the switch on line index, used by thing actor_id. repeat? starts the timer
that flips it back; otherwise the line is marked used. exit? makes the exit sound.
@spec mark_used(ElixirDoom.World.t(), non_neg_integer(), boolean()) :: ElixirDoom.World.t()
Mark line index used, so it does nothing again, when once?.
@spec step(map(), pos_integer(), ElixirDoom.World.t()) :: {:keep, map(), ElixirDoom.World.t()} | {:done, ElixirDoom.World.t()}
One tic of a switch's timer; when it runs out the switch flips back.