ParentDist

From M.U.G.E.N Wiki

Jump to: navigation, search



Trigger: ParentDist

This trigger is only valid for helper-type characters. ParentDist returns the distance from the helper to its parent. It works similarly to P2Dist.

Format:
ParentDist [component]
Arguments:
[component]
X, Y
Return type:
float
Error conditions:
Returns SFalse if the player does not have a parent (e.g., if the parent was destroyed or KO'd).
Details:
For comparing the Y-distance, ParentDist gives the difference in the heights of the players' Y-axes. A negative value means that the parent is above its child. For comparing the X-distance, ParentDist gives the X-distance of the parent's axis from the child's axis. A positive value indicates the parent is in front of the child.

Example:

trigger1 = ParentDist X != 0
  Triggers if the parent is not at the exact same x-position as the
  helper character.


Personal tools