The coward

ChallengeMaking choices

This slime should be brave until it is hurt, and then run. But its two steps are on the wrong paths. Your job is to swap them.

What should happen

When the script is right, the game goes like this.

  1. The game starts. The slime is not hurt, so it chases the hero.
  2. The hero hits the slime once with his sword.
  3. The slime is hurt now, so it turns and runs away.

What happens now

The slime does the opposite. It runs away at the start, and chases the hero once it is hurt.

How to fix it

You change a step by picking a new one from a list.

  1. Look at the top left of the code box. Press Code Code, if it is not picked already.
  2. Find the line under if my health is 100. It says run away 3 blocks.
  3. Click the small arrow at the end of that line. A long list of steps drops down.
  4. In the list, click chase the {Hero}. The line changes.
  5. Find the line under else. It says chase the {Hero}.
  6. Click the small arrow at the end of that line.
  7. In the list, click run away 3 blocks.
if
else
end

Goals0 of 2 passed

  • The coward chases the hero at full health: not checked yet
  • The coward runs away once it is hurt: not checked yet

Press Play and make every goal pass. A goal is checked when its moment in the game comes.

Test it

  1. Press Play Play this script, under the little game.
  2. Click the little game, so the keys work.
  3. Wait for the slime to come close. Press the X key to swing the sword, once.
  4. Leave the slime alone and count to 6. The second goal is checked 6 seconds after the hit.
If this goal has a crossWhat to change
The coward chases the hero at full healthThe line under if must be chase the {Hero}.
The coward runs away once it is hurtThe line under else must be run away 3 blocks.

Press Stop Stop, check your two lines, and press Play again.

Make every goal and every test pass to finish this section.