Download the Java source code for the John Donohue's Lunar Lander Java applet from the following list of links:
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.
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.