Skip to content

Coding project: Catch it!

Make a fun game using objects from the Science Museum Group Collection.

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

Instructions

  1. Open a new empty Scratch project.
  2. Download three images of objects from one of the Science Museum image bundles and copy the information. These will be your sprites.
  3. Download one background image from the Science Museum background bundles. This will be your stage backdrop.
  4. Upload an object image as a sprite. Upload the background image to Stage backdrop.
  5. Add code to your first sprite that makes the sprite appear and then disappear forever when the green flag is clicked.
  6. 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.
  7. 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.
  8. Add another code that will hide the sprite when it is clicked.
  9. 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.
  10. Create a variable called Score.
  11. 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.
  12. Create a variable called Time.
  13. Add a code to make a countdown timer of 10 seconds using the Time variable.
  14. Upload the other objects as new sprites. Copy all the codes you created, except for the code for Timer.
  15. Save your project and play it.

What next?

  • 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/