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. Your manager has employed an artist to create a mock-up, which you
can see below.
The UFO (see green flying saucer) descends from the sky at a constant
rate. As it does, it randomly drops charges (flat tan line below UFO). If
any of those bombs hit the last available weapon platform, dubbed AUP, the
platform is destroyed and the player loses. The player also loses if the
UFO reaches the ground unharmed.
The player controls the AUP (red line with straight line pointing up at
bottom), which can move left and right on the ground and shoot straight
up. The AUP moves continuously along the ground. Initially, the AUP
starts at the left most border and moves from left to right. A
'right keystroke causes the AUP to
change directions. An
'up keystroke, the player can also
launch anti-UFO missiles from the AUP. These missiles (vertical yellow
lines) go straight up at a constant speed. If any of them hit the UFO, it
destroys the UFO and the player wins.
Design and implement the game in a step-by-step, bottom-up fashion. We
recommend you first create a UFO that descends. Then add a controllable
AUP. Finally add shots and bombs.
| || |
You may want to challenge yourself with additional tasks, e.g., (1)
accelerate the AUP if the player hits the arrow key of its current
direction; (2) ensure that the UFO and AUP never leave the visible field
(make your own decision of what you want to do); or (3) add sounds to the
game (Mac OS X and Unix should be easy, I don't know about Windows).
Grading: if you don't follow the design recipe all the way, you will
inflict a lot of punishment on yourself, because you will spend a
tremendous amount of time getting the game to work. In addition, the
graders will punish you a lot. You must design your program in "Beginning
Language with List Abbreviations."