Create a game where the player has the guess the country from the shape of the country on the map. This project uses the European Union countries.
Go to the scratch.mit.edu website and create a new Scratch project. Delete the cat sprite.
In this project we will create a game where a random EU country shape will appear and the players needs to guess which one it is.
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 sprite file called "EU Countires.sprite3". Download this file to your computer and then upload it into your project as a new sprite.
This file has 26 costumes, each with a different country shape.
Add the following code to put it in the middle and hide it for the start of the game.
when green flag clicked
go to x (0) y (0)
hide
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 a list with all the EU countries that are possible answers. Create a new list called countries and then add the following new code to set it up for the start of the game. Make sure you spell the countries correctly as they'll be used for the answers.
Tip: copy and paste the names to save some time.
when green flag clicked
go to x (0) y (0)
hide // add new code under here
delete all of [countries v]
add [Austria] to [countries v]
add [Belgium] to [countries v]
add [Bulgaria] to [countries v]
add [Croatia] to [countries v]
add [Cyprus] to [countries v]
add [Czech Republic] to [countries v]
add [Denmark] to [countries v]
add [Estonia] to [countries v]
add [Finland] to [countries v]
add [France] to [countries v]
add [Germany] to [countries v]
add [Greece] to [countries v]
add [Hungary] to [countries v]
add [Ireland] to [countries v]
add [Italy] to [countries v]
add [Latvia] to [countries v]
add [Lithuania] to [countries v]
add [Luxembourg] to [countries v]
add [Netherlands] to [countries v]
add [Poland] to [countries v]
add [Portugal] to [countries v]
add [Romania] to [countries v]
add [Slovakia] to [countries v]
add [Slovenia] to [countries v]
add [Spain] to [countries v]
add [Sweden] to [countries v]
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 need a custom block that will run the code for playing one round of the game. Create a custom block called 'play round'.
And then add the play round block underneath the add Sweden to [countries] block.
define play round
add [Sweden] to [countries v]
play round
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.
We will need 3 variables to store some information whilst the game is being played. Create the following 3 variables:
You can hide the list and the variables by unchecking them in the toolbox. If you want leave the 'score' variable showing so the player can see their current score.
At the start of the game we want the score to start at 0 so add a set [score] to 0 block under the when clicked block.
when green flag clicked
set [score v] to (0) // add this block
hide
go to x (0) y (0)
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'.