Step 8: Run Your Program and Try Other Features
Your program is finished and ready to run. You can run your program and test it. To learn more, try changing the colors and sounds.
For a video version of this topic, see Tutorial 2: Create a Maze in Visual Basic - Video 5 or Tutorial 2: Create a Maze in C# - Video 5.
To run your program
Save your program, and then start it.
Be sure your mouse pointer is positioned at the beginning of the maze.
Move your mouse pointer through the maze. Touch a wall, and be sure a sound plays and the mouse pointer is sent back to the start.
Move your mouse pointer outside the maze. Then, move the mouse pointer back into the panel, and verify that the mouse pointer is sent back to the start.
When testing, you need to be sure that everything in the program works. You want to test to be sure that the Finish label MouseEnter event handler plays the Tada sound, opens a congratulatory message box, and closes the game. To avoid going through the entire maze, you can temporarily turn off the panel's MouseEnter event handler. That way, you can move your mouse pointer outside of the maze and position it on the Finish label without being sent back to the starting point.
Select the panel, and then go to the event table in the Properties window. Scroll down to the MouseEnter event and select the event name.
Press DELETE to delete the event handler name, and then press ENTER. The IDE automatically disconnects the event handler from the panel. The walls are still connected, but now you can move your mouse outside of the maze to get to the Finish label at the bottom.
Save and run your program, and be sure the Finish label plays the sound, shows the message box, and closes the game. After you're sure it works, enable the panel's MouseEnter event handler by selecting it, going to the event table in the Properties window, scrolling down to the MouseEnter line, and selecting wall_MouseEnter from the drop-down list.
To try other features
Replace the sounds in the game with sounds you like better.
Set it up so that the game only plays a sound when the mouse pointer hits a wall, but doesn't play a sound when the program starts.
Instead of closing the program when the player wins, have the pointer move back to the starting point.
Change some of the wall colors and make the game play different sounds with different wall colors.