A_PushAway

From SRB2 Wiki
Jump to navigation Jump to search

A_PushAway is an action that pushes the actor's target or tracer away from the actor itself. In contrast to A_KnockBack, the direction of the horizontal thrust depends on the position of actor and target compared to each other. Var1 specifies the magnitude of the horizontal thrusting force to push away the actor's target or tracer with – if Var1 is negative, the Object will instead be pulled towards the actor.

The upper 16 bits of Var2 determines whether the actor's target (0) or the actor's tracer (1) will be pushed away by this action. If the chosen Object does not exist, this action will do nothing. The lower 16 bits of Var2 determine the method of pushing away the chosen Object this action uses:

Var2, lower 16 bits Function Description
0 P_Thrust The pushed Object's old momentum is retained, and the new pushing thrust force is added on in the new direction; i.e. Pushing thrust = Old momentum + Var1

Note: If A_PushAway is used repeatedly using this option, the pushed Object will accelerate at a rate of Var1 fracunits/tic for each use of the action.

1 P_InstaThrust The pushed Object's old momentum is lost in favor of the new pushing thrust force; i.e. Pushing thrust = Var1

This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.

  Actions – Movement [view]
A_BubbleRiseA_BunnyHopA_CapeChaseA_ChaseA_FishJumpA_ForceStopA_HomingChaseA_InstaLoopA_KnockBackA_MouseThinkA_MoveAbsoluteA_MoveRelativeA_PushAwayA_ScoreRiseA_SkullAttackA_ThrustA_ZThrust