A Complex Program

[ Programs ]

wpe1A.gif (5309 bytes)

    Here is a more complicated program than the "Simple Program", that only displayed a message box based on the users input.   This program is an Asteroids game.  To try it out click here.  This program is a good example of how you can use multiple forms.  It has a total of four different forms, one for the main game, one for the high scores, one for the help screen, and one to store the images.  Before reading through the rest of this page, you should try the game, so that you know what it does.

The Main Form

The High Score Form

The Help Form

The Images Form

Try it out


The Main Form

wpe24.gif (4669 bytes)

    The main form consists of a timer, to update the game every few milliseconds, a button to display the help form, a button to display the high scores, a button to start and stop the game, a button to exit the game, a few labels to display the score, level, and number of lives, and quite a few picture boxes to display the ship, and the asteroids.

 


The High Score Form

wpe25.gif (6938 bytes)

    The High Scores form is displayed when the game is over, and when the user clicks on the High Score button.  It just displays the high scores stored in the file HighScor.dat.  The scores are loaded when the program starts, and saved when the program shuts down.

 


The Help Form

wpe27.gif (8465 bytes)

    The help form just displays a few simple hints on how to play the game.

 

 


The Images Form

wpe26.gif (5144 bytes)