Options
All
  • Public
  • Public/Protected
  • All
Menu

Superclass for entities (Objects/Players in the game) like Sprites and Enemies.

Hierarchy

Index

Constructors

constructor

Properties

Protected angle

angle: number

Direction the sprite is facing in radiants.

Private entityType

entityType: ENEMY

What type this entity is.

lastPlayerViewingAngle

lastPlayerViewingAngle: number

Last angle this sprite was viewed from the perspective of the player.

Protected position

position: Vec2D

Position on the map.

Accessors

getAngle

  • get getAngle(): number

getPosition

  • get getPosition(): Vec2D

setAngle

  • set setAngle(angle: number): void
  • Setter for the looking angle

    Parameters

    • angle: number

      angle the entity's looking at

    Returns void

setPosition

  • set setPosition(position: Vec2D): void

Methods

Abstract getSprite

  • Since each entity has a unique appearance (or should have for aesthetics), this method should be customized! Reason being that an entity can have custom animations and/or behavior.

    Returns Image2D

    The current sprite this entity shall appear as.

Generated using TypeDoc