Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

Index

Methods

  • abortJump(): void
  • activate(enable: boolean): void
  • activated(): boolean
  • canGrabPlatforms(): boolean
  • canJump(): boolean
  • enableSynchronization(enable: boolean): void
  • getAcceleration(): number
  • getCurrentFallSpeed(): number
  • getCurrentJumpSpeed(): number
  • getCurrentSpeed(): number
  • getDeceleration(): number
  • getGravity(): number
  • getJumpSpeed(): number
  • getJumpSustainTime(): number
  • getLadderClimbingSpeed(): number
  • getMaxFallingSpeed(): number
  • getMaxSpeed(): number
  • getName(): string
  • getNameId(): number
  • getSlopeMaxAngle(): number
  • ignoreDefaultControls(ignore: boolean): void
  • isFalling(): boolean
  • 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 boolean

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

  • isFallingWithoutJumping(): boolean
  • isGrabbingPlatform(): boolean
  • isJumping(): boolean
  • isMoving(): boolean
  • isMovingEvenALittle(): boolean
  • isOnFloor(): boolean
  • isOnLadder(): boolean
  • isSyncedOverNetwork(): boolean
  • isUsingControl(input: string): boolean
  • onActivate(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDestroy(): void
  • 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).

    Returns void

  • onObjectHotReloaded(): void
  • setAcceleration(acceleration: number): void
  • setCanGrabPlatforms(enable: boolean): void
  • setCanJump(): void
  • setCanNotAirJump(): void
  • setCurrentFallSpeed(currentFallSpeed: number): void
  • setCurrentSpeed(currentSpeed: number): void
  • setDeceleration(deceleration: number): void
  • setGravity(gravity: number): void
  • setJumpSpeed(jumpSpeed: number): void
  • setJumpSustainTime(jumpSustainTime: number): void
  • setLadderClimbingSpeed(ladderClimbingSpeed: number): void
  • setMaxFallingSpeed(maxFallingSpeed: number, tryToPreserveAirSpeed?: boolean): void
  • Set the maximum falling speed of the Platformer Object.

    Parameters

    • maxFallingSpeed: number

      The maximum falling speed.

    • tryToPreserveAirSpeed: boolean = false

      If true and if jumping, tune the current jump speed to preserve the overall speed in the air.

    Returns void

  • setMaxSpeed(maxSpeed: number): void
  • setSlopeMaxAngle(slopeMaxAngle: number): void
  • shouldIgnoreDefaultControls(): boolean
  • simulateControl(input: string): void
  • simulateDownKey(): void
  • simulateJumpKey(): void
  • simulateLadderKey(): void
  • simulateLeftKey(): void
  • simulateReleaseLadderKey(): void
  • simulateReleasePlatformKey(): void
  • simulateRightKey(): void
  • simulateUpKey(): void
  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • usesLifecycleFunction(): boolean
  • 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).

    Returns boolean

Constructors

Properties

name: string
type: string
epsilon: number = ...

A very small value compare to 1 pixel, yet very huge compare to rounding errors.

Generated using TypeDoc