Parabolic Tween Behavior

Dream it, build it!

Parabolic Tween Behavior

Parabolic Tween

The parabolic tween behavior allows you to build parabolic trajectories easily. You can either set a parabola by a given point in space, or you can throw a projectile in a parabolic target by an angle and a force. This is useful in many use cases, for instance, in a 2D isometric game you can simulate jumps, or on a 2D american football game you can throw a ball to the runner.

Properties


Property Description
Enabled Enables/disables the behavior.

Actions


Set Enabled

Disable/Enable the Parabolic Tween behavior

Set Parabola from Velocity

Constructs a parabolic trajectory prediction based on the initial velocity of the object.

Parameter Description
Tag Tag to identify the parabola.
Velocity Initial velocity of the object in pixels per second.
Angle Angle
Gravity World gravity

Calculate by target

Calculates the initial velocity and angle of the parabola based on a given point in space that must be reached at a specific time.

Parameter Description
Tag Tag to identify the parabola.
X Target X coordinate
Y Target Y coordinate
Time Time in seconds to reach the destination
Gravity World gravity.

Tween Parabola

Tweens a pair of coordinates over parabola from the current object coordinates to a Specified target coordinate.

Parameter Description
Tag Tag to identify the parabola.
X Target X coordinate
Y Target Y coordinate
Time Time in seconds to reach the destination
Gravity World gravity.
Set Angle Sets the angle of the object to follow the parabolic path

Stop Tween

Stops the specified tweening parabola and Triggers the On Finished conditions.

Parameter Description
Tag Tag to identify the parabola.

Stop All

Stops all the running tweens and Triggers the On Finished conditions.

Resume Tween

Resumes the specified paused and uncompleted tween

Parameter Description
Tag Tag to identify the parabola.

Resume All

Resume all the paused and uncompleted tweens

Pause Tween

Pauses the specified tweening parabola

Parameter Description
Tag Tag to identify the parabola.

Pause All

Pause all the running tweens

Conditions


Is Enabled

Returns true if the Parabolic Tween behavior is enabled

On Finished

Triggered for the specified tweening Tag when tween is completed

Parameter Description
Tag Tag to identify the parabola.

On Any Finished

Triggered when any tween has finished

Parameter Description
Tag Tag to identify the parabola.

Is Playing

Returns true if the specified tag is tweening

Parameter Description
Tag Tag to identify the parabola.

Is Any Playing

Returns true if any tween is running

Expressions


GetTag

In 'On Any tween finished' event, returns the finished tag.

GetTweenMaxTime

Returns time set for the specified tweening parabola

Parameter Description
Tag Tag to identify the parabola.

GetProgress

Returns progress percentage from 0 to 1 of the tween with the specified Tag

Parameter Description
Tag Tag to identify the parabola.

GetXAt

Returns the X coordinate of the parabola at the given time in seconds. This expression is only valid after calling either actions 'Set Parabola from Velocity' or 'Calculate by target'.

Parameter Description
Tag Tag to identify the parabola.
Time Time in seconds to reach the destination

GetYAt

Returns the X coordinate of the parabola at the given time in seconds. This expression is only valid after calling either actions 'Set Parabola from Velocity' or 'Calculate by target'.

Parameter Description
Tag Tag to identify the parabola.
Time Time in seconds to reach the destination

GetVelocityX

Returns the initial Velocity-X vector after calling CalculateByTarget action

Parameter Description
Tag Tag to identify the parabola.

GetVelocityY

Returns the initial Velocity-Y vector after calling CalculateByTarget action

Parameter Description
Tag Tag to identify the parabola.

GetVelocity

Returns the initial velocity vector after calling CalculateByTarget action

Parameter Description
Tag Tag to identify the parabola.

GetAngle

Returns the initial angle after calling CalculateByTarget action

Parameter Description
Tag Tag to identify the parabola.

GetX

Returns the X Coordinate of a Tweening Parabola

Parameter Description
Tag Tag to identify the parabola.

GetY

Returns the Y Coordinate of a Tweening Parabola

Parameter Description
Tag Tag to identify the parabola.

GetProjectileAngle

Returns the heading angle of the projectile while tweening over a parabolict trajectory

Parameter Description
Tag Tag to identify the parabola.

GetProjectileAngleAt

Returns the heading angle of the projectile while for a specific point in time of a parabola after calling 'Set Parabola from Velocity' or 'Calculate by target'

Parameter Description
Tag Tag to identify the parabola.
Time Time in seconds

By Pixel Perfect Studio

https://www.imcsw.com