A player: what they carry, how their keys move them, how high their eye sits and bobs, reaching for switches and doors, taking damage through armour, and dying.
A player's state lives in the world under their id and names the thing they move as
(mobj). think/2 runs one tic of it from the keys held: :forward, :back,
:turn_left, :turn_right, :strafe_left, :strafe_right, :run, :fire, :use,
:next_weapon, :prev_weapon and :weapon_1..:weapon_7. A movement or turn held
through a stick moves or turns as far as the stick is pushed (the strength the input
gives it).
Summary
Functions
How much of damage gets past player id's armour, and the world with the armour worn
down: {world, damage}.
Player id dies.
A player's starting state: a fist and a pistol with 50 bullets, 100 health.
The state of player id.
Player id was hurt down to health by source.
Show text to player id for a few seconds.
Whether the action was pressed this tic.
Whether player id is holding a movement key.
The player's state with everything that does not carry to a new life reset.
Whether thing source is a player holding a running chainsaw.
A player's death cry, worse for a death by a great deal of damage.
Whether player thing mobj_id sees target.
The eye dips as a player lands hard.
The eye drops as a player steps up onto rise, and comes back up over a few tics.
One tic of player id.
Replace player id's state with fun.(player).
Functions
@spec absorb(ElixirDoom.World.t(), term(), number(), map() | nil) :: {ElixirDoom.World.t(), number()}
How much of damage gets past player id's armour, and the world with the armour worn
down: {world, damage}.
@spec die(ElixirDoom.World.t(), term(), map() | nil) :: ElixirDoom.World.t()
Player id dies.
A player's starting state: a fist and a pistol with 50 bullets, 100 health.
@spec get(ElixirDoom.World.t(), term()) :: map() | nil
The state of player id.
@spec hurt(ElixirDoom.World.t(), term(), integer(), number(), map() | nil) :: ElixirDoom.World.t()
Player id was hurt down to health by source.
@spec message(ElixirDoom.World.t(), term(), String.t()) :: ElixirDoom.World.t()
Show text to player id for a few seconds.
Whether the action was pressed this tic.
@spec pushing?(ElixirDoom.World.t(), term()) :: boolean()
Whether player id is holding a movement key.
The player's state with everything that does not carry to a new life reset.
@spec sawing?(ElixirDoom.World.t(), map() | nil) :: boolean()
Whether thing source is a player holding a running chainsaw.
@spec scream(ElixirDoom.World.t(), term()) :: ElixirDoom.World.t()
A player's death cry, worse for a death by a great deal of damage.
@spec sees?(ElixirDoom.World.t(), term(), map()) :: boolean()
Whether player thing mobj_id sees target.
@spec squat(ElixirDoom.World.t(), term(), number()) :: ElixirDoom.World.t()
The eye dips as a player lands hard.
@spec step_up(ElixirDoom.World.t(), term(), number()) :: ElixirDoom.World.t()
The eye drops as a player steps up onto rise, and comes back up over a few tics.
@spec think(ElixirDoom.World.t(), term()) :: ElixirDoom.World.t()
One tic of player id.
@spec update(ElixirDoom.World.t(), term(), (map() -> map())) :: ElixirDoom.World.t()
Replace player id's state with fun.(player).