|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.
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:
Canvas) in which to display the "lander."
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.
public void paint(Graphics g)
Scrollbar), to choose how much fuel to burn
TextFieldthat 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.
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
BorderLayout is your friend, but you may also want
FlowLayout for some of your
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
Your program is due before midnight, Thursday, November 6. Zip up all
.class, and any extra files produced
by BlueJ, such as
.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.
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: