We’re working on new resources which will invite you to get creative with objects from the Science Museum Group Collection using Scratch. These resources are in beta mode and are currently being evaluated.
What you will make
A game to catch objects on screen. Once you catch them, you will learn more about it and increase your score.
See the completed project here: https://scratch.mit.edu/projects/593127847/
What you will learn
- Understand the need for pauses between actions within loops
- Use code to generate random numbers in Scratch
- Add variables to store a game score in Scratch
- Set size for a sprite in Scratch
What you will need
- A computer
- Internet access
- Science Museum image bundles
Open a new empty Scratch project.
Download three images of objects from one of the Science Museum image bundles and copy the information. These will be your sprites.
Download one background image from the Science Museum background bundles. This will be your stage backdrop.
Upload an object image as a sprite. Upload the background image to Stage backdrop.
Add code to your first sprite that makes the sprite appear and then disappear forever when the green flag is clicked.
Then add another code to make your sprite flash on and off at random times. Do this by selecting ‘pick random’ from the Operators area.
Now add a code that will randomise the size of your sprite when it appears. Use ‘set size to %’ from the Looks area and ‘pick random’ from Operators area.
Add another code that will hide the sprite when it is clicked.
Now add an Event code for whenever the sprite is clicked. This code makes the sprite display information about the object, waits a few seconds, and hides the sprite.
Create a variable called Score.
Add a code to reset the Score variable every time you start the game and change the Score by 1 every time when you click a sprite.
Create a variable called Time.
Add a code to make a countdown timer of 10 seconds using the Time variable.
Upload the other objects as new sprites. Copy all the codes you created, except for the code for Timer.
Save your project and play it.
- Hide sprite once you clicked it (Hint: need variables to specify if a Sprite is clicked or not and reset the variable when you start the game)
- Add more sprites
- Change the size of sprite
- Reduce time to make the game harder
See the completed project with What next here: https://scratch.mit.edu/projects/582812238/