Scratch Silver III
Scratch Silver II
SCRATCH SILVER I
SCRATCH GOLD III
1 of 3

2.05 The bus leaves

Add more blocks to make the bus drive off.

The Stage showing that the bus has moved to the right.

Animate the Bus

Select the City Bus sprite.

The City Bus sprite.

Add code to make the bus drive off to the right four seconds after the green flag is clicked.

The City Bus sprite.

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.

The City Bus sprite.

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.

Hide and show the Bus

Add a hide block to make the bus seem to drive off the Stage:

The City Bus sprite.

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:

The City Bus sprite.

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.

×
×

Cart