top of page
Starting Out: Variables
Materials: Computer and accounts CoSpaces Edu, your maze drawing
The problem: Can you add to your game design? Can you create a room with a locked door and a key? Do you know what variables are used for? Have you ever used an if else statement?
This sections goal is to:
1. Pull out your previous maze drawing
2. Draw a room at the start of your maze and another somewhere else in your maze
3. Draw some items (desk, bed, chair) that you would like to place in the room
1. First we will learn how to create a room with a locked door and a key. Follow the instructions below.
Video 1
Attach your room to your maze
2. Here is an example of a room with a key and a locked door. Do you notice some other code that has been used?
3. Now lets go a little deeper, lets create an integer or number variable, it starts at 0 but everytime the player collects an item that number goes up! If the number equals (=) 3 then the door will open!
Video 2
4. Below is an example of what you could do in your maze with this new code! You don't have to have 3 items, you can have as many as you want! Notice there is a person talking, how do you think you could code that in?
Now that you know how to create keys, items and doors why not go back to your ideate stage and start to place some more rooms with hidden items in them. Or perhaps the player has to find certain items in your maze to move forward through a door. Try decorating your maze with pictures or placing some characters in your maze.
bottom of page