Project: Worm

Write an implementation of the "Worm Game" by modifying the source code from Chapters 3 and 4 of Davison's Killer Game Programming in Java. See an example implementation at Notice that the player's worm moves faster than the enemy worms. What else can you see about the game's behavior by observing the example?


Your worm should grow in length, slowly, but visibly.

You must have at least one "enemy" worm. It should grow at the same rate as your worm, but if "boxed in" will decrease in size until it can "escape". It should never run into any worm or the sides of the box. You'll notice from the demo program that the enemy worms do not change direction often. Come up with a reasonable strategy for when they should change direction.

The + and - keys (hyphen and "=") should control the speed of the game.

There should be "button" where clicking will start the game. Clicking on it while the game is running should pause the game. Clicking on it while paused should cause the game to resume.

Upon termination, display the player's score and high score (since starting the program). The "start" button should now be available to start a new game.


Extra Credit and Graduate Requirements

Add a second worm.

Add a checkbox for "Build up speed". When checked, this should cause the game's speed to slowly increase.

Add a sound component so that there is a noise when the player "crashes" (loses).

Add a "bonus" target (green box in the example game). When passing through this the enemy worms should be "stunned/paused" for a short period of time.