Home Reference Source
public class | source

MapTile

Extends:

pixi.js~PIXI.Sprite → MapTile

One Tile component of the map.

Constructor Summary

Public Constructor
public

constructor(name: string, gridX: number, gridY: number)

Constructs one Tile to add to the map.

Member Summary

Public Members
public
public

height: *

public

hpText: *

public

owner: *

public

posX: *

public

posY: *

public

tile: *

public

width: *

public

x: *

public

y: *

Method Summary

Public Methods
public

tick()

Draws object in the correct position on the player screen.

public

updateHealth(newHealth: *)

Public Constructors

public constructor(name: string, gridX: number, gridY: number) source

Constructs one Tile to add to the map.

Params:

NameTypeAttributeDescription
name string

Name of the tile to place. Takes this name from tiles.js and loads its resources

gridX number

X-coordinate on the grid. Every 1 gridX = 400 posX

gridY number

Y-coordinate on the grid.

Public Members

public captured: boolean source

public height: * source

public hpText: * source

public owner: * source

public posX: * source

public posY: * source

public tile: * source

public width: * source

public x: * source

public y: * source

Public Methods

public tick() source

Draws object in the correct position on the player screen.

public updateHealth(newHealth: *) source

Params:

NameTypeAttributeDescription
newHealth *