
This is the final lesson in which you are going to learn how to code a maze game, using variables and use “if statements”. You will need to have completed previous lessons before you start today’s lesson. Click on the ‘stuff’ menu at the top left of the page and click on ‘coding’ to find previous lessons.
Don’t worry if you have not completed previous lessons yet. Just go back and start at a place that works for you.
Do what you feel your brain can cope with. NEVER copy code – watch the videos then have a go yourself.
What have we done?
Open your game. You should have:
- Written code to move a sprite in four directions using arrow keys
- Created a maze
- Written code so that your sprite goes back to the start if it touches the maze.
- Created at least one additional level and used the broadcast code to trigger several things to happen at the same time.
- Created extra sprites to avoid
Today’s lesson – Adding lives
Today’s lesson focusses on adding a variable so that our sprite has a limited number of lives. When lives run out… the game ends
I suggest that you watch the video to begin with, then try to complete the work (rather than keep stopping the video and completing each small step). You will learn more trying to figure out how to do things. You can always go back to the video if you get stuck.