Link to
Colorado State University Home Page

Assignment 6: Modifying and Adding an Applet to your Web Page

Description

You will download a public-domain Java applet, modify it, compile it, and install it on your home web page. To accomplish this, use the following procedure.

Download the Java source code for the John Donohue's Lunar Lander Java applet from the following list of links:

Download them from the links above, rather than from Donohue's web site, because I made a few changes to a couple of the files to make this a little easier for you.

You must figure out where in your public_html directory tree you want to put it. Compile it and run it using at least the following html code, which was copied from Donohue's page, placed in your index.html file:

<APPLET CODE="JDLunarLander.class" ARCHIVE="JDLunarLander.jar"
CODEBASE="mylunardirectory" WIDTH=550 HEIGHT=250></APPLET>
<p>
Use the space bar for the landing thruster and the left/right
arrow keys to spin the lander. Try to land on the blue landing pads. Land
succesfully and you get half your fuel back. Change the gravity to make
it harder.
Be sure you have set the protection to read and execute for everyone on all of the compiled class files and the au files. Also, if you put this code in a subdirectory in your public_html directory, that subdirectory must be readable and executable by everyone and specified in place of the mylunardirectory above.

Now you must collect all the class and au files into a jar file and make it readable and executable:

jar cvf JDLunarLander.jar *.class *.au
chmod a+rx JDLunarLander.jar

Now that it is running (I hope), have some fun reading and editting the code. Find the place in the code where the points are defined that are used to draw the outline of the flying lander. Modify this list of points to create your own lander shape. Compile again and run it. Be sure your changed lander code is part of the compiled applet that you run from your home page.

What it Will Look Like on your Web Page

Use the space bar for the landing thruster and the left/right arrow keys to spin the lander. Try to land on the blue landing pads. Land succesfully and you get half your fuel back. Change the gravity to make it harder.

What to Turn In at the Start of Class

Type a page or two in latex format describing,
  1. steps you took to download and compile the original java code,
  2. modfications you made to the ship,
  3. what the hardest part of this assignment was.