require
use microsoft visual C++ to write a program about a game, very easy, I have done many of the program, could help to fix the program to right, can run it successfullyuse microsoft visual C++ to write a program about a game, very easy, I have done many of the program, could help to fix the program who I wrote to right, can run it successfully. when you finish it sent this answer to this chaojialv@yahoo.com.cn email
LaboratoryExercise 7
Purpose:
The purpose of this lab is to gain experience with sprites and some basic game programming
techniques.
The Assignment:
You will work in groups to find the solutions to the proposed problems. At the end of the lab session
your group should submit the code your write today via Drexel Learn. Only one submission per
group is required. Make sure you designate a person in your group who will be responsible for
submitting your lab assignment today.
The Lunar Lander Game
Today you and your team will create a basic game called the Lunar Lander. To create this game you
will need to download the following images (provided with this lab) to use as background and sprites:
lunarSurface.bmp, lunarLander.bmp, and landingPad.bmp.
Create a new project to write and test you program. Copy the three images into the second innermost
project folder.
Here are the specifications of the program you have to write today: The program initially displays a
spacecraft (lunarLander.bmp) on the moon’s surface (lunarSurface.bmp). The spacecraft
initially appears on one side of the screen and a landing pad (landingPad.bmp) appears on the
opposite side. For example:
The user should try to fly the spacecraft and guide it so that it lands on the landing pad. If the
spacecraft successfully lands on the landing pad, display a message congratulating the user.
The user can use the following keys to move the spacecraft:
Spacebar: when the user presses the spacebar, the spacecraft should slowly lift off the surface,
and continue to lift as long as the spacebar is held down. When the user releases the spacebar, the
spacecraft should slowly descend toward the sruface, and stop when it gets there.
Left and Right arrow keys: the user can press the left or right arrow keys along with the
spacebar to guide the spacecraft slowly to the left or right. If the spacebar is not pressed, the left
and right arrow keys should have no effect.
Before you start writing the code for this program, you and your team mates should try to create a
brief design for the solution. Think about how to split the program in smaller components (functions)
that take care of specific tasks. You have a quite a few examples in the textbook (Chapter 7), take a
look at them and follow that approach.
Here is a bried outline of what your program should be doing in general, use this as a starting point:
// Declare all global constants needed in the program
// Perform the setup commands
// Declare any other local constants and variables needed
// Start the game loop
// Check what key(s) the user has pressed and take the proper action
// Check and see if the lunar lander has collided with the landing pad
// Refresh the screen
// Perform the cleanup routines: delete images and sprite before
// ending the program
Submitting your lab work
For today’s lab your group must submit your source code that is the .cpp file that contains the code
for your game. Please make sure you upload and submit your source code via Drexel Learn by the end
of the lab session.