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

5.05 Ride on platforms

Well that’s too easy!

In this step, you will add platforms to land on. Jumping on them will avoid falling in.

Create a Platform 1 sprite to land on.

Paint a costume for your Platform 1 sprite.

Tip: If you want your sprite to bounce without the costume appearing to change direction, you will need a costume that is symmetrical, or set the rotation style to Don’t rotate.

Add code to your Platform 1 sprite to get it moving.

You may need your Platform 1 sprite to point in direction 0 to move up and down the screen.

Test: Click the green flag and make sure your platform moves correctly.

Duplicate your Platform 1 sprite and name it Platform 2 .

Choose: If you want to have 3 platforms, duplicate the Platform 1 sprite again and name it Platform 3.

Right-click (or on a tablet, tap and hold) on your first sprite in the Sprite list below the Stage:

Select duplicate. This will create a copy of your first sprite, with the suffix “2”:

Rename your sprite:

The Sprite pane, with the 'Sprite' field highlighted.

Your sprite’s name will change in the Sprite list:

The Sprite list showing the duplicate sprite with a new name.

Your second sprite has exactly the same code as your first sprite. Do not run the program until you have started to change the second sprite’s code — you might not see the second sprite because it might be positioned underneath the first sprite.

Experiment with the number of steps and the sprite size to make each platforms easier or harder to jump on.

Detect if your character sprite has landed on a platform sprite and is safe, else your character sprite has fallen in!

Add code to your character sprite to sense if touching a colour on the platform sprites.

Choose: If your platform has multiple colours, choose which colour your character needs to land on. You might want them to fall in if they are only on the edge!

Test: Click the green flag and make sure your sprite can ride on the platforms.

Add code to your character sprite to sense if touching the backdrop colour, then end the game.

Test: Play your game and try missing a platform. Make sure you hear the lose sound.

Add code to your platform sprites to stop them moving when the character sprite reaches the End platform — or falls in!

Test: Play again and make sure the platforms stop when the game ends. The game ends when you reach the End platform, or when you fall in.

Debug:

Make sure you have the if blocks in the correct order inside your forever block. Check carefully against the example code.

If you check that the character is touching the backdrop before it has had chance to land on a platform, then your game could end unfairly!

Make sure your if blocks to check game conditions are inside an if block that checks the size of the character is normal. It’s fine for your sprite to be touching the backdrop colour when jumping. It’s only a problem if they land in the custard, lava, radio-active goo, or whatever hazard you have chosen.

Look at your platform sprites’ when I receive script and check the message is stop.

Check that the broadcast block inside the win and lose if blocks is stop.

×
×

Cart