Can you guess what these blurry pictures are before they are revealed?
In this project we will create a game where blurry pictures appear and slowly get clearer and clearer. The aim of the game is to guess what the picture is before it becomes completely clear!
Create a new Scratch project and delete the cat sprite.
Go to the Scratch website using the link below and click on the 'Create' link in the blue bar at the top.
By default, each new project starts with the cat sprite already added. To delete the cat click on the x in the blue circle beside the cat in the sprite list.
Included with this step is a file called 'scgtp pictures.sprite3'. This is a sprite file that has three different costumes which are photos of a rhino, a melon and a bird.
Right click on the link and choose 'Save link as' to save it onto your computer (keep a note of what folder you save it into).
Then in Scratch, upload the sprite into your project as a new sprite.
You can upload images and sprite files into your project. To upload a sprite follow these steps:
The new sprite will upload into your project and appear in the stage area.
We will need two lists in this game, one list for the questions (e.g. "is it a rhino or elephant?") and one list for the answers (e.g "the answer is a rhino").
Create two lists:
Once you've created the lists, add the following code to setup the questions and answers. Note that the order of the questions matches the order of the answers.
In the Variables palette, create a new variable by clicking the 'Make a List' button.
Once you click this button a box will appear asking what you want to call your list. Give it a name that reminds you what you will be using it for. For example, if you wanted to keep track of top scores in a game, you would create a list called 'top scores'.
We will also need a variable to store which picture we are currently showing in the game.
Create a variable called picture.
In the Variables palette, create a new variable by clicking the 'Make a Variable' button.
Once you click this button a box will appear asking what you want to call your variable. Give it a name that reminds you what you will be using it for. For example, if you wanted to keep track of your score in a game, you would create a variable called 'score'.
Next we will create a custom block called 'show picture'. We will program this block to:
Once you've created the custom block, add the following code to show the first picture.
You can create your own custom blocks and give them their own instructions (code). To create a custom block follow these steps:
A 'Define My Block Name' will appear in the code area. You can add your code underneath this and then use the My Block Name block in the 'My Blocks' toolbox anytime you wish to run that code.