Maze Game

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 85
Reputation: Dell XPS is an unknown quantity at this point 
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Maze Game

 
0
  #1
Nov 24th, 2008
I need in some way to generate maze because I want to create a maze game. If anybody has any idea on how to do this... please help
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: Maze Game

 
0
  #2
Nov 24th, 2008
There are several maze generation algorithms. You can go here to see a few examples.

http://en.wikipedia.org/wiki/Maze_generation_algorithm

http://www.astrolog.org/labyrnth/algrithm.htm
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 85
Reputation: Dell XPS is an unknown quantity at this point 
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Re: Maze Game

 
0
  #3
Nov 27th, 2008
thanks ill check it..
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 85
Reputation: Dell XPS is an unknown quantity at this point 
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Re: Maze Game

 
0
  #4
Nov 27th, 2008
ok but is there any way to generate a maze at form load so that each time the maze is different?

also how would i set the bounds that the user can move so that it does not pass through walls?
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: Maze Game

 
0
  #5
Nov 27th, 2008
First, you need to create a PictureBox. Then, you need to create code to generate a maze in an array. Once the maze is generated, you need to create code to display the maze in the PictureBox based on the information in the array. After you have code to create the maze and display it, you need to add code to the Load event of the form so that the maze is displayed whenever the form is loaded. Lastly, you need to create code to track where the user is, prevent the user from crossing any walls and to display the user on the PictureBox.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 85
Reputation: Dell XPS is an unknown quantity at this point 
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Re: Maze Game

 
0
  #6
Nov 28th, 2008
i know what i have to do the problem is HOW to do it...

i need help with the code...
this is not my homework
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: Maze Game

 
0
  #7
Nov 28th, 2008
To help you in the right direction, for a maze program I made, I had a class called cell. The cell class had the following properties: bottomWall, leftWall, visited, enabled.

The bottomWall and leftWall properties is to track where within the maze the walls are and the visited property was for one of the maze algorithms I was using. I then made a 2D array of the class cell. Each cell within the array represented one 'square' in the maze.

With many maze generation algorithms, the maze starts with all the cells having walls and the maze is generated by "removing" walls.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 85
Reputation: Dell XPS is an unknown quantity at this point 
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Re: Maze Game

 
0
  #8
Nov 30th, 2008
that helpful
BUT
i have no idea how to generate it and remove walls...

could you just help a little with the code?
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: Maze Game

 
0
  #9
Nov 30th, 2008
Go to this site and look at Prims algorithm; while it doesn't make the hardest mazes, it is a simple algorithm to start with: http://www.astrolog.org/labyrnth/algrithm.htm

What you need to do is set up the array of cells I mentioned above. For each cell, in addition to the wall properties, you need to make a property for status (in, out, frontier). When the term carving is mentioned, remove the wall between the cells.

Try setting up the cell class and the array for the maze. Once you have that done, I will help you with the code for the maze generation.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 85
Reputation: Dell XPS is an unknown quantity at this point 
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Re: Maze Game

 
0
  #10
Nov 30th, 2008
how do you create an array with walls????????????????????????????????????

and also you said somethingg about some wall properties which i dont understand
Last edited by Dell XPS; Nov 30th, 2008 at 12:59 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC