The family
ChallengeYour own words
This challenge checks that your game has a real family: enemies that share one script.
It is in your own game. Your game checks it with a third test.
What should happen
- Your game has a family called Dancers.
- Level 2 has two or more enemies in that family.
- They all dance the same way, because they all run the family's script.
- When the alarm goes off, your new test counts the Dancers in the level and passes.
What to check first
| Check | How |
|---|---|
| The family is called Dancers | Game Settings |
| Level 2 has two Dancers or more | Click each enemy, open Character scripting |
| They have no script of their own | Their own script should be empty. |
How to add the test
- Press Open your game here, in the builder below.
- Press the Game button
, under the map. In Game Settings, find Scripts and press Tests
. - Press Code
. Under your two old tests, leave a blank line, then type these two lines.
when "alarm"
test "Level 2 has a family of Dancers" if the remaining {Dancers} is at least 2- Press Save
.
The words the remaining {Dancers} count the Dancers still standing in the level. So this test asks: are there at least 2?
Test it
- In the builder, go to level 2 and press Play
, under the map. - Leave the Dancers alone. Do not beat them before the alarm.
- Walk the hero onto the alarm block. The door opens, and your new test runs.
- Walk through and touch the goal.
- Look at the Test results drawer. All three tests should have a tick.
- Look under the builder. It should say that your tests passed.
| If this happens | What to do |
|---|---|
| The new test has a cross | Count your Dancers in level 2. The family's name must be Dancers, the same as in the test. |
| A Dancer does not dance | It still has a script of its own. Open it and take it out. |
| An old test has no tick | All three must pass in the same go. Trip the alarm, then touch the goal. |

