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
121
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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top