Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows an object to move in 4 or 8 directions, with customizable speed, accelerations and rotation.

Hierarchy

Index

Methods

  • activate(enable: boolean): void
  • activated(): boolean
  • allowDiagonals(allow: boolean): void
  • diagonalsAllowed(): boolean
  • enableSynchronization(enable: boolean): void
  • getAcceleration(): number
  • getAngle(): number
  • getAngleOffset(): number
  • getAngularMaxSpeed(): number
  • getDeceleration(): number
  • getLastStickInputAngle(): number
  • getMaxSpeed(): number
  • getMovementAngleOffset(): number
  • getName(): string
  • getNameId(): number
  • getSpeed(): number
  • getXVelocity(): number
  • getYVelocity(): number
  • ignoreDefaultControls(ignore: boolean): void
  • isMovementAngleAround(degreeAngle: number, tolerance: number): boolean
  • isMoving(): boolean
  • isObjectRotated(): 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
  • setAngleOffset(angleOffset: number): void
  • setAngularMaxSpeed(angularMaxSpeed: number): void
  • setDeceleration(deceleration: number): void
  • setMaxSpeed(maxSpeed: number): void
  • setMovementAngleOffset(movementAngleOffset: number): void
  • setRotateObject(allow: boolean): void
  • setViewpoint(viewpoint: string, customIsometryAngle: number): void
  • setXVelocity(velocityX: number): void
  • setYVelocity(velocityY: number): void
  • shouldIgnoreDefaultControls(): boolean
  • simulateControl(input: string): void
  • simulateDownKey(): void
  • simulateLeftKey(): void
  • simulateRightKey(): void
  • simulateStick(stickAngle: number, stickForce: number): 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

Generated using TypeDoc