български

7. If…

In order for something to happen, sometimes something else called a condition must apply. For example, in order to say meow, the condition "be a cat" must apply.

Condition: "if I were a cat"

  • True (is a cat): says meow
  • False (not a cat): does not say meow

Scratch code would look like this:

 

In the video below you check how the hero reacts if he falls into a wall:

TODO: Program your hero not to go through the walls of the maze, even if the player driving him presses the corresponding button to advance. In the script you have made to move, you will add a control block if.

If touching the color of the wall,  retrace his steps (eg if he has moved 5, move  -5). See why the color of the walls had to be unique?