Click on the radio for the clue. Click on the four digit number and press ENTER. Scratch project link
In this project you'll learn how to make a safe in Scratch that opens once the correct combination is entered, just like in the project above.
1. Start a new Scratch project and set up a background. Use one from the Scratch collection or make one of your own. Delete the Scratch cat.
2. Select the 'Paint' button from the 'New Sprite' menu.
2. Select the oblong tool then click and drag to draw an oblong. This is the main part of the shape of your safe. (Use the fill tool to colour it in.) Change the size of the sprite if you need to then move it to where you would like it to be.
3. Now it is time to make the number digits on the front of the safe. Select the 'Paint' tool from the 'New Sprite' menu.
4. Select the oblong tool and draw a square. Change the colour so it stands out from the background. Resize it to fit.
6. Select the text tool and write the number one on the shape. Use the fill tool to change the colour of the text. Change the size of the text by clicking on it and dragging out the circles on the corners.
8. Right click on the sprite to duplicate the costume.
9. Change the colour of the background in the duplicated costume. This is the colour that the button will go when it is pressed.
10. Click back onto the first costume before moving on.
11 Click back onto the first costume before moving on.
11. Go to the CODE tab and add this code.
You will want to change the sound. Here's how:
The colour changes for the length of the sound. If the sound is too short and the colour doesn't change for long enough, add a WAIT block.
12. You need 10 button sprites altogether. The easiest way to do this is to duplicate the button you just made. This will duplicate the code as well. It makes life a lot easier!
Right click on the sprite to find duplicate. Double click on the number to change it. Remember to change the number on both costumes.
Your sprites should now look like this:
13. Drag the buttons to where you want them on the safe. You might want to turn the sound off while you do this!
14. The last sprite you need to add is the entry button. Design this however you like. I designed this by duplicating and changing one of the number button sprites. I deleted the code off it too.
You've made it through the set up process. Now you've just got the coding to go.