Maze1

Create a project that allows the user to watch a mouse find its way through a maze.

Watch this video to learn how to click and download the Maze.zip file linked here and then to use that project as a starting point for this project.

Before you write the code, sketch the interface of the maze on graph paper as illustrated by this model. Your program must include a maze with at least 10 horizontal and vertical lines using the DrawLine method. Do not include any diagonal or curved lines. Make your maze design simple enough for small children to follow like this example but be sure that it has at least 10 inner walls (not counting the four outer boundaries). Limit your maze to the default 300 pixel width and height of the form. Try not to design a maze that has "dead zones" where the player can't go like this example.

Label the endpoints of each line with x, y coordinates. Label each line with a number (1, 2, 3, etc.) starting with the horizontal lines and then the vertical lines. Also label each pathway with a letter (A, B, C, etc.) in the order that the player will follow the pathways from the start to the end of the maze.

Use a picture box with a solid background color or a suitable graphic as the mouse and use another picture box and graphic to indicate the end of the maze (e.g. a piece of cheese). When the user clicks the form, For loops must be used to automatically animate the player through the maze. When the user single-clicks the form, the player's picture box must relocate to the beginning of the maze. When the user right-clicks the mouse, the program must exit. Here is an example of how the program should execute although you can ignore the drop-down menu that is no longer required.

You must animate your picture box through the maze using For loops like the following examples. Notice that each example corresponds with one of the directions left, right, up, and down. Each pathway (labelled A, B, C, etc.) will correspond with a For loop.

For J = 1 To 5                ' to the left
   picPlayer.Left -= 10
   Me.Refresh()
   Threading.Thread.Sleep(50)
Next

For J = 1 To 5                ' to the right
   picPlayer.Left += 10
   Me.Refresh()
   Threading.Thread.Sleep(50)
Next

For J = 1 To 5                ' up the screen
   picPlayer.Top -= 10
   Me.Refresh()
   Threading.Thread.Sleep(50)
Next

For J = 1 To 5                ' down the screen
   picPlayer.Top += 10
   Me.Refresh()
   Threading.Thread.Sleep(50)
Next


It would be helpful to watch this video of Animation with Loops Worksheet #1 before working on this project.

Your program must follow the Visual Basic Coding Standards. Review the Program Check Off list.

Upload the following files to the specified location. Your first name and last initial should replace "JohnD" in the filenames.

  • a screen capture graphic named Maze1JohnD.png.
  • a pdf of your source code named Maze1JohnD.pdf.
  • a screencast video named Maze1JohnD.mp4. Do not record audio with this screencast. Be sure that the video shows the results of resetting the player to the beginning of the maze as well as exiting the application.
  • the interface sketch of your maze created with the graph paper template in Notability or a carefully cropped picture or scan of a your paper interface sketch. This file must be named Maze1SketchJohnD.png or Maze1SketchJohnD.pdf

You must turn in your graph paper interface sketch to our class inbox clearly labelled with your full name and class period.

Past Projects
2012-13:
Aidan S, Amber S, Bryanna G, Cassidy K, Craig S, Danielle S, Ellie W, Emily O, Emily S, Jacob F, Jasmyne L, Jocelyn D, Katie K, Lakiyah B, Laura H, Laura W, Lauren D, Micah M, Mikalya A, Skye R, Sonia S, Olivia L