Wyo VB Ch7Proj1
The Maze Game

Write a program that allows the user to move a circle shape object through a maze. The user must be able to drag the shape object with the mouse or move it with the arrow keys on the keyboard. Identify an area as the end of the maze and make sure that the shape object begins at the designated beginning area. If the user's shape object touches a boundary of the maze or a wall within the maze, display a message box that tells the user that he lost the maze game and then end the game. If the user successfully navigates the shape object to the end of the maze, display a message box indicating that he "won" along with the number of seconds that it took him to complete the maze.

The program must include at least one road block consisting of a small circle placed in a random place (using Randomize and Rnd) on the form with the Circle method. If the user's shape object collides with the roadblock, display the message box that indicates the user lost the maze game. The road block must be placed at a random place on the form but make sure that the roadblock is small enough that the user can still get around the road block.

Include a menu on the form with this exact structure:

File Color  
Pause Maze >  
Exit   Background
    Foreground
  Circle >  
    Center
    Border


(The Background and Foreground commands are a submenu from the Maze menu command and the Center and Border commands are on a submenu from the Circle menu command.)

A shortcut menu that appears on a right-click should have this exact structure:

Pause
Exit

The form should use User-defined scale coordinates with a ScaleWidth property of 100 and ScaleHeight property of 100. The Color > Maze > Background and Color > Menu > Foreground menu commands should allow the user to change the form's background & foreground colors, respectively. The Color > Circle > Center and Color > Circle > Border menu commands should allow the user to change the shape object's fill and border colors, respectively. When the user selects one of the Color menu commands, a frame object with 3 horizontal scroll bars must become visible. The user can select a color for the desired object using horizontal scroll bars for red, green, and blue. The RGB function must be used appropriately to "mix" these user-selected color. After "mixing" a color, the user will be able to click a Close command button on the frame to make the frame and scroll bars disappear. The Pause menu command as well as a Pause menu command accessible on a right-clicked shortcut menu should allow the user to pause the game while he is completing the maze. A checkmark must appear next to both Pause menu commands if the user has paused the program. When the user chooses the Pause command a second time, continue timing the user and uncheck the commands. Your program must use a general procedure named DrawMaze that draws the walls of the maze (using the form's Line method).

Your code should be documented well and easy to read. You may use module-level variables only where absolutely necessary (e.g. start time, roadblock coordinates). You must draw your maze on neatly labelled graph paper BEFORE your begin to write the code.

Preconditions:

Your program must follow the Coding Standards. Save the form and project files as "Ch7Proj1 " with the proper file extensions (.frm & .vbp, respectively) in a newly created folder named Ch7Proj1 within your Ch7 network folder.

Staple your printouts in the following order:

  1. VB code
  2. Interface Design Planning Sketch drawn on graph paper labelled to show the exact placement of your maze's lines, the beginning area, and the end of the maze. The frame object and the menu do not have to be drawn.
  3. Objects & Properties Planning Form
  4. Event Procedures Planning Form

    (No test plan is necessary for this assignment.)