Raspberry class.

Hierarchy

Constructors

Properties

_image: Image

Image for the raspberry.

_velocity: number = 0

Current speed.

gravity: number = 1.314159265358979323846264338

Gravity applied.

lift: number = -20

Amount of lift applied when boosting.

FILL: number = 0

Color.

HEIGHT: number = 70

Height.

WIDTH: number = 180

Width.

maxVelocity: number = 100

Maximum velocity, so the raspberry doesn't get to infinite speed when boosting.

position: Position

Position.

Accessors

  • get height(): number
  • Get height.

    Returns number

  • set height(value: number): void
  • Set height.

    Parameters

    • value: number

    Returns void

  • get image(): Image
  • Gets the image.

    Returns Image

  • set image(path: any): void
  • Sets the image by path.

    Parameters

    • path: any

    Returns void

  • get showHitbox(): boolean
  • Get the hitbox's visibility.

    Returns boolean

  • set showHitbox(value: boolean): void
  • Set the hitbox's visibility.

    Parameters

    • value: boolean

    Returns void

  • get velocity(): number
  • Gets the velocity.

    Returns number

  • set velocity(value: number): void
  • Sets the velocity.

    Parameters

    • value: number

    Returns void

  • get width(): number
  • Get width.

    Returns number

  • set width(value: number): void
  • Set width.

    Parameters

    • value: number

    Returns void

Methods

  • Lets the Raspberry fall to the ground

    Returns void

  • Lets the raspberry jump.

    Returns void

  • Private

    Forces the boundaries at the canvas' bottom.

    Returns void

  • Private

    Forces the boundaries at the canvas' top.

    Returns void

  • If enabled, draws the hitbox.

    Returns void

  • Private

    Draws the rocket.

    Returns void

  • Handles the drawing of the object.

    Returns void

  • Private

    Limits the raspberry's movement to the shown canvas.

    Returns void

  • Private

    Rotation and position of the rocket.

    Returns void

Generated using TypeDoc