The level script

Try itThe boss and the ending

A level can have a script of its own. It does not belong to any character. It watches the whole level, and it can change the level.

This one keeps the room dark until the boss is beaten.

​

How to read it

RuleWhat the level does
when any {Heroes} entersMakes the room dark, as soon as the hero arrives.
when the {Big Slime} is beatenTurns the dark off, and shows a banner.

{Big Slime} is an ID, like {Door} in the last chapter. It points at the enemy with that name.

Try it

  1. Press Play Play this script, under the little game. The room is dark.
  2. Click the little game, so the keys work.
  3. Walk the hero up to the slime. Stop about one block away.
  4. Press X to swing the sword. This slime only takes one hit.

The light comes back, and the banner shows.

Give it to your level

  1. Press Copy Copy, at the bottom of the script in the code box above.
  2. Press Open your game here, in the builder below, and go to level 3.
  3. Press the Map button Map settings, under the map.
  4. At the bottom of the level's settings, press Level script.
  5. Press Code Code, and paste the script in. Press Save Save.

This makes a new game in your Lab and opens the builder right here. It is free.

This section ticks itself when you press Play Play this script in the code box.

Press Play in the code box to finish this section.