SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

3.02 Create questions

Create questions

You’re going to start by creating random questions that the player has to answer.

Open a new Scratch project.

Online: open a new online Scratch project at scratch-new.

Add a character sprite and a backdrop for your game. You can choose any you like! Here’s an example:

screenshot

Make sure you have your character sprite selected. Create two new variables, called number 1 and number 2, to store the numbers for the quiz questions.

screenshot
screenshot
  • Click on Variables in the Code tab, then click on Make a Variable.Variable blocks
  • Type in the name of your variable. You can choose whether you would like your variable to be available to all sprites, or to only this sprite. Press OK.Create variable
  • Once you have created the variable, it will be displayed on the Stage, or you can untick the variable in the Scripts tab to hide it.Variable on the stage

Add code to your character sprite to set both of the variables to a random number between 2 and 12.

screenshot

Add code to ask the player for the answer, and then say for 2 seconds whether the answer was right or wrong:

screenshot

Test your project twice: answer one question correctly, and the other incorrectly.

Add a forever loop around this code, so that the game asks the player lots of questions in a row.

×
×

Cart