Virtual Reality with Google Cardboard
Lesson 8: Working with Variables
Instruction Overview
Understand
- What are variables and why are they useful for programming
- How to create and modify a variable for score in CoSpaces
Apply
- Upgrade to CoSpaces Pro to use advanced features like data, functions, and scripts
Create
- Develop a mini game that has the user collect objects and add to a score
For the instructor's eyes only
Create Goals
☐Create a variable to track score
☐Develop a mini game that has the player collect objects and increase score
Why are numbers important for games?
Where are they used?
Variables allow us to use numbers in coding
How do we do add them to CoSpaces?
Let's log into CoSpaces
Visit www.cospaces.io
You should have Pro features unlocked
If not, please raise your hand
First, we have to create a variable and give it a name
Next, we change the initial value to 0
Create Goals
☑Create a variable to track score
☐Develop a mini game that has the player collect objects and increase score
Task
☐Create a character that says the score when you click on him
10 min
We can also change variables based on different actions
Try it out!
Task
☐Develop a mini game where you have to collect objects and increase you score.
15 min
Test your game!
Place it into the Cardboard and let someone else try it
Create Goals
☑Create a variable to track score
☑Develop a mini game that has the player collect objects and increase score
Next Lesson:
Winning and losing
How we set up conditions to win or lose based on variables
VR Lesson 8 - Working with Variables
By scholarstem
VR Lesson 8 - Working with Variables
- 428