Options
All
  • Public
  • Public/Protected
  • All
Menu

A vector used to move objects.

Hierarchy

  • Force

Index

Constructors

  • new Force(x: number, y: number, multiplier: number): Force
  • Parameters

    • x: number

      The initial x component

    • y: number

      The initial y component

    • multiplier: number

      The multiplier (0 for a force that disappear on next frame, 1 for a permanent force)

    Returns Force

Methods

  • getAngle(): number
  • Get the angle of the force

    Returns number

  • getLength(): number
  • Get the length of the force

    Returns number

  • getMultiplier(): number
  • Return 1 (true) if the force is permanent, 0 (false) if it is instant.

    Returns number

  • getX(): number
  • Returns the X component of the force.

    Returns number

  • getY(): number
  • Returns the Y component of the force.

    Returns number

  • setAngle(angle: number): void
  • Set the angle of the force.

    Parameters

    • angle: number

      The new angle

    Returns void

  • setLength(len: number): void
  • Set the length of the force.

    Parameters

    • len: number

      The length

    Returns void

  • setMultiplier(multiplier: number): void
  • Set if the force multiplier.

    Parameters

    • multiplier: number

      The new value

    Returns void

  • setX(x: number): void
  • Set the x component of the force.

    Parameters

    • x: number

      The new X component

    Returns void

  • setY(y: number): void
  • Set the y component of the force.

    Parameters

    • y: number

      The new Y component

    Returns void

Generated using TypeDoc