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

6.03 Build and test

Now it’s time to make your simulation. Start with thinking about the background to your simulation. Will it scroll, or will it be static?

Example world projects.

Tip: Remember to test your project each time you add something. It is much easier to find and fix bugs before you make more changes.

Choose a backdrop to use for your simulation. The backdrop could remain still, or you could make it scroll.

Rather than scrolling the backdrop, in fact, you’re going to scroll a sprite, which you have created by copying a backdrop.

Create a new sprite by copying the images from a backdrop, and adding them into your sprite.

Paint new sprite tool selected.
Copy tool highlighted in the tool bar.
Paste tool highlighted in the tool bar.

Create a new variable called scroll_x.

The following blocks will create a scrolling effect on the sprite when the mouse is moved left and right.

Tip: Instead of using the mouse position, you could use clicking on a button or pressing a key to change the scroll_x variable.

Think about the sprites you will use for your simulation. Will some of them remain still in the scene, will they change costumes, effects, or motion when they are interacted with? Will they scroll across the screen? How will they be controlled if they move?

Create sprites for your directions and position them on the screen.

Scratch cat on the Stage with right and left buttons in the bottom right-hand corner of the screen.

The buttons should have controls to broadcast their direction, when they’re clicked on.

Left sprite button.

The sprite being controlled should move in the direction indicated.

Scratch Cat sprite.

You can change the appearance and orientation of a sprite whenever it is clicked. Here are some code examples.

There are several ways to animate a sprite using its costumes. Here are a few examples.

Sprites that you are using as backdrops need to be on the back layer. Sprites that you want in the foreground need to be on the top layer. You can set the layer of a sprite or its clone.

Will any of your sprites need to clone themselves? Will they produce many copies that perform different actions when they start?

Here are a few ways to make clones and delete them after different events.

When a clone is created, it may need instructions on how to move, but you might want the different clones to behave slightly differently. You can use random blocks to do this.

Clones can be created with many different events. The blocks below will create a clone of a sprite every time it is clicked upon.

You can create clones whenever the mouse is clicked as well, and make the clone appear at the mouse-pointer’s location. Clones can appear in any location you like, so you might like them to go to a specific sprite or position.

Will there be a musical or sound effect aspect to your simulation? Maybe there’s background noise, or a sprite plays a tune when it is clicked?

Once you have added the extension, new blocks will be available to you.

There are three main elements that can be changed within these blocks.

  • beats are a unit of time used in music. A beat could be a second long or a quarter of a second long. It is up to you.
  • tempo sets how many beats there are in a minute: 60 beats a minute would mean that a beat is 1 second long.
  • note is the pitch of the note being played: 60 is the same as middle C on a piano.
  • Select the sprite you want to add the sound to.screenshot
  • Click the Sounds tab, and click Choose sound from library:screenshot
  • Sounds are organised by category, and you can click the Play button to hear a sound. Choose a suitable sound and click OK.screenshot
  • You should then see that your sprite has your chosen sound.screenshot

Select the sprite that you want to have the new recorded sound, then select the Sounds tab:

The Sounds tab open in the Scratch editor.

Go to the Choose a Sound menu and select the Record option:

The 'Choose a Sound' menu, with the 'Record' option highlighted.

When you are ready, click the Record button to start recording your sound:

The 'Record Sound' pop-up window with the 'Record' button.

Click the Stop recording button to stop recording your sound:

The 'Record Sound' pop-up window with the 'Stop recording' button.

Your new recording will be shown. You can Re-record your sound if you are not happy with it.

Drag the orange circles to crop your sound; the part of the sound with a blue background (between the orange circles) will be the part that is kept:

The recorded sound in full, with orange circles adjusted to show only part of the sound within a blue background. The rest of the sound is in an orange shaded area.

When you are happy with your recording, click the Save button. You will be taken straight back to the Sounds tab and you will be able to see the sound that you have just added:

The Sounds tab, with recording1 showing in the list of sounds.

If you switch to the Code tab and look at the Sound blocks menu, you will be able to select the new sound:

The 'Sound' blocks menu, with recording1 available for use within blocks.

The sound editor has tools to change the speed, volume and fade effects of a sound – you can also make it robotic!

To apply an effect to the whole sound click on a sound effect tool below the sound wave:

The sound effect tools highlighted.

Click on the sound effect tools as many times as you like as each time it will apply the effect again.

To apply an effect to part of a sound, choose a starting position for your effect on the sound wave then left-click and hold.

Drag your mouse pointer to the effect end position and release. You will see a highlighted area on the sound wave.

If you are using a tablet using your mouse or finger to tap and drag over the sound wave.

Click on a sound effect tool. The sound wave will update and you can play your new sound:

The sound wave in the Sound editor with the middle section highlighted.

Reversing sounds are useful for creating special effects, for example the Slide whistle sound makes a good shrinking effect, so reversing it makes the perfect growing effect!

Add or record a sound.

Click on the Reverse icon to make the sound play backwards. You will see the sound wave reverse.

The sound with the reverse icon highlighted.

Tip: To keep both the original version and the reversed version of the sound, right-click (or tap and hold) on the original sound and choose ‘duplicate’.

The sound with popup menu showing duplicate.

Select the sound to be edited.

Choose a starting position for your edited sound on the sound wave then left-click and hold. Drag your mouse pointer to the new end position for your sound and release. You will see a highlighted area on the sound wave.

If you are using a tablet using your mouse or finger to tap and drag over the sound wave.

The sound wave in the Sound editor with the middle section highlighted.

Use the sound editor tools to Copy, Copy to New, Paste or Delete the highlighted section of the sound.

The editor tools highlighted with the new sound wave showing section has been deleted.

Tip: You can use the Undo tool to reverse any changes you are not happy with.

Do you want your sprites to keep repeating an action, until some condition has been met? You can use repeat until blocks to do this.

Here is a set of blocks that will keep a sprite moving, until its y position reaches -250.

Think about the organisation of your blocks, and the inputs that might be needed. Can you use My Blocks to optimise your project?

The simplest way to use My Blocks is to help organise your code. Here is a simple example.

My Blocks take text and number inputs as well.

The key to most 2.5D scenes is changing the size of a sprite to give the impression that it is further away.

The following blocks will make a sprite smaller as it moves up the screen, and therefore appear further away.

Test: Show someone else your project and get their feedback. Do you want make any changes to your scene?

Debug: You might find some bugs in your project that you need to fix. Here are some common bugs.

Are your clones hidden? Make sure that when the clones are created, the show option is used. Also make sure that you have them on the front layer.

If you want a sprite to cycle from one side of the screen to another, or vanish when it gets to one side of the screen, then you can check its position and perform some action. You might need to check where the centre of your sprite is, on its costume, to make sure this works properly. It’s easisest to drag the sprite to the side of the screen, and then check its x and y positions.

Have you checked that you are using your new block somewhere in your code. You can define a new block, but then you need to use it for the code beneath it to actually run.

Are you using the when I start as clone block, to tell the clone what to do?

Do you have any conditions that might stop the clones from working? For instance, are they supposed to move until they touch the edge of the screen? If a clone is created at the edge of the screen, then they won’t do anything.

Check that you are using the change x by block to move the sprites left and right, and the change y by block to move them up and down.

Check whether you are using positive and negative numbers correctly, to increase or decrease x and y.

You might find a bug not listed here. Can you figure out how to fix it?

We love hearing about your bugs and how you fixed them. Use the feedback button at the bottom of this page if you found a different bug in your project.

×
×

Cart