Abort the current jump.
When the character is not in the jumping state this method has no effect.
De/Activate the behavior
true to enable the behavior, false to disable it
Return true if the behavior is activated
Check if the Platformer Object can grab the platforms.
Returns true if the object can grab the platforms.
Check if the Platformer Object can jump.
Returns true if the object can jump.
This method is called each tick after events are done.
This method is called each tick before events are done.
Get the acceleration value of the Platformer Object.
The current acceleration.
Get the speed at which the object is falling. It is 0 when the object is on a floor, and non 0 as soon as the object leaves the floor.
The current fall speed.
Get the current jump speed of the Platformer Object.
The current jump speed.
Get the current speed of the Platformer Object.
The current speed.
Get the deceleration of the Platformer Object.
The current deceleration.
Get the gravity of the Platformer Object.
The current gravity.
Get the jump speed of the Platformer Object.
The jump speed.
Get the jump sustain time of the Platformer Object.
The jump sustain time.
Get the speed used to move on Y axis when climbing a ladder.
The speed of ladder climbing.
Get the maximum falling speed of the Platformer Object.
The maximum falling speed.
Get the maximum speed of the Platformer Object.
The maximum speed.
Get the name of the behavior.
The behavior's name.
Get the name identifier of the behavior.
The behavior's name identifier.
Get maximum angle of a slope for the Platformer Object to run on it as a floor.
the slope maximum angle, in degrees.
Ignore the default controls of the Platformer Object.
Enable / Disable default controls.
Check if the Platformer Object is "going down", either because it's in the falling state or because it's jumping but reached the jump peak and is now going down (because the jump speed can't compensate anymore the falling speed).
If you want to check if the object is falling outside of a jump (or because
the jump is entirely finished and there is no jump speed applied to the object
anymore), consider using isFallingWithoutJumping
.
Returns true if it is "going down" and false if not.
Check if the Platformer Object is in the falling state. This is false if the object is jumping, even if the object is going down after reaching the jump peak.
Returns true if it is falling and false if not.
Check if the Platformer Object is grabbing a platform.
Returns true if a platform is grabbed and false if not.
Check if the Platformer Object is jumping.
Returns true if jumping and false if not.
Check if the Platformer Object is moving.
When walking or climbing on a ladder, a speed of less than one pixel per frame won't be detected.
Returns true if it is moving and false if not.
Check if the Platformer Object is moving.
Returns true if it is moving and false if not.
Check if the Platformer Object is on a floor.
Returns true if on a floor and false if not.
Check if the Platformer Object is on the given object.
Returns true if on the object and false if not.
Check if the Platformer Object is on a ladder.
Returns true if on a ladder and false if not.
.
The control to be tested [Left,Right,Up,Down,Ladder,Jump,Release,Release Ladder].
true if the key was used since the last doStepPreEvents
call.
Reimplement this method to do extra work when the behavior is activated (after
it has been deactivated, see onDeActivate
).
Reimplement this to do extra work when the behavior is created (i.e: an
object using it was created), after the object is fully initialized (so
you can use this.owner
without risk).
Reimplement this method to do extra work when the behavior is deactivated.
This method is called when the owner of the behavior
is being removed from the scene and is about to be destroyed/reused later
or when the behavior is removed from an object (can happen in case of
hot-reloading only. Otherwise, behaviors are just de-activated,
not removed. See onDeActivate
).
This method is called when the owner of the behavior was hot reloaded, so its position, angle, size can have been changed outside of events.
Set the acceleration of the Platformer Object.
The new acceleration.
Set if the Platformer Object can grab platforms.
Enable / Disable grabbing of platforms.
Allow the Platformer Object to jump again.
Forbid the Platformer Object to air jump.
Set the current fall speed.
When the character is not in the falling state this method has no effect.
Set the current speed of the Platformer Object.
The current speed.
Set the deceleration of the Platformer Object.
The new deceleration.
Set the gravity of the Platformer Object.
The new gravity.
Set the jump speed of the Platformer Object.
The new jump speed.
Set the jump sustain time of the Platformer Object.
Set the speed used to move on Y axis when climbing a ladder.
The speed of ladder climbing.
Set the maximum falling speed of the Platformer Object.
The maximum falling speed.
If true and if jumping, tune the current jump speed to preserve the overall speed in the air.
Set the maximum speed of the Platformer Object.
The new maximum speed.
Set the maximum slope angle of the Platformer Object.
The new maximum slope angle.
Check if the default controls of the Platformer Object are ignored.
true if the default controls are ignored.
Simulate a control action in the Platformer Object by specifying an input.
The string expression of the control action [Left,Right,Up,Down,Ladder,Jump,Release,Release Ladder].
Simulate the "Down" control of the Platformer Object.
Simulate the "Jump" control of the Platformer Object.
Simulate the "Ladder" control of the Platformer Object.
Simulate the "Left" control of the Platformer Object.
Simulate the "Release Ladder" control of the Platformer Object.
Simulate the "Release" control of the Platformer Object.
Simulate the "Right" control of the Platformer Object.
Simulate the "Up" control of the Platformer Object.
Called at each frame after events. Call doStepPostEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called at each frame before events. Call doStepPreEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.
true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).
Update the behavior properties using the provided data.
Should return false
if the behavior does not need any lifecycle function to
be called.
Default, hidden, "capability" behaviors set it to false
.
This avoids useless calls to empty lifecycle functions, which would waste CPU
time (and have a sizeable impact for example when lots of static instances
are living in the scene).
A very small value compare to 1 pixel, yet very huge compare to rounding errors.
Generated using TypeDoc
PlatformerObjectRuntimeBehavior represents a behavior allowing objects to be considered as a platform by objects having PlatformerObject Behavior.