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 valueChanges a global value to a number.
Add to a global valueAdds to it.
Take away from a global valueTakes away from it.
Compare a global valueTests 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.

WhenHero collides with Key
DoDestroy KeyAdd 1 to global value APlay sound Power up
WhenHero collides with DoorGlobal value A is > 0
DoDestroy DoorTake 1 away from global value APlay sound Door

Because A is global, a key found in level 1 opens a door in level 2.

How to

  1. Switch the toolbar to Advanced or Expert.
  2. In a rule, click the cell under โš™ Special and choose Global values โ†’ Add to a global value.
  3. Pick Global value A, type 1, press Add.
  4. 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.

Still stuck?

Try the Chocobreak tutorial, open a sample game and read its rules, or look at the questions people ask.