Program 3
Description: Implement a moonlander game. Use fractal
subdivision as discussed in class to
automatically generate the terrain. The ship appears at the top of
the screen, and the user's job is to
safely land the ship on a landing area, which should be randomly
placed within the terrain below.
Gravity affects the ship, so it will begin to fall unless thrust is
applied in the opposite direction. For this
game, the ship should not rotate, but the user should be able to move
the ship upwards by applying
thrust in the right and left directions respectively. The
ship should be affected by drag [due to air resistance] which serves
to decrease velocity in the direction
of travel.
If the ship does not land in the landing area, or does not slow to
within a certain threshold speed, then it
crashes. The user should be allowed to play again. Display the
current speed [magnitude of the velocity]
somewhere on the screen, along with maximum allowable landing
speed.
The viewing area should be cylindrical, meaning that the left side
wraps to the right (and vice versa), but
not top to bottom.
A sample solution will be available in ~cs431/Program3. Please look
to this solution to resolve any
ambiguities which exist in the text above.
What to turn in: You should turn in the source code for your
java applet, and it should be named
'Program3.html' and 'Program3.java'. Other .java files can be turned in as
well, but your main program
should be in 'Program3.java'. We will compile and run your applet using javac
and appletviewer so
there is no need to turn in any .class files. Make sure your program
compiles before you turn it in--we
cannot grade something that does not compile.
Note: Don't just rename your program and turn it in--it won't work. Java must
have the filename be the
same as the class name of the class in the file. It's best to develop your
program using the name
'Program3.java'.
How to turn it in:
Use the following command:
handin cs431 program2 [files]
shirley at cs.utah.edu
wmartin at cs.utah.edu
rgraham at cs.utah.edu