Class me.gamestat
Defined in: <build/melonJS-0.9.3.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
manage game statistics
me.gamestat can be used to store useful values during the game there is no constructor for me.gamestat |
| Method Attributes | Method Name and Description |
|---|---|
|
add(name, val)
add an item to the me.gamestat Object
|
|
|
getItemValue(name)
return an item value
|
|
|
reset(name)
reset the specified item to default value
|
|
|
setValue(name, val)
set value of an item
|
|
|
updateValue(name, val)
update an item
|
Class Detail
me.gamestat()
manage game statistics
me.gamestat can be used to store useful values during the game
there is no constructor for me.gamestat
Method Detail
add(name, val)
add an item to the me.gamestat Object
// add a "stars" item
me.gamestat.add("stars", 0);
- Parameters:
- {String} name
- name of the item
- {int} val Optional, Default: "0"
- default value
{int}
getItemValue(name)
return an item value
// get the "stars" value
totalStars = me.gamestat.getItemValue("stars");
- Parameters:
- {String} name
- name of the item
- Returns:
- {int}
reset(name)
reset the specified item to default value
- Parameters:
- {String} name Optional, Default: "all"
- name of the item
setValue(name, val)
set value of an item
// set the"stars" item
me.gamestat.setValue("stars", 1);
- Parameters:
- {String} name
- name of the item
- {int} val
- value to be set
updateValue(name, val)
update an item
// update the "stars" item
me.gamestat.updateValue("stars", 1);
- Parameters:
- {String} name
- name of the item
- {int} val
- value to be added