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
  • 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
  • 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
  • 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
  • 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

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