GetPositionAfterTime
Introduction
The GetPositionAfterTime function will return the position of an object given a set start position, an initial velocity value, and a constant acceleration value (constant during the movement time). Note that this function does not consider an object's Drag value, so if a PositionedObject has a non-zero Drag, the results of this function will not match actual behavior.
Code Example
The following code will calculate where an object will be given the set values:
Code Example - Determining Stopping Distance
Entities (including entities using the Top-Down plugin or the Platformer plugin) can slow down using acceleration. Your game may require calculating the distance that the entity will take to slow down. The following example shows how to calculate the distance it will take to slow down from full speed using the Top-Down plugin.
Last updated