Help with winForms recursive backtracking maze generation

Joined
Jan 15, 2023
Messages
1
Reaction score
0
Hi,

I'm trying to create a game where a character spawns outside the maze, makes his way into the middle of the maze to fight and after fighting, tries to find an exit. I know how the algorithm works but I just don't seem to understand where to start.
I'm rather new to coding and didn't understand what many of the online tutorials were doing.
Please help. Thanks.

Edit:
I've tried starting off by initialising a grid, but how would I navigate through the maze to create a path using the array?
 
Joined
Sep 21, 2022
Messages
122
Reaction score
15
suggestion: Use a two dimensional array of integers.

-2 means: Not part of the maze.
-1 means: Not visited by the maze algorithm yet.
>=0 : A 4-bit number, north east south west, 0=open 1=closed.

Use the suggestion until a better idea comes along, it will. The first solution is rarely the best.

Before writing the maze algorithm, write a subroutine to print a maze, test it with a small hand-made array.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top