Physics module optimized for 2D fighting games.
These functions allow basic movement and positioning for entities.
Move | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Moves the entity this frame, depending on facing.
- Arg 1: Horizontal move
- Arg 2: (Optional) Vertical move
|
MoveAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Moves the entity this frame, independant of facing.
- Arg 1: Horizontal move
- Arg 2: (Optional) Vertical move
|
SetPositionRelativeToTarget | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the entity's position based on the target entity, dependant on its physics facing.
- Arg 1: Horizontal position
- Arg 2: Vertical position
|
SetPositionRelativeToTargetAbsolute | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the entity's position based on the target entity, independant of its physics facing.
- Arg 1: Horizontal position
- Arg 2: Vertical position
|
SetTargetPosition | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the target entity's position based on this entity, dependant of its physics facing.
- Arg 1: Horizontal position
- Arg 2: Vertical position
|
SetTargetPositionAbsolute | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the target entity's position based on this entity, independant of its physics facing.
- Arg 1: Horizontal position
- Arg 2: Vertical position
|
TargetGetRelativePosition | [2] | [Init, Action, Manual, Subentity] | |
---|
Gets the position of the target in this entity's referential.
- Arg 1: Variable name to store the X position
- Arg 2: Variable name to store the Y position
|
SetWorldPosition | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the position relative to the world origin, depending on facing.
- Arg 1: Horizontal position
- Arg 2: Vertical position
|
SetWorldPositionX | [1] | [Init, Action, Manual, Subentity] | |
---|
Sets the position relative to the world origin, depending on facing.
- Arg 1: Horizontal position
|
SetWorldPositionY | [1] | [Init, Action, Manual, Subentity] | |
---|
Sets the position relative to the world origin, depending on facing. |
SetWorldPositionAbsolute | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the position relative to the world origin, independant of facing.
- Arg 1: Horizontal position
- Arg 2: Vertical position
|
SetWorldPositionAbsoluteX | [1] | [Init, Action, Manual, Subentity] | |
---|
Sets the position relative to the world origin, independant of facing.
- Arg 1: Horizontal position
|
Helper functions related to momentum, applies movement from frame to frame.
AddMomentum | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Adds to the momentum, depending on facing. This will move the entity every frame.
- Arg 1: Horizontal momentum
- Arg 2: (Optional) Vertical momentum
|
AddMomentumAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Adds to the momentum, independant of facing. This will move the entity every frame.
- Arg 1: Horizontal momentum
- Arg 2: (Optional) Vertical momentum
|
SetMomentum | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the momentum, depending on facing. This will move the entity every frame.
- Arg 1: Horizontal momentum
- Arg 2: Vertical momentum
|
SetMomentumAbsolute | [2] | [Init, Action, Manual, Subentity] | |
---|
Sets the momentum, independant of facing. This will move the entity every frame.
- Arg 1: Horizontal momentum
- Arg 2: Vertical momentum
|
SetMomentumX | [1] | [Init, Action, Manual, Subentity] | |
---|
Sets the momentum, depending on facing. This will move the entity every frame.
- Arg 1: Horizontal momentum
|
SetMomentumXAbsolute | [1] | [Init, Action, Manual, Subentity] | |
---|
Sets the momentum, independant of facing. This will move the entity every frame.
- Arg 1: Horizontal momentum
|
SetMomentumY | [1] | [Init, Action, Manual, Subentity] | |
---|
Sets the momentum, independant of facing. This will move the entity every frame. |
BreakMomentum | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Reduces the momentum by the amount given.
- Arg 1: Horizontal momentum
- Arg 2: (Optional) Vertical momentum
|
BreakMomentumX | [1, 2, 3] | [Init, Action, Manual, Subentity] | |
---|
Reduces the horizontal momentum by the amount given.
- Arg 1: Horizontal momentum break
- Arg 2: (Optional) Horizontal momentum cap
- Arg 3: (Optional) Horizontal momentum cap max
|
BreakMomentumY | [1, 2, 3] | [Init, Action, Manual, Subentity] | |
---|
Reduces the vertical momentum by the amount given.
- Arg 1: Vertical momentum break
- Arg 2: (Optional) Vertical momentum cap
- Arg 3: (Optional) Vertical momentum cap max
|
BreakMomentumXAbsolute | [1, 2, 3] | [Init, Action, Manual, Subentity] | |
---|
Reduces the horizontal momentum by the amount given, independant of facing.
- Arg 1: Horizontal momentum break
- Arg 2: (Optional) Horizontal momentum cap
- Arg 3: (Optional) Horizontal momentum cap max
|
CapMomentum | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Limits the momentum to those values.
- Arg 1: Horizontal momentum
- Arg 2: (Optional) Horizontal Momentum Max
- Arg 3: Vertical momentum
- Arg 4: (Optional) Vertical Momentum Max
|
CapMomentumX | [2] | [Init, Action, Manual, Subentity] | |
---|
Limits the momentum to those values.
- Arg 1: Horizontal momentum
- Arg 2: Horizontal Momentum Max
|
CapMomentumY | [2] | [Init, Action, Manual, Subentity] | |
---|
Limits the momentum to those values.
- Arg 1: Vertical momentum
- Arg 2: Vertical Momentum Max
|
CapMomentumAbsolute | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Limits the momentum to those values, independant of facing.
- Arg 1: Horizontal momentum
- Arg 2: (Optional) Horizontal Momentum Max
- Arg 3: Vertical momentum
- Arg 4: (Optional) Vertical Momentum Max
|
CapMomentumXAbsolute | [2] | [Init, Action, Manual, Subentity] | |
---|
Limits the momentum to those values, independant of facing.
- Arg 1: Horizontal momentum
- Arg 2: Horizontal Momentum Max
|
AddMomentumTurn | [2] | [Init, Action, Manual, Subentity] | |
---|
Adds to the momentum, depending on facing. If momentum is going in the opposite direction, cancel it before applying.
- Arg 1: Horizontal momentum
- Arg 2: Vertical momentum
|
AddMomentumTurnAbsolute | [2] | [Init, Action, Manual, Subentity] | |
---|
Adds to the momentum, independant of facing. If momentum is going in the opposite direction, cancel it before applying.
- Arg 1: Horizontal momentum
- Arg 2: Vertical momentum
|
Functions relative to where the entity is facing, to handle forward / back / side directions.
Several types of facing are available for various purposes.
SetFacing | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Set an entity's physics facing directly.
- Arg 1: Horizontal Facing
- Arg 2: (Optional) Vertical Facing
|
SetFacingWithType | [2, 3] | [Init, Action, Manual, Subentity] | |
---|
Set an entity's facing directly, for any type.
- Arg 1: Type of facing to set
- Arg 2: Horizontal Facing
- Arg 3: (Optional) Vertical Facing
|
FlipFacing | [0, 1, 2] | [Init, Action, Manual, Subentity] | |
---|
Flips the horizontal facing of an entity to make it face backwards.
- Arg 1: (Optional) Facing type (default: physics)
- Arg 2: (Optional) Also adjust vertical facing (default: false)
|
FaceTowardsTarget | [0, 1, 2] | [Init, Action, Manual, Subentity] | |
---|
Faces the entity towards the target.
- Arg 1: (Optional) Facing type (default: physics)
- Arg 2: (Optional) Also adjust vertical facing (default: false)
|
TargetFaceTowardsSelf | [0, 1, 2] | [Init, Action, Manual, Subentity] | |
---|
Faces the target entity towards this entity.
- Arg 1: (Optional) Facing type (default: physics)
- Arg 2: (Optional) Also adjust vertical facing (default: false)
|
CopyTargetFacing | [0, 1, 2] | [Init, Action, Manual, Subentity] | |
---|
Copy the facing of the target entity to this entity.
- Arg 1: (Optional) Facing type (default: physics)
- Arg 2: (Optional) Also adjust vertical facing (default: true)
|
CopyFacingToTarget | [0, 1, 2] | [Init, Action, Manual, Subentity] | |
---|
Copy this entity's facing to the target entity.
- Arg 1: (Optional) Facing type (default: physics)
- Arg 2: (Optional) Also adjust vertical facing (default: true)
|
CopyFacingToOtherFacing | [1, 2, 3] | [Init, Action, Manual, Subentity] | |
---|
Copy one facing type to another facing type.
- Arg 1: Target facing type
- Arg 2: (Optional) Source facing type (default: physics)
- Arg 3: (Optional) Also adjust vertical facing (default: true)
|
TransformLocalXToWorld | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local X postion to a world position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformLocalYToWorld | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local Y postion to a world position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformLocalZToWorld | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local Z postion to a world position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformLocalXYToWorld | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local X and Y postion to a world position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: (Optional) X Destination variable
- Arg 4: (Optional) Y Destination variable
|
TransformLocalToWorld | [3, 6] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local XYZ postion to a world position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: Z Position
- Arg 4: (Optional) X Destination variable
- Arg 5: (Optional) Y Destination variable
- Arg 6: (Optional) Z Destination Variable
|
TransformWorldXToLocal | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world X postion to a local position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformWorldYToLocal | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world Y postion to a local position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformWorldYToLocal | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world Z postion to a local position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformWorldXYToLocal | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world X and Y postion to a local position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: (Optional) X Destination variable
- Arg 4: (Optional) Y Destination variable
|
TransformWorldToLocal | [3, 6] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world XYZ postion to a local position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: Z Position
- Arg 4: (Optional) X Destination variable
- Arg 5: (Optional) Y Destination variable
- Arg 6: (Optional) Z Destination Variable
|
TransformLocalXToAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local X postion to an absolute position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformLocalYToAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local Y postion to an absolute position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformLocalZToAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local Z postion to an absolute position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformLocalXYToAbsolute | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local X and Y postion to a absolute position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: (Optional) X Destination variable
- Arg 4: (Optional) Y Destination variable
|
TransformLocalToAbsolute | [3, 6] | [Init, Action, Manual, Subentity] | |
---|
Transforms a local XYZ postion to a absolute position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: Z Position
- Arg 4: (Optional) X Destination variable
- Arg 5: (Optional) Y Destination variable
- Arg 6: (Optional) Z Destination Variable
|
TransformAbsoluteXToLocal | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a absolute X postion to a local position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformAbsoluteYToLocal | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a absolute Y postion to a local position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformAbsoluteZToLocal | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a absolute Z postion to a local position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformAbsoluteXYToLocal | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Transforms a absolute X and Y postion to a local position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: (Optional) X Destination variable
- Arg 4: (Optional) Y Destination variable
|
TransformAbsoluteToLocal | [3, 6] | [Init, Action, Manual, Subentity] | |
---|
Transforms a absolute XYZ postion to a local position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: Z Position
- Arg 4: (Optional) X Destination variable
- Arg 5: (Optional) Y Destination variable
- Arg 6: (Optional) Z Destination Variable
|
TransformAbsoluteXToWorld | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms an absolute X postion to a world position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformAbsoluteYToWorld | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms an absolute Y postion to a world position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformAbsoluteZToWorld | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms an absolute Z postion to a world position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformAbsoluteXYToWorld | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Transforms a absolute X and Y postion to a world position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: (Optional) X Destination variable
- Arg 4: (Optional) Y Destination variable
|
TransformAbsoluteToWorld | [3, 6] | [Init, Action, Manual, Subentity] | |
---|
Transforms a absolute XYZ postion to a world position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: Z Position
- Arg 4: (Optional) X Destination variable
- Arg 5: (Optional) Y Destination variable
- Arg 6: (Optional) Z Destination Variable
|
TransformWorldXToAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world X postion to an absolute position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformWorldYToAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world Y postion to an absolute position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformWorldZToAbsolute | [1, 2] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world Z postion to an absolute position.
- Arg 1: Position to change
- Arg 2: (Optional) Destination variable if different
|
TransformWorldXYToAbsolute | [2, 4] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world X and Y postion to a absolute position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: (Optional) X Destination variable
- Arg 4: (Optional) Y Destination variable
|
TransformWorldToAbsolute | [3, 6] | [Init, Action, Manual, Subentity] | |
---|
Transforms a world XYZ postion to a absolute position.
- Arg 1: X position
- Arg 2: Y Position
- Arg 3: Z Position
- Arg 4: (Optional) X Destination variable
- Arg 5: (Optional) Y Destination variable
- Arg 6: (Optional) Z Destination Variable
|
Environment and Attack colliders setup.
Colbox | [2, 3, 4] | [Init, Action, Manual, Subentity] | |
---|
Sets the collision box, which will push other entities.
- Arg 1: Back bound (Optional)
- Arg 2: Front bound
- Arg 3: Down bound (Optional if only two parameters)
- Arg 4: Up bound
|
SetColboxMode | [0, 1] | [Init, Action, Manual, Subentity] | |
---|
Sets the mode of the Colbox for collisions using one of the COLBOXMODE_ constants.
- Arg 1: (Optional) Colbox mode (default: Default)
|
SetColboxPhantom | [0, 1] | [Init, Action, Manual, Subentity] | |
---|
Marks the Colbox as Phantom, meaning it will only collide with the environment.
- Arg 1: (Optional) If the colbox is phantom or not (default: true)
|
SetColboxLayer | [0, 1] | [Init, Action, Manual, Subentity] | |
---|
Sets the layer of this colbox. By default, the layer is equal to the PID+1.
- Arg 1: (Optional) Layer to set (Default: PID+1)
|
Hurtbox | [2, 3, 4] | [Init, Action, Manual, Subentity] | |
---|
Adds a hurtbox, that can be hit by hitboxes.
- Arg 1: Back bound (Optional)
- Arg 2: Front bound
- Arg 3: Down bound (Optional if only two parameters)
- Arg 4: Up bound
|
Hitbox | [2, 3, 4] | [Init, Action, Manual, Subentity] | |
---|
Adds a hitbox, that can hit hurtboxes. You need to set attack data beforehand, though the Attack function. This function does not reset the attack data, so you can add several hitboxes for the same attack data by calling Hitbox several times.
- Arg 1: Back bound (Optional)
- Arg 2: Front bound
- Arg 3: Down bound (Optional if only two parameters)
- Arg 4: Up bound
|
HurtboxRequires | [0, 1] | [Init, Action, Manual, Subentity] | |
---|
The next hurtboxes can't be hit unless the opposing attack has a specific flag. Call with no arguments to reset. |
HurtboxAvoids | [0, 1] | [Init, Action, Manual, Subentity] | |
---|
The next hurtboxes can't be hit if the opposing attack has a specific flag. Call with no arguments to reset. |
HitboxRequires | [0, 1] | [Init, Action, Manual, Subentity] | |
---|
The next hitboxes can't hit unless the opponent has a specific flag. Call with no arguments to reset. |
HitboxAvoids | [0, 1] | [Init, Action, Manual, Subentity] | |
---|
The next hitboxes can't hit if the opponent has a specific flag. Call with no arguments to reset. |
ResetColbox | [0] | [Init, Action, Manual, Subentity] | |
---|
Deletes the current colbox. |
ResetHurtboxes | [0] | [Init, Action, Manual, Subentity] | |
---|
Deletes the current hurtboxes. |
ResetHitboxes | [0] | [Init, Action, Manual, Subentity] | |
---|
Deletes the current hitboxes. |
InflictAttack | [0] | [Init, Action, Manual, Subentity] | |
---|
Bypasses collisions and the like to register the hit directly on the target. If redoing one for the same target, replaces it. |
Arena setup for fighting games.