9.7 Spacewar! The Final Touch

At this point in the book, you have already written a fair amount of code for the Spacewar! game. However, it is very likely there are missing pieces in your code, or you may have inconsistencies with the final source code of the game. Let’s take this as an opportunity to introduce tools to compare the code installed in the Cuis-Smalltalk image with the code from a file, such as a plain .st fileout or a .pck.st package file.

First, you need to get the complete package of the Spacewar! game found in the appendix; then, invoke the Cuis-Smalltalk File List tool (World menu → OpenFile List) and search for the Spacewar!.pck.st package file you just downloaded.

ch10-FileListPackage

Figure 9.14: File List on Spacewar! package

The File List tool has a pck contents button to examine its contents against the image code. Pressing this button opens the Package contents tool in a new window.

At the top, it displays the types of content, which are:

ch10-PackageContents

Figure 9.15: Package contents

By default, the tool shows all the contents of the package without considering the differences with the code installed in the image. To show only the differences, use the tool’s contextual menu to remove unnecessary information: choose Remove doIts and Remove up-to-date versions. Once you have narrowed the list of changes to what you need, choose select all and then file in selections to install these changes into the image.

ch10-PackageContentsSelection

Figure 9.16: A selection of changes to file in

The missing and changed parts of the game will now be installed. To start it, select and execute SpaceWar new openInWorld in a Workspace.