Count the hits
Try itStart your game
This slime keeps count. Every time it is hit, it adds 1 to @hits and tells you the number.
Hit the slime
- Press Play
and click the little game. - Walk the hero up to the slime. Stop about one block away.
- Press X to swing the sword.
- Swing again, and again.
"That is 1!" "That is 2!" "That is 3!" The slime remembers, because the number is in the box.
This slime takes 5 hits to beat, so you can count all the way to 4 before it goes.
How it works
| Line | What it does |
|---|---|
@hits is 0 | Starts the count at 0. |
@hits goes up by 1 | Adds 1, each time the slime is hit. |
say "That is @hits!" | Says the words, with the number from the box in place of @hits. |
Now in your own game
Press Open your game here, in the builder below, and give your enemy this script. One thing is different there: a plain enemy is beaten by one hit, so it never gets to count.
To make yours tougher, open its settings, turn on Boss, and set Hits to defeat to 5.
This section ticks itself when you press Play
.

