Add more blocks to make the bus drive off.
Select the City Bus sprite.
Add code to make the bus drive off to the right four seconds after the green flag is clicked.
Drag your bus to the right-hand side of the Stage. This is the x
and y
position that the bus will glide
to.
Tip: If you move the bus too far to the right, it will jump back. Try again, but don’t move it so far.
Add a glide
2
secs to x: y:
block under the wait
block.
The x
and y
coordinates in your project might be a bit different and will be the exact position that you dragged the bus to.
Test: Click on the green flag. The Scratch Cat and hippo will move to the bus, and the bus will drive off to the right after four seconds.
Add a hide
block to make the bus seem to drive off the Stage:
Test: Click on the green flag. The bus will now hide after driving off. Do you remember how to make sure that a sprite reappears when you click on the green flag?
Add a show
block to your when green flag clicked
script to make the bus appear when you run your project:
Test: Click on the green flag and watch your animation. The bus should appear in the centre of the Stage and then drive off to the right and disappear.
Is everyone on the bus when it leaves? You can change the amount of time that the bus waits, if you need to.