Head First C#: Lab #3: Invaders
The contest to submit working code for this lab is now closed. Congratulations to Ray Folwell from Derby, UK! You can still send in creative alternatives, though—see these details.
The Grandfather of Video Games
In this lab youíll pay homage to one of the most popular, revered and replicated icons in video game history, a game that needs no further introduction. Itís time to build Invaders.
Your mission: defend the planet against wave after wave of invaders
- The invaders attack in waves, where each wave is a tight formation of 30 individual invaders. As the player destroys invaders, the score goes up. The bottom invaders are shaped like stars and worth 10 points. The spaceships are worth 20, the saucers are worth 30, the bugs are worth 40, and the satellites are worth 50. The player starts with three lives. If he loses all three lives or the invaders reach the bottom of the screen, the gameís over.
- The invaders attack in waves of 30. The first wave moves slowly and fires a few shots at a time. The next wave moves faster, and fires more shots more frequently. If all 30 invaders in a wave are destroyed, the next wave attacks.
- As the player destroys the invaders, the score goes up. Itís displayed in the upper left-hand corner.
- The player starts out with three ships. The first ship is in play, and the other two are kept in reserve. His spare ships are shown in the upper right-hand corner.
- The multicolored stars in the background twinkle on and off, but donít affect gameplay at all.
- The invaders return fire. If one of the shots hits the ship, the player loses a life. Once all lives are gone, or if the invaders reach the bottom of the screen, the game ends and a big ďGAME OVERĒ is displayed in the middle of the screen. The player moves the ship left and right, and fires shots at the invaders. If a shot hits an invader, the invader is destroyed and the playerís score goes up.