Class: Game

Game

All the global informations of a particular game

new Game ()

Properties:
Name Type Description
currentSlot number The current slot
hero MapObject The game map hero
teamHeroes Array.<GamePlayer> List of all the heroes in the team
reserveHeroes Array.<GamePlayer> List of all the heroes in the reserve
hiddenHeroes Array.<GamePlayer> List of all the hidden heroes
items Array.<GameItem> List of all the items, weapons, and armors in the inventory
currencies Array.<number> List of all the currencies
charactersInstances number ID of the last instance character
variables Array.<any> List of variables by ID
currentMapID number The current map ID
heroStates Array.<number> The current hero states list
heroProperties Array.<number> The current hero properties list by ID
heroStatesOptions Array.<Object> The current states options list
startupStates Object The current map startup states
startupProperties Object The current map startup properties
mapsDatas Obejct All the informations for each maps
playTime Chrono The current time played since the beginning of the game in seconds

Methods

Game.getHeroInstanceInTab (tab, id)GamePlayer static

Get the hero in a tab with instance ID
Name Type Description
tab Array.<GamePlayer> The heroes tab
id number The instance ID
Returns:
Type Description
GamePlayer

Game.getPathSave (slot)string static

Get the path save according to slot
Name Type Description
slot number The slot
Returns:
Type Description
string

getHeroByInstanceID (id)GamePlayer

Get the hero with instance ID
Name Type Description
id number The instance ID
Returns:
Type Description
GamePlayer

initializeDefault ()

Initialize a default game

initializeVariables ()

Initialize the default variables

useItem (gameItem)

Use an item and remove it from inventory
Name Type Description
gameItem GameItem The item

getTeam (kind)Array.<GamePlayer>

Get the team according to group kind
Name Type Description
kind GroupKind The group kind
Returns:
Type Description
Array.<GamePlayer>

getPotionsDatas (id, i, j, k)Object

Get the portions datas according to id and position
Name Type Description
id number The map id
i number The portion x
j number The portion y
k number The portion z
Returns:
Type Description
Object

read (slot, json)

Read a game file
Name Type Description
slot number The number of the slot to load
json Object Json object describing the game

readMapsDatas (json)

Read all the maps datas
Name Type Description
json Object Json object describing the maps datas

write (slot) async

Save a game file
Name Type Description
slot number The number of the slot to save

getCompressedMapsDatas ()Object

Get a compressed version of mapsDatas (don't retain meshs)
Returns:
Type Description
Object