ElixirDoom.Specials.Lights (elixir_doom v0.1.0)

Copy Markdown View Source

Sector lights that change by themselves — flickering, strobing, glowing — and lines that set a tagged sector's light.

step/3 is a Cauldron2D.Thinkers step for a light of kind :flash, :strobe or :glow.

Summary

Functions

Start a random flicker in sector index between its light and its dimmest neighbour's.

Start a glow in sector index, between its light and its dimmest neighbour's.

Set the light of every sector tagged tag: a level, or :max_neighbour or :min_neighbour.

One tic of light.

Start a strobe in sector index: bright for a moment, dark for dark tics.

Start a slow strobe in every sector tagged tag that no mover has taken.

Functions

flicker(world, index)

Start a random flicker in sector index between its light and its dimmest neighbour's.

glow(world, index)

Start a glow in sector index, between its light and its dimmest neighbour's.

set_tagged(world, tag, level)

@spec set_tagged(
  ElixirDoom.World.t(),
  integer(),
  integer() | :max_neighbour | :min_neighbour
) ::
  ElixirDoom.World.t()

Set the light of every sector tagged tag: a level, or :max_neighbour or :min_neighbour.

step(light, id, world)

@spec step(map(), pos_integer(), ElixirDoom.World.t()) ::
  {:keep, map(), ElixirDoom.World.t()}

One tic of light.

strobe(world, index, dark, synced?)

Start a strobe in sector index: bright for a moment, dark for dark tics.

strobe_tagged(world, tag)

@spec strobe_tagged(ElixirDoom.World.t(), integer()) :: ElixirDoom.World.t()

Start a slow strobe in every sector tagged tag that no mover has taken.