If this, then that
ReadingMaking choices
So far, a character has done every step in its rule, every time. Now it learns to choose.
Asking a question
An if line asks a question. The answer is yes or no.
when I see the {Hero}
if my health is 100
chase the {Hero}
end| Line | What it does |
|---|---|
if my health is 100 | Asks: is my health 100? |
chase the {Hero} | Happens only when the answer is yes. |
end | Shows where the if stops. |
The steps that belong to the if are pushed in under it, just as a rule's steps are pushed in under its when line.
Two paths
Add else and the character has two paths. It takes one or the other, never both.
when I see the {Hero}
if my health is 100
chase the {Hero}
else
run away 3 blocks
end| The answer | The path it takes |
|---|---|
| Yes | The steps under if. |
| No | The steps under else. |
What is health?
Health says how hurt a character is. 100 is not hurt at all. Each hit takes some away. At 0 the character is beaten.
The slime in this chapter takes 3 hits. So its health goes 100, then 67, then 33, then it is beaten.
Finish this section
Tick Finished reading at the bottom of the page. Then press Next to meet a slime that picks a fight.

