Virtual Reality with Google Cardboard
Lesson 9: If, then, because!
Instruction Overview
Understand
- How conditional (if/then) statements are necessary for programming games and apps
- How to use conditionals in CoSpaces to win or lose
Apply
- Use if blocks in CoSpaces to modify last lesson's mini game with win/lose conditions
Create
- Develop a mini game that tells the users when they win and/or lose
For the instructor's eyes only
Create Goals
☐Develop a mini game that you can win or lose
☐Begin brainstorming your individual game project
Let's do a quick
recap of variables
Why are they useful in
making games?
Variables can hold...
-
Scores
-
Lives
-
True/false (like win or lose)
-
Text (names, sentences, etc.)
-
Anything else?
There are different ways you can show variables in CoSpaces
Last Lesson: Pirate
Today: Text box
Let's log into CoSpaces
Visit www.cospaces.io and open the mini project from last time
Add a Text Panel to
your space
Activate the text element in CoBlocks
Task
☐Show the score variable inside the text box and delete pirate
5 min
Remember to put it inside the forever block
Winning and Losing
How can we program this in
our games?
The secret is if/then
How if/then works
this happens
"if this happens,
then that happens"
then that happens
score > 2
then you win!
In our case...
Task
☐Insert an if/then block to give a win message in your game
5 min
Remember to put it inside the forever block
Create Goals
☑Develop a mini game that you can win or lose
☐Begin brainstorming your individual game project
Your individual project
Are you ready to make your own VR game from scratch?
Individual Project Rules
-
A way to win or lose
-
A number variable (score, lives, etc.)
-
A goal for the player (cross to the other side, collect items, defeat enemies, etc.)
-
Should be fun in VR!
What game do you want to make?
Share your idea with the
rest of us!
Create Goals
☑Develop a mini game that you can win or lose
☑Begin brainstorming your individual game project
Next Lesson:
Individual Project Day 1
VR Lesson 9 - If, then, because!
By scholarstem
VR Lesson 9 - If, then, because!
- 367