Global values A to Z
Twenty-six numbers that every level shares, so keys collected in level 1 still count in level 3.
What they are for
Score and lives carry on from level to level. Nothing else does: a counter in level 1 is gone in level 2. Global values fix that. There are 26 of them, named A to Z, and they keep their number when you go to another level. Use them for keys, coins, a chosen character, or how many times the player has died.
They start at 0 when the game starts. They appear from Advanced mode, in the โ Special column under Global values.
The conditions and actions
| Set a global value | Changes a global value to a number. |
|---|---|
| Add to a global value | Adds to it. |
| Take away from a global value | Takes away from it. |
| Compare a global value | Tests it, with the usual comparison chips. |
Each one asks which value, Global value A to Global value Z, and a number.
In a formula
Global("A") is global value A, wherever you need its number. Show it in a Text object with "Keys: " + Str(Global("A")). Add it to the score at the end with Global("A") * 100.
Keys across a whole game
Say Global value A is the number of keys. Collecting a key adds one. A locked door only opens when A is more than 0, and uses one up.
Because A is global, a key found in level 1 opens a door in level 2.
How to
- Switch the toolbar to Advanced or Expert.
- In a rule, click the cell under โ Special and choose Global values โ Add to a global value.
- Pick Global value A, type 1, press Add.
- To test it, click + New event โ โ Special โ Compare a global value.
Saving
Save the game remembers the level, score, lives and all the global values, so a player can carry on another day with their keys. See Saving inside a game.