Scripts that run together
Answers are for parents and teachers.
1
Write two short algorithms for two sprites that both start when you press the space key: a car that moves right across the stage, and a bird that moves left across the stage.
Check that both start with the same event and that each algorithm has its own steps, such as: go to a start place, glide to the other side.
2
A script has these blocks: go to x: 0, y: 0; glide 3 seconds to x: 100, y: 0; wait 2 seconds; say Bye! for 1 second. How long does it take?
6 seconds. The go to block takes no time: 3 + 2 + 1 = 6.
3
A fish script takes 2 seconds and a boat script takes 5 seconds. They start together. What would you add to the fish so both finish together?
Add “wait (3) seconds” to the fish script, because 2 + 3 = 5.
4
Say which group each block belongs to: wait (1) seconds, say [Hi!], move (10) steps, when space key pressed.
wait: Control. say: Looks. move: Motion. when space key pressed: Events.
5
(if you have a computer or tablet) In Scratch, put two sprites on the stage. Give each sprite a script that starts with “when space key pressed” and makes it glide to a different place. Press the space key. What do you see?
Both sprites move at the same time, each to its own place.