A_Lower

From ZDoom Wiki
Jump to: navigation, search

A_Lower [(int lowerspeed])


This function must be called in a weapon's Deselect state sequence. It should not be used anywhere else. It is responsible for lowering the weapon until it is off the screen and for selecting another weapon when it is done.

Each time A_Lower is called, the weapon moves further down the screen until it has reached the fully lowered position. You can therefore make a weapon lower faster than the default by calling A_Lower more than once within the same tic or by passing the desired speed directly, which is 6 by default.

Examples

Here is an example of a basic Deselect state that makes use of A_Lower to move the weapon down towards the lowered position and then select a new weapon.

Deselect:
   SHTG A 1 A_Lower
   loop

This will lower the shotgun down off the screen when a new weapon is selected. Once the shotgun has reached the fully lowered position, A_Lower will change to the new weapon that was selected.

This gun lowers from view twice as fast as normal:

Deselect:
   FAST A 0 A_Lower // The 0-tic delay means this will execute within the same tic as the next line
   FAST A 1 A_Lower
   loop

See Also