To create a quiz that will test your friends knowledge about you!
Just like TV quiz shows, we need someone to be the host of our quiz. You are going to delete the cat from our sprites panel and add someone of your choice from the sprite library.
To delete the cat right-click on it in the sprites area and select delete. Next select "add sprite from library" and choose whoever you want by double clicking on them.
Now we need a fancy new background.
Go to your backdrop library and choose
a cool background to start off your quiz.
Next we need to code our background to appear when we press green flag.
Making sure that you have selected your backdrop, add the "when green flag clicked" from the events menu.
Then from the looks category, select the "switch to backdrop".
Now, to begin our quiz it would be a good idea to have our host welcome the player. We will be using the "say" block in the looks category. You can type your own welcome message.
To ask a question we will use the block.
This block will bring up a box that they can type the answer into. Add this to your code and insert your own first question. You will find it in the sensing category.
When anything is typed in the "ask" block it is stored in the "answer" bubble. We can then use the bubble to check if they have answered the question correctly.
To show how this bubble work, you are going to get a "say" block from the looks category and put the "answer" bubble in it.
When you press the green flag, what ever you type in the box will be said by our host.
If a second "ask" block has be answered, only the last answer will be stored in the "answer" bubble.
After the person has answered our question, we need to have some code that will check if the answer is correct.
In the control category you will see the "if then" block. This block checks to see if a condition is True. We want to see if the "answer" = the correct answer so that is our condition. You can get the green "=" from the operators category, you put the "answer" bubble in the first box and write the correct answer in the second box.