Reference Source Test
public class | source

Info

Displays additional information on the screen as the game is running. For instance, missing hits on another player, regenerating health, and damage done with a Splat

Constructor Summary

Public Constructor
public

constructor(game: Game)

Default constructor

Member Summary

Public Members
public

A queue to destroy the entities over time

public

An instance of the game

public

A collection of all the info entities

Method Summary

Public Methods
public

addInfo(info: Object)

Add an info object to the destroyQueue

public

create(type: Modules, data: Object, x: Number, y: Number)

Create the informational entity

public

forEachInfo(callback: Function)

Loop through each info and pass them to a callback

public

Generate an ID for an info based on the game type, info Module.Hits and x,y coordinates

public

Returns the count of the number of info objects currently active

public

hit(type: Modules, data: Object, x: Number, y: Number)

The hit has made contact with another entity

public

levelup(type: Modules, x: Number, y: Number)

Level up

public

regenerate(type: Modules, data: Object, x: Number, y: Number)

Renerage health

public

update(time: Number)

Update each info object over time and destroy any in the destroyQueue

Public Constructors

public constructor(game: Game) source

Default constructor

Params:

NameTypeAttributeDescription
game Game

instance of the game

Public Members

public destroyQueue: Queue source

A queue to destroy the entities over time

public game: Game source

An instance of the game

public infos: Object source

A collection of all the info entities

Public Methods

public addInfo(info: Object) source

Add an info object to the destroyQueue

Params:

NameTypeAttributeDescription
info Object

An info object

public create(type: Modules, data: Object, x: Number, y: Number) source

Create the informational entity

Params:

NameTypeAttributeDescription
type Modules

Hits (damage, stun, critical, heal, mana, experience, levelup)

data Object

Data about the type of hit

x Number

X coordinate

y Number

Y coordinate

public forEachInfo(callback: Function) source

Loop through each info and pass them to a callback

Params:

NameTypeAttributeDescription
callback Function

Callback function

public generateId(info: Modules, x: Number, y: Number): Number source

Generate an ID for an info based on the game type, info Module.Hits and x,y coordinates

Params:

NameTypeAttributeDescription
info Modules

The Hits type for this info entity

x Number

X coordinate

y Number

Y coordinate

Return:

Number

A generated ID number

public getCount(): Number source

Returns the count of the number of info objects currently active

Return:

Number

number of active info objects

public hit(type: Modules, data: Object, x: Number, y: Number) source

The hit has made contact with another entity

Params:

NameTypeAttributeDescription
type Modules

The Hits type of Splat

data Object

Damage and whether or not this isTarget

x Number

X coordinate

y Number

Y coordinate

public levelup(type: Modules, x: Number, y: Number) source

Level up

Params:

NameTypeAttributeDescription
type Modules

The Hits type

x Number

X coordinate

y Number

Y coordinate

public regenerate(type: Modules, data: Object, x: Number, y: Number) source

Renerage health

Params:

NameTypeAttributeDescription
type Modules

The Hits type of Splat

data Object

Amount of health regeneration

x Number

X coordinate

y Number

Y coordinate

public update(time: Number) source

Update each info object over time and destroy any in the destroyQueue

Params:

NameTypeAttributeDescription
time Number

set the latest update time for each info