Due date: 4/18 @ 9:50 pm
For this final homework, you can show how much you have learned: design by composition of functions, design by structural recursion, design by generative recursion, organization via
local
, design of abstractions, use of abstractions, the addition of accumulators. The homework counts for 5% of the total course grade (aka the instructor's whim). As you work on the project, imagine that we hand over your software to the graders together with a modification of the project description and the task to change your software accordingly. Naturally they expect the software to be designed well, that is, based on what you learned in 211 and they know where you live (or at least your email).
Fighting UFOs:
Imagine you have become a game developer and your manager poses the problem of developing the first version of a War-of-the-Worlds game, freely named after H. G. Wells's science fiction novel. The purpose of the game is to prevent a UFO from landing on our world and from destroying the last available weapon. The screen shot on the right illustrates the successful defense of your world. The UFO descends from the sky. As it does, it randomly drops little bombs. If those bombs, hit the last available weapon platform, dubbed AUP, the player loses. The player also loses if the UFO reaches the ground unharmed. |
The player owns an anti-UFO platform (AUP), which can move left and right on the ground. It reacts to left and right keystrokes only. A first keystroke causes the AUP to move continuously. Additional keystrokes accelerate the AUP, if the player uses the arrow key of the direction in which the AUP is heading; otherwise the AUP decelerates. With the uparrow key (and/or the space bar), the player can also launch anti-UFO missiles from the AUP. These shots go straight up at a constant speed. If any of them hit the UFO, it destroys the UFO.
Hints: Develop the game in stages: