The weapon a player holds: the two pictures drawn over the view — the weapon and its muzzle flash — each running through its own states, raising, lowering, readying and firing, and what each weapon does when it fires.
tick/2 runs one tic of player id's weapon. The pictures' positions, sx and sy,
are in Doom's 320 by 200 screen: the weapon is up at 32 and down at 128.
Summary
Functions
Raise player id's pending weapon, or the one in hand.
Lower player id's weapon, as when they die.
Whether player has the ammunition to fire weapon.
Put player id's slot (:weapon or :flash) into state, running its actions.
One tic of player id's weapon and flash.
Functions
@spec bring_up(ElixirDoom.World.t(), term()) :: ElixirDoom.World.t()
Raise player id's pending weapon, or the one in hand.
@spec drop(ElixirDoom.World.t(), term()) :: ElixirDoom.World.t()
Lower player id's weapon, as when they die.
Whether player has the ammunition to fire weapon.
@spec set(ElixirDoom.World.t(), term(), :weapon | :flash, atom() | nil) :: ElixirDoom.World.t()
Put player id's slot (:weapon or :flash) into state, running its actions.
@spec tick(ElixirDoom.World.t(), term()) :: ElixirDoom.World.t()
One tic of player id's weapon and flash.