⭐ Guided practice: Periodic Table Game

View

Instructions

To build this game, you will use different blocks:

Blocks

 

Use the Press “p” event block to start the game.

 

Use a control block (if then, else) to set conditions to fulfill,l, and if not something else happens. It's like using “True” or “False”

The first step is to create your variables and give them different values.

 

 

We will use logic operators and Operator reporter blocks together with the controls

List blocks

The Looks block will give the sprite something to say or help in displaying any value attributed to the sprite.

 

Figure 176: Blocks to use in building the Periodic Table game

 

The Stage and Sprite:

 

Step 0: Import the Penguin sprite and make the backdrop shown above. Add instruction to the backdrop to start the game as indicated above.

Step1: The first step in creating this game, is to create variables. We have to create the first 2 variables called Wins and Losses. Wins and Losses variables are set to zero and they will be changing whenever the score changes.

 

Step 2:  Create the third variable element Proton and set it to a random Number between 1 and 112.

 

Step 3: Make a list of Periodic table elements, see Guided activity 6.3: Creating a list with values.

 

Figure 177: Creating a list of chemical elements

 

Step 4:  Use a join block to ask a Question of elements related to the selected random atomic number in the list.

Figure 178: Get an element using a random atomic number

 

Step 5:  To check the answer is equal to the atomic Number randomly selected; if it is correct and provides feedback; when the answer is correct, the Wins will change by and when the answer is wrong the Losses will change by one as well.

To record the answer, we are going to use the if else control block to give a congratulations message when the answer is correct and a Fail message when the answer is wrong.  Sprite costume may also change as well.

Figure 179: Checking answer and increment wins and fails.


Step 6:  Set the loop with the condition. Here below the game will continue until five mistakes are made.

Figure 180: Looping until five mistakes are reached

 

Figure 181: Game preview

 

URL: https://Scratch.mit.edu/projects/463160707/



Last modified: Wednesday, 10 November 2021, 12:49 PM