Player
Extends:
Constructor Summary
| Public Constructor | ||
| public |
constructor(texture: PIXI.Texture, id: string, name: string, room: string, team: string, health: number, x: number, y: number, vx: number, vy: number) Constructor for creating a new Player in the server side. |
|
Member Summary
| Public Members | ||
| public |
damagedBy: {} |
|
| public |
experience: * |
|
| public |
|
|
| public |
health: * |
|
| public |
height: * |
|
| public |
|
|
| public |
name: * |
|
| public |
playerSprite: * |
|
| public |
room: * |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
team: * |
|
| public |
textObjects: {} |
|
| public |
width: * |
|
| public |
x: * |
|
| public |
y: * |
|
Method Summary
| Public Methods | ||
| public |
|
|
| public |
changeSprite(shield: number, stronghold: string) Notifies the player to check for a sprite change (shield, etc). |
|
| public |
setup() First-time setup for this player. |
|
| public |
tick() Draws all components of a given player. |
|
Inherited Summary
| From class GameObject | ||
| public |
|
|
| public |
id: * |
|
| public |
posX: * |
|
| public |
posY: * |
|
| public |
texture: * |
|
| public |
vx: * |
|
| public |
vy: * |
|
| public |
x: * |
|
| public |
y: * |
|
| public |
destroy() Destroyes the Sprite |
|
| public |
draw() Call during tick() if necessary. |
|
| public |
TEMP Moves this object to (9999, 9999) on local screen space, effectively hiding it from view. |
|
| public |
setCoordinates(newX: number, newY: number) Sets global coordinates of this player |
|
| public |
Sets global coordinates and speeds of this player |
|
| public |
setup() Override optional. |
|
| public |
Override optional. |
|
Public Constructors
public constructor(texture: PIXI.Texture, id: string, name: string, room: string, team: string, health: number, x: number, y: number, vx: number, vy: number) source
Constructor for creating a new Player in the server side. Player is a Sprite instance that can be added to the stage. Each Player should only be created once, and updated subsequently with setData().
Override:
GameObject#constructorParams:
| Name | Type | Attribute | Description |
| texture | PIXI.Texture | The texture associated with this sprite |
|
| id | string | Socket ID of the player |
|
| name | string | Name of the player |
|
| room | string | Room that the player belongs to |
|
| team | string | Team that the player belongs to |
|
| health | number | Health of the player |
|
| x | number | Global x-coordinate |
|
| y | number | Global y-coordinate |
|
| vx | number | Horizontal velocity |
|
| vy | number | Vertical velocity |
Public Members
public damagedBy: {} source
public experience: * source
public health: * source
public height: * source
public name: * source
public playerSprite: * source
public room: * source
public team: * source
public textObjects: {} source
public width: * source
Public Methods
public beginSpectate() source
public changeSprite(shield: number, stronghold: string) source
Notifies the player to check for a sprite change (shield, etc).
public setup() source
First-time setup for this player. All of the functions in this method will only be called once.
Override:
GameObject#setuppublic tick() source
Draws all components of a given player. This method should be included in the ticker and called once a frame. Therefore, all setup tasks should be called in setup().
