Skip to content
This repository was archived by the owner on Dec 20, 2019. It is now read-only.

Variables

Manuel Freire edited this page Jan 29, 2014 · 1 revision

Maintain game-state.

VariableDef

Example: an integer "gold" variable:

{
    name: "points",
    type: "integer",
    initialValue: "0"
}

Example: a boolean "hasCreditCard" variable (also called a flag):

{
    name: "hasCreditCard",
    type: "boolean",
    initialValue: "false"
}

Example: a string "name" variable:

{
    name: "name",
    type: "string",
    initialValue: "Player"
}

VarsContext

A collection of variables is called a VarsContext. These contexts are created whenever a game (or subgame) is loaded.

A given VarsContext also contains an API to query, add, and update its variables.

Clone this wiki locally