Assignment 4
SuperZapem!
A Modestly Enhanced Zapem

In this assignment, you enhance your Zap'em! game. This programming assignment, beyond using features & classes that you have used before, gives you Java programming experience with the Java Swing GUI & the Graphics fillArc & fillPolygon methods.

As always (starting from the previous assignment), Javadoc your public methods & public classes.

Specification

SuperZapem! Game Enhancements Description

Enhance your Zap'em! game in the following ways:

  1. The game has a level of difficulty, initially set to 4. This level is displayed in a JTextField that has a suitable label to its left.
  2. Add 2 new Critter subclasses. At least 1 of them must use the Graphics fillArc method in its draw method, and at least 1 of them must use the Graphics fillPolygon method in its draw method. Please feel free to be as imaginative as you like with these new Critters. You also do not have to limit yourself to 2 new Critter subclasses.
  3. In the enhannced version, the game duration is updated every time the Timer generates an ActionEvent.
  4. If a completed game duration is greater than 10 seconds,
    • Increase the Timer pause time by 20 milliseconds. It initially is set to 200 milliseconds.
    • Decrease the game level by 1.
    • Issue a message via a JOptionPane method that displays the new game level & supplies a suitable message to the player. (For fun, I issue an ERROR message.)
    If a completed game duration is NOT greater than 10 seconds,
    • Decrease the Timer pause time by 20 milliseconds.
    • Increase the game level by 1.
    • Issue a message via a JOptionPane method that displays the new game level & supplies a suitable message to the player.
  5. If you have not done so, move your MouseListener code from mouseClicked to mousePressed; it improves the responsiveness of the game, as was observed in class.

Below are 2 screenshots, Fig. 1 is of a game that is in progress; Fig. 2 displays my message to a hapless player that just completed a game in more than 10 seconds.

JFrame display of SuperZapem game

Fig. 1: JFrame display of SuperZapen game that is in progress.


JOptionPane display a message issued to player who just completed Zapem game in > 10 seconds.

Fig. 2: JOptionPane display a message issued to player who just completed Zapem game in > 10 seconds.


Feel free to add helper methods to your classes that enhance their readability.

We will test your application by playing your game.

We expect your code to be on GitHub. Do not use turnin.

Possible Application Enhancements

Design Notes

Rubric

ValueAspect
1Compiles & executes.
5All enhancements work as specified.
1Javadoc is complete, generated, & adheres to Javadoc guidelines.
3Style
10Total

For style, we want:


 cappello@cs.ucsb.edu © Copyright 2014 Peter Cappello                                           2014.05.02