Section 2

Let's check our assumptions first. We believe that the laser beam is no longer active because we clicked on the "Stop" button. Besides, the label of the button is now "Fire" which we just wrote to be based upon the current state of the grid's laser beam. What about the target cell? Is it active or not?

Command-Click on the morph and bring up the halos. Hover your cursor over the wrench halo (debug halo) and pop up the menu. Select "inspect morph".

Inspect the grid instance variable of our morph.

Inspect the cells in our grid and find the target cell. It should be at location 5@1.

When we send the #isOn message to the target cell it says it's still on. That's wrong. Well. At least we know the graphic is correct. It's the state of the cell that's incorrect.

We should be able to write a unit test on our GridTestCase that checks and reproduces this condition. Close the LaserGame morph.

Index Page Next Page

Copyright © 2007, 2008, 2009, 2010 Stephan B Wessels