Simulated 3D Maze Game in VB

Ok, first off this is not actually VB.NET. My computer died in 2011 and I was forced to use my ancient 900Mhz P3 computer and wrote things in Java and VB6 for a while, since Visual Studio 2008 said it wouldn't run on it. This program is one of them. It's a simulated 3D maze game with an editor to make new levels. I tortured myself for days plotting on graph paper the points for the walls. I had to use rectangles and triangles to make the walls look angled. Filling the rectangles was easy using bf (box fill) instead of just f (fill). Filing the triangles was trickier, having to draw a series of lines to fill them. The result came out well though.



Above is a screenshot of the beginning using a pre-made maze level. The com changes direction and there is an unfilled map with a dot to show your location. If you press M you get a 3 second view of the entire maze map as shown below.



I included a level editor so people can make their own levels. It is a simple point and click interface using some very skinny command buttons. When you click they change from white to black, or back again, to indicate the walls you want. The screenshot below shows the editor with a few walls clicked.



The zip file has the executable and the complete source code for the program. Please feel free to adapt the code to VB.NET, if you dare. The simulated 3D is pretty tough. I had the concept of numbering the "rooms" you can see from your vantage point as 1, 2, 3 & 4 with 1 being the closest. The room walls are encoded as binary to take less space and also make navigating easier. I just use an AND operation to determine if you can go in the direction you want to.

Have fun with this and I hope it's inspirational. If you comment that you want them, I will go back and add more comments to the code files to make them more understandable.

I hope this holds you over until I finish and upload a GENUINE 3D maze game using XAML/C# that is almost done.

Garry


Similar Articles