Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

Properties

_acceleration: Vector2 = ...
_animatedSpriteName: string
_attackSpriteName: string
_bounceFactor: number = 0.8
_deathCollisionComponent: string = ""
_dieSpriteName: string
_enemyCollisionComponent: string
_groundCollisionComponent: string
_hitSpriteName: string
_idleSpriteName: string
_invulnerable: boolean = false
_isAlive: boolean = true
_isAttacking: boolean = false
_isBouncingLeft: boolean = false
_isBouncingRight: boolean = false
_isBouncingUp: boolean = false
_isJumping: boolean = false
_jumpSpriteName: string
_maxVelocityX: number
_maxVelocityY: number
_owner: undefined | Entity
_playerCollisionComponent: string
_sprite: undefined | AnimatedSpriteComponent
_startingHitPoints: number = 2
_velocity: Vector2 = ...
_walkSpriteName: string
_zoneLoading: boolean = false
name: string
hitPoints: number = 2
lives: number = 3

Accessors

  • get isAttacking(): boolean

Methods

  • apply(userData: any): void
  • changeSprite(materialName: string, frameSequence: number[]): void
  • Changes the sprite of the owner. NOTE: This can only be done for animated sprite materials.

    Parameters

    • materialName: string
    • frameSequence: number[]

    Returns void

    void

  • destroy(): void
  • die(): void
  • getOwner(): undefined | Entity
  • onAttack(): void
  • onJump(): void
  • onTakeDamage(): void
  • Called when the owner takes damage. Usually collided with an enemy. If not dead (hp < 0), will turn the player static for 1 second (invulnerable from attacts)

    Returns void

    void

  • setFromJson(json: any): void
  • update(delta: number): void
  • updateReady(): void

Generated using TypeDoc