Brave or scared

Try itMaking choices

This slime is brave, as long as it is not hurt.

if
end

How to read it

every 1 second is an event from the last chapter. It happens again and again, one second apart. So once a second the slime asks itself: is my health 100?

When the answer is yes, it chases the hero.

Fight the slime

  1. Press Play Play this script.
  2. Click the little game.
  3. Wait for the slime to come close.
  4. Press the X key to swing the sword. It takes 3 hits to beat it.

Did you spot the problem?

After the first hit, the slime's health is 67. The answer to its question is now no.

But it keeps chasing! A character carries on with what it was doing until a step tells it to do something else. The if said no, and nothing else was there to take over.

The next section fixes that.

This section ticks itself when you press Play Play this script.

Press Play in the code box to finish this section.