Section 5

We think we have removed the brittleness from our unit tests so that we are no longer sensitive to changes to the general dimensions of our cells. So here's the real test if this is true. We should change the cell size yet again. By doing a combination of running all the unit tests and actually opening a new LaserGame morph with the even larger cells and then playing with it, will tell us that we have these cell size sensitivity changes resolved.

Before we change the size of our cells, we should close any open LaserGame morphs. Changing the definition of the cells while existing LaserGame morphs are potentially trying to update their graphics could cause problems. Make sure any existing Laser Games are closed.

Here's the modification to the #cellExtent class method on CellRenderer that will make the cells larger.

cellExtent
    ^50@50

Re-run all our unit tests. Everything passes. Let's open up a new LaserGame morph. I had to adjust the open position because the cells are larger now and consequently so is the board. Here's my modified Workspace code for opening the LaserGame morph.

(LaserGame randomizedGridOfExtent: 8@10)
    position: 20@230;
    openInWorld

It works great.

Save both the Laser-Game and LaserGame-Tests packages.

Index Page Next Page

Copyright © 2007, 2008, 2009, 2010 Stephan B Wessels    stevewessels@me.com