Virtual Reality with Google Cardboard
Lesson 13: Quiz Game Part 2
Instruction Overview
Understand
- How to increase score for every correct quiz answer
- How to set up a live display of points gained on quiz
- Switch to a different level after gaining enough points
Apply
- Use variables to incorporate points system to quiz game
Create
- Finalize quiz game, complete with points system
For the instructor's eyes only
Create Goals
☐Create a score variable that increases as the player correctly answers questions
☐Create a text panel that displays current score
☐Allow players to progress to the next level if enough points are obtained
Variables can make our quiz more interesting
Let's let players earn points as they play
Let's log into CoSpaces
Visit www.cospaces.io
Make a Score variable
Here's a refresher on variables:
Make sure it starts at 0
Look for the Variables in the Data tab. Use the following block to make the variable:
Maybe the player gets $1000 for every correct answer?
Get creative with the variable. It doesn't need to be "Score"!
When should players gain points during the quiz?
Players gain points upon choosing a correct answer
Try setting this up!
Task
☐Program your game such that the player gains a point for every correct answer. Do this for each question!
5 min
Create Goals
☑Create a score variable that increases as the player correctly answers questions
☐Create a text panel that displays current score
☐Allow players to progress to the next level if enough points are obtained
How are players supposed to know how many answers they got right?
We're going to create a text panel. Make sure you have "Use in CoBlocks" active for the text
Note that the text is selected here, not the board itself
Program the text panel
To do this, we have to set the text of the panel to read our score variable.
The panel needs to constantly refresh, so use a forever block!
Check it out!
Look what happens as we get a correct answer:
Task
☐Create a text panel that updates as players choose correct answers
15 min
Create Goals
☑Create a score variable that increases as the player correctly answers questions
☑Create a text panel that displays current score
☐Allow players to progress to the next level if enough points are obtained
Let's reward the player if they get enough points
With an even harder level
First make another scene to act as your second level
Easy. We'll come back to this.
Now let's work on the level transition
When do players get to experience the next level?
Let them proceed when they have enough points!
First, let's make another text panel that lets them know what they need
Now use Control blocks to program this panel
Make it so if their score equals or exceeds a certain amount, they can transition to their new scene
Bonus: Try programming an event for if they DON'T have enough points
Task
☐Create an event that allows the player to transition to a new scene if they have enough points
☐If you have time, create a short, but harder quiz on the next scene!
15 min
Create Goals
☑Create a score variable that increases as the player correctly answers questions
☑Create a text panel that displays current score
☑Allow players to progress to the next level if enough points are obtained
Test your game!
Place it into the Cardboard and let someone else try it
Next Lesson:
Mini RPG Part 1
Create a game which utilizes everything you've learned so far
VR Lesson 13 - Quiz Game Part 2
By scholarstem
VR Lesson 13 - Quiz Game Part 2
- 295