How many addition sums can you get right in 30 seconds!?
In this game players will try and answer correctly as many addition sums as they can in 30 seconds.
Go to the Scratch website at scratch.mit.edu and create a new Scratch project. You can 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.
Add the Giga sprite from the sprite library.
This sprite will ask the questions.
To add a sprite from the sprite library follow these steps:
You can use search box or the filter links (Animals, People, Fantasy etc) to locate your sprite.
We will need 4 different variables to store some numbers that we need in the game.
Create the following 4 variables:
After you have created the variables, uncheck their checkboxes so that they do not appear in the stage area.
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'.
Let's set up some things for the start of the game. We will set the 'points' variable to 0, set the 'max number' variable to 10 and start the timer.
Add the following code to the Giga sprite.
when green flag clicked
set [points v] to (0)
set [max number v] to (10)
reset timer
To make Giga ask a sum we need to set number1 and number2 to random numbers between 1 and the 'max number'. Then we need to make Giga ask the sum and wait for the answer.
Add the following new code to the Giga sprite, underneath the reset timer block.
when green flag clicked
set [points v] to (0)
set [max number v] to (10)
reset timer // add the new code under here
forever
set [number1 v] to (pick random (1) to (max number))
set [number2 v] to (pick random (1) to (max number))
ask (join [what's ] (join (number1) (join [ + ] (number2)))) and wait
end