Wednesday, October 21, 2009

Catch Game Program

This program would allow you to make a simple game, in this manner this is a catch game.
This game will drop a smiley gif that will catched by a car. The only object that you can control is the car by pressing left and right keys...
The Code for controlling the car is as follows...


Select Case e.KeyCode
Case Keys.Right
If car.Left <= (Me.Width - car.Width) - 12 Then
car.Left += 10
End If
Case Keys.Left
If car.Left >= 0 Then
car.Left -= 10
End If
End Select


This code will be paste on the keydown event of the form.
to show the sample follow this link...
http://www.missupload.com/u9hnq05g8j77/ProExer4.exe.html

No comments:

Post a Comment