Working Plan
- Conditional structure
- Logical expressions
- Operators and sensing
- Questions and answers
Let’s condition de movements
Step by step
- Sign in and open the project m1repte71 that we created in session 7.
- Click on File and choose the option Save as a copy.
- Now we have a project called m1repte71copy. Change the name to m1repte91.
- Now, change the size of the dragon bigger.
- We have checked the category Control. Now let’s have a look at the conditional structures:
- Add a condition. You can use the block if … then:
- The blocks with pointed ends are logical expressions, which can be true or false. We can find them in the categories Operators and Sensing.
- We will add the dragon an initial control to set size at 100% and add a condition to stop growing when touching the wizard:
Modify the project m1repte91 to make the dragon stop growing if he touches de wizard or if we press a key.
The Scratch asks questions!
Step by step
- let’s go on working on the projetc m1repte91
- In the category Control there is another conditional block:
- Choose the wizard. He will ask a question. Modify the programme and add the following:
- Write the following in this block: “Do you give up? Say Y if it is Yes and N if it is No”.
- When we write the answer it is saved in a place called answer:
- In order to pregramme the two possible answers, we must do the following: