ElixirDoom.Specials (elixir_doom v0.1.0)

Copy Markdown View Source

The level's machinery, as the rest of the game reaches it: lines that do something when used, walked over or shot; the sector specials a level starts with; floors that hurt; and running every machine once a tic.

What each numbered line special does is a table here; the machines themselves are in ElixirDoom.Specials.Doors, Floors, Plats, Ceilings, Lights, Switches and Teleport, run by ElixirDoom.Specials.Movers and kept by ElixirDoom.Specials.Machines.

Summary

Functions

Thing id crossed lines this move: walk-over triggers.

Start door type in every sector tagged tag.

Start floor movement type on every sector tagged tag.

The floor under player id hurts, or holds a secret, or ends the level.

A shot from thing id struck line index: gun-triggered lines.

The sky flat's picture id.

Start the machinery a level's sectors carry from the start: lights, timed doors, secrets.

Run every machine once.

Thing id uses line index from side: {:used, world} or {:unused, world}.

Functions

cross_lines(world, id, lines)

@spec cross_lines(ElixirDoom.World.t(), term(), [non_neg_integer()]) ::
  ElixirDoom.World.t()

Thing id crossed lines this move: walk-over triggers.

doors_by_tag(world, tag, type)

@spec doors_by_tag(ElixirDoom.World.t(), integer(), atom()) :: ElixirDoom.World.t()

Start door type in every sector tagged tag.

floor_by_tag(world, tag, type)

@spec floor_by_tag(ElixirDoom.World.t(), integer(), atom()) :: ElixirDoom.World.t()

Start floor movement type on every sector tagged tag.

player_in_sector(world, id)

@spec player_in_sector(ElixirDoom.World.t(), term()) :: ElixirDoom.World.t()

The floor under player id hurts, or holds a secret, or ends the level.

shoot_line(world, id, index)

A shot from thing id struck line index: gun-triggered lines.

sky_flat()

@spec sky_flat() :: non_neg_integer() | nil

The sky flat's picture id.

spawn_sector_specials(world)

@spec spawn_sector_specials(ElixirDoom.World.t()) :: ElixirDoom.World.t()

Start the machinery a level's sectors carry from the start: lights, timed doors, secrets.

think(world)

Run every machine once.

use_line(world, id, index, side)

@spec use_line(ElixirDoom.World.t(), term(), non_neg_integer(), 0 | 1) ::
  {:used | :unused, ElixirDoom.World.t()}

Thing id uses line index from side: {:used, world} or {:unused, world}.