| CIT 591 Assignment 6: Lunar Lander, Revisited Fall 2003, David Matuszek |
Purposes of this assignment:
General idea of the assignment:
This assignment is to write an Applet that lets users play your Lunar Lander game. As before, the game progresses in a series of turns (that is, it is not animated). You can use as much or as little of your previous code as you like. In fact, if you prefer, you can take my example code (two files: LunarLander.java and LunarLanderGame.java) and use those as a starting point.
Details:
This is a solo assignment, to make sure that everyone gets some experience doing GUI programming. After this, we will (probably) return to pair programming.
You should provide a GUI with at least the following things in it:
Panel (or Canvas)
in which to display the "lander."
public void paint(Graphics g)
method to draw the lander, first near the top of the window, then lower
in the window as the lander descends. A background would also be nice,
but not required. Scrollbar), to choose how much fuel
to burnTextField that displays the number chosen in the scrollbar.
Button, to burn the fuel (and proceed
to the next "turn").
repaint() to
update the drawing of your lander.Button. This should be disabled
(grayed out) when a game is in progress.TextFields, with Labels, showing your current
altitude, velocity, and fuel remaining.
TextFields should be disabled, to prevent user
entry.You will find that creating a reasonable-looking GUI is perhaps the most challenging
part of the assignment. Remember: Use additional Panels to help
arrange space. BorderLayout is your friend, but you may also want
to use GridLayout or FlowLayout for some of your Panels.
Remember also that the AWT doesn't give you a lot of control, so you will probably
have to settle for a GUI that looks "good enough" rather than really
classy.
Due date:
Your program is due before midnight, Thursday, November 6. Zip up all
files (.java, .class, and any extra files produced
by BlueJ, such as .pkg and .pkh files), and submit
via Blackboard. Note that this time you also
need to include the .html file; this can be the one produced by
BlueJ, or one that you have created.
Special note:
If you did not do well on the Traffic Jam assignment, here is a chance to at least partially make up for it. In addition to writing the above assignment as an Applet, also write it as an application. You can use the same GUI as in your Applet, but you should also have a way to quit the program--either with a "Quit" button, or by clicking the window's close box, or (preferably) both.
Here are the special grading considerations for this make-up assignment: