A_JumpIfCloser

From ZDoom Wiki

Jump to: navigation, search

A_JumpIfCloser (int distance, int offset)
A_JumpIfCloser (int distance, str state)


Warning: Using state labels as arguments without quotation marks has been deprecated and will no longer work. Make sure to enclose all your string arguments with quotation marks to ensure full compatibility with future ZDoom versions. Refer to the available example(s) for proper usage


Jumps the specified amount of states forward if the distance to the target is lower than the given value.

Example

actor sensitivebarrel : explosivebarrel
{
states
{
Spawn:
   BAR1 A 0 A_JumpIfCloser(40, 3)
   BAR1 AB 6
   loop
Death:
   BEXP A 5 bright
   BEXP B 5 bright A_Scream
   BEXP C 5 bright
   BEXP D 10 bright A_Explode
   BEXP E 10 bright
   stop
}
}

This actor is a barrel that jumps to it's exploding death state if you're too close to it using A_JumpIfCloser.

Personal tools