The Wanderer - A few Program Notes
This game is based on 'PC Wanderer' by Steven Shipway. The game levels are a selection of those in his game. They are all public domain & some have been slightly modified to suit this game engine.
This version was written using Java JDK1.1.
I am indebted to 'The Black Art of Java Game Programming' by Joel Fan. The 'motion loop' used in this game is developed from the example code in Chapter 5.
There are 31 class files, of which 17 are for screen object classes. There are 5 object manager classes and a single applet class. The remainder are mainly abstract classes (including 2 interface classes) that are the 'building blocks' for the screen objects. The interfaces provide movement and collision properties for the screen objects. In total there is somewhere around 2500 lines of code.
There are also 21 jpeg image files, 3 sound files (au format) and 21 text files (20 of these are the levels). All have been enclosed in a (Java ARchive) jar file (about 95k).
The original PC Wanderer had a rather wearisome password system that forced players to complete each level before a new level could be attempted.
In this applet, the player can advance through uncompleted levels using a 'cheat' key F8.
The speed of movement of game sprites was chosen to make it possible to observe the interaction between them. The original game reacted so quickly that it was difficult to work out how events occurred.
The update interval is about 80 milliseconds. On a PII, the program spends most of this time in its 'sleep' state, waiting for the timer to advance. Some algorithms have been allowed to occupy more than one refresh interval, and occasionally this can be observed during play. A better programmer might have been able to avoid this.
History
11.5.2000 - Version 1. Initial upload.
22.5.2000 - Version 2. Changed method of reading text (level) files so that Netscape can find them in the jar file. Sound files also available outside the jar file - again for Netscape's benefit.
30.12.2000 - Version 3. A few tweaks to the game algorithms.