This is the basis of the lander game but to turn it into something more fun we are going to need quite a lot more VB code.

In particular we need a fire button and something to represent the ground.

Add a button to the form. Change the button's Text to "Fire Rocket".

If you want to make your rocket look more interesting then you can also create another picture of it with its engines firing. This can be loaded into the image control whenever the fire button is clicked.

You need to add this to the Project resources file, just as you did for the first image of the lander. This second image isn't displayed in the PictureBox - it is waiting ready for us to use it.

Now we have all of the objects in place on the form, all that remains is to define the event routines to make it work.

First you need to define two variables in the declarations section. To do this simply use the Code window and enter just below Public Class Form1:

Dim velocity As IntegerDim fuel As Integer = 100.

What all this means will be discussed in full in later chapters. Next go to the Timer1 object's event handling routine and enter:

That's all there is to it. Now when you run the program you can try to land your craft. It isn't difficult and there are lots of extras you could add to the game, such as a read out of fuel, side thrusters etc. We will return to this simple game later on to add all of these.

To access the complete project including the graphics once you have registered, click on CodeBin.