PlatformerObjectRuntimeBehavior

PlatformerObjectRuntimeBehavior

PlatformerObjectRuntimeBehavior represents a behavior allowing objects to be considered as a platform by objects having PlatformerObject Behavior.

Constructor

new PlatformerObjectRuntimeBehavior()

Source:

Methods

canGrabPlatforms()

Check if the Platformer Object can grab the platforms.

Returns:
Type Description

Returns true if the object can grab the platforms.

Source:

canJump()

Check if the Platformer Object can jump.

Returns:
Type Description

Returns true if the object can jump.

Source:

getAcceleration()

Get the acceleration value of the Platformer Object.

Returns:
Type Description

The current acceleration.

Source:

getCurrentFallSpeed()

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.

Returns:
Type Description

The current fall speed.

Source:

getCurrentJumpSpeed()

Get the current jump speed of the Platformer Object.

Returns:
Type Description

The current jump speed.

Source:

getCurrentSpeed()

Get the current speed of the Platformer Object.

Returns:
Type Description

The current speed.

Source:

getDeceleration()

Get the deceleration of the Platformer Object.

Returns:
Type Description

The current deceleration.

Source:

getGravity()

Get the gravity of the Platformer Object.

Returns:
Type Description

The current gravity.

Source:

getJumpSpeed()

Get the jump speed of the Platformer Object.

Returns:
Type Description

The jump speed.

Source:

getJumpSustainTime()

Get the jump sustain time of the Platformer Object.

Returns:
Type Description

The jump sustain time.

Source:

getLadderClimbingSpeed()

Get the speed used to move on Y axis when climbing a ladder.

Returns:
Type Description

The speed of ladder climbing.

Source:

getMaxFallingSpeed()

Get the maximum falling speed of the Platformer Object.

Returns:
Type Description

The maximum falling speed.

Source:

getMaxSpeed()

Get the maximum speed of the Platformer Object.

Returns:
Type Description

The maximum speed.

Source:

ignoreDefaultControls(ignore)

Ignore the default controls of the Platformer Object.

Parameters:
Name Type Description
ignore

Enable / Disable default controls.

Source:

isFalling()

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:
Type Description

Returns true if it is "going down" and false if not.

Source:

isFallingWithoutJumping()

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:
Type Description

Returns true if it is falling and false if not.

Source:

isGrabbingPlatform()

Check if the Platformer Object is grabbing a platform.

Returns:
Type Description

Returns true if a platform is grabbed and false if not.

Source:

isJumping()

Check if the Platformer Object is jumping.

Returns:
Type Description

Returns true if jumping and false if not.

Source:

isMoving()

Check if the Platformer Object is moving.

Returns:
Type Description

Returns true if it is moving and false if not.

Source:

isOnFloor()

Check if the Platformer Object is on a floor.

Returns:
Type Description

Returns true if on a floor and false if not.

Source:

isOnFloorObject()

Check if the Platformer Object is on the given object.

Returns:
Type Description

Returns true if on the object and false if not.

Source:

isOnLadder()

Check if the Platformer Object is on a ladder.

Returns:
Type Description

Returns true if on a ladder and false if not.

Source:

setAcceleration(acceleration)

Set the acceleration of the Platformer Object.

Parameters:
Name Type Description
acceleration

The new acceleration.

Source:

setCanGrabPlatforms(enable)

Set if the Platformer Object can grab platforms.

Parameters:
Name Type Description
enable

Enable / Disable grabbing of platforms.

Source:

setCanJump()

Allow the Platformer Object to jump again.

Source:

setCanNotAirJump()

Forbid the Platformer Object to air jump.

Source:

setDeceleration(deceleration)

Set the deceleration of the Platformer Object.

Parameters:
Name Type Description
deceleration

The new deceleration.

Source:

setGravity(gravity)

Set the gravity of the Platformer Object.

Parameters:
Name Type Description
gravity

The new gravity.

Source:

setJumpSpeed(jumpSpeed)

Set the jump speed of the Platformer Object.

Parameters:
Name Type Description
jumpSpeed

The new jump speed.

Source:

setJumpSustainTime(jumpSpeed)

Set the jump sustain time of the Platformer Object.

Parameters:
Name Type Description
jumpSpeed

The new jump sustain time.

Source:

setLadderClimbingSpeed(ladderClimbingSpeed)

Set the speed used to move on Y axis when climbing a ladder.

Parameters:
Name Type Description
ladderClimbingSpeed

The speed of ladder climbing.

Source:

setMaxFallingSpeed(maxFallingSpeed)

Set the maximum falling speed of the Platformer Object.

Parameters:
Name Type Description
maxFallingSpeed

The maximum falling speed.

Source:

setMaxSpeed(maxSpeed)

Set the maximum speed of the Platformer Object.

Parameters:
Name Type Description
maxSpeed

The new maximum speed.

Source:

setSlopeMaxAngle(slopeMaxAngle)

Set the maximum slope angle of the Platformer Object.

Parameters:
Name Type Description
slopeMaxAngle

The new maximum slope angle.

Source:

simulateControl(input)

Simulate a control action in the Platformer Object by specifying an input.

Parameters:
Name Type Description
input

The string expression of the control action [Left,Right,Up,Down,Ladder,Jump,Release,Release Ladder].

Source:

simulateDownKey()

Simulate the "Down" control of the Platformer Object.

Source:

simulateJumpKey()

Simulate the "Jump" control of the Platformer Object.

Source:

simulateLadderKey()

Simulate the "Ladder" control of the Platformer Object.

Source:

simulateLeftKey()

Simulate the "Left" control of the Platformer Object.

Source:

simulateReleaseLadderKey()

Simulate the "Release Ladder" control of the Platformer Object.

Source:

simulateReleasePlatformKey()

Simulate the "Release" control of the Platformer Object.

Source:

simulateRightKey()

Simulate the "Right" control of the Platformer Object.

Source:

simulateUpKey()

Simulate the "Up" control of the Platformer Object.

Source: