Public Functions:World Variable Functions
In order to use variables that get updated with the game state and are subject to save / restore / undo actions, authors must use AdventureJS's world variables. Use these functions to manage world variables.
- MyGame.decVar(id, value) {String} id {Int} value Int Decrement a game variable if it is a number. See Basic Scripting: World Variables for more info.
- MyGame.getVar(id) {String} id String|Int|Boolean Get a game variable. See Basic Scripting: World Variables for more info.
- MyGame.hasVar(id) {String} id Boolean Test whether a game variable exists. See Basic Scripting: World Variables for more info.
- MyGame.incVar(id, value) {String} id {Int} value Int Increment a game variable if it is a number. See Basic Scripting: World Variables for more info.
- MyGame.setVar(id, value) {String} id {String|Int|Boolean} value Set a game variable. See Basic Scripting: World Variables for more info.