Introducing the Lunar Lander

The sample game for this chapter re-creates one of the all-time classic arcade games, the Lunar Lander game. In this game, the user tries to pilot a spacecraft near the surface of the moon. The pilot must land his or her craft on a small platform with limited fuel. Figure 7.1 demonstrates the Lunar Lander game in action.

Figure 7.1. The landing craft starts with a random speed and direction–and limited fuel.


The player controls the ship with thrusters controlled by the arrow keys. However, each blast of a thruster burns precious fuel. If the player is going too fast when he or she touches the landing pad, it is a crash, and he or she loses a ship. A safe landing is rewarded with more fuel and a new, randomly chosen landing assignment. The game continues until the user loses three ships.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.179.220