UnicMinds

Math Quiz Game in Scratch

Coding a Math Quiz Game in Scratch

How to play the Math Quiz Game?

A character in the game will ask Math Questions. The player needs to answer the question . With each correct answer, a point is awarded and a point is deducted if the answer is wrong.

Steps to create the Quiz Game inScratch Programming

Step 1: Create the background 

Click on choose a backdrop option at the bottom right corner and then choose the blue sky backdrop.

Quiz Game in Scratch
Math Quiz Game Background in Scratch

Step 2: Create the sprite 

Click on choose a sprite option and choose a character as shown below.

Click on choose a sprite option and choose a button which will be the next question button.

Every time next button is clicked, the game displays the next question.

Scratch Game - Math Quiz Game
Math Quiz Game - Scratch
Math Quiz Game in Scratch Programming

Add text on the button saying next

Scratch Coding for Kids

Step 3: Creating variables for the game.

Scratch Programming for Kids

Score variable to store the points scored by the player.

Num1 variable to store the first number in the question

Num2 variable to store the second number in the question

The initial value of the score variable is 0.

The initial value of the num1 and num2 variable is any random number between 1 to 10.

Step 4: Create the question and display in the game

Scratch for Kids

Sample output:

Math Quiz Game in Scratch Programming for Kids

Step 5: Every time the next button is clicked, new question is displayed.

Add this code to the button sprite

Check is the function that needs to be called.

Scratch Programming for Kids

Step 6: Check if the answer entered is right

Scratch for Kids

Answer is the response entered by the user.

Correct answer is num1 + num2, the variables which store the numbers randomly generated by the computer.

If both are equal, then a point is scored otherwise a point is deducted.

Add this code to the rooster sprite after the code shown below.

Scratch Coding for Kids

Hope this is useful, thank you.

You may like to read: Is Primary Math Tuition Necessary?, Scratch Coding Quiz, Programming Tic-Tac-Toe in Java, and Coding Basketball Game in Scratch

BOOK A FREE TRIAL