Leve 09 Lesson 03 [More Instance Ids]

In this lesson you won’t write any code. You are going to read it and try to predict the game behaviour. Code reading and learning from reading code is a valuable skill to practice. You will watch a short refresher video and then you will be given three tiny programs to analyze. Hopefully you will be able to describe the behaviour of each program without every running the code.

Part A – With, Other, and Local Variables
In this video we will refresh some past knowledge about using the with statement, the keyword ‘other’, and creating local variables when using with statements.

Watch the video: 09-03-A
Matching Project: 09-03-MarchOn.gmk (just for reference)


Challenge 1, 2, 3 – Read and Learn

Open up the document  Lv09_ReadTheCode_Ids.doc  from the Level 09 Resource folder. On here you will find FOUR sample programs. The first program is ‘March On’, which you saw as an example in the video 09-03-A. The remaining three programs are Detonator, Mother Coin, and Chain Reaction. For each program, go through the code slowly and try to determine what the program does without running the projects or watching the solution video. It could take you 2 minutes or it could take you 20 minutes to figure each one out. It is important that you try to get through it on your own to really make your brain work at understanding how the instance id variables are being used in these programs.

Detonator (Easy/Medium)
something about land mines that blow up.

Mother Coin (Easy/Medium)
a mother coin that makes baby coins?!?

Chain Reaction (Hard)
the name says it all, tricky one!

Having a piece of paper to sketch on or write ideas out on is always useful. Good luck!

Challenge 1, 2, 3 Solution
Solution Video: 09-03-X1-Solution (has all 3 programs revealed)

No Solution Files, but the projects are in the project folder and the executable files are in the Level 09 resource folder.