Reference Source Test
public class | source

PlayerHandler

This is a player handler, responsible for all the Player callbacks without having to clutter up the entire file.

Constructor Summary

Public Constructor
public

constructor(game: Game, player: Player)

Default constructor

Member Summary

Public Members
public

Reference to the game Camera

public

Entities in the game

public

Instance of the game

public

Reference to input in the game

public

Reference to the player

public

Reference to the render layers

public

Reference to the server Socket

Method Summary

Public Methods
public

Check the bounds of the player when they're not centered

public

Whether or not this player can be attacked

public

Load the the callbacks for the player

Public Constructors

public constructor(game: Game, player: Player) source

Default constructor

Params:

NameTypeAttributeDescription
game Game

instance of the game

player Player

instance of the player

Public Members

public camera: Camera source

Reference to the game Camera

public entities: Entities source

Entities in the game

public game: Game source

Instance of the game

public input: Input source

Reference to input in the game

public player: Player source

Reference to the player

public renderer: Renderer source

Reference to the render layers

public socket: Socket source

Reference to the server Socket

Public Methods

public checkBounds() source

Check the bounds of the player when they're not centered

public isAttackable(): Boolean source

Whether or not this player can be attacked

Return:

Boolean

returns true if it can be attacked

public loadPlayerHandler() source

Load the the callbacks for the player