Share My Creation Random Maze Generator

hi

i am just playing around with b4j and i created a maze generator lib that creates randomly a full maze (with animation)

the maze is stored with custom types to a list so you can easily move a character in it since you have all walls stored.

you can change the cell size either if you want. this maze lib (class) can be used in b4i,b4a,b4j

it is not finished now but i will upload the jar so you can see how it works.
after the maze is finished it will start again and create a new random maze.

you can create with this class very simple a maze game
(code size < 150 lines!!)

i am using this algorithm https://en.wikipedia.org/wiki/Maze_generation_algorithm#Recursive_backtracker

what do you think?

EDIT (02/01/2018): source code added, have fun! :)

maze.png
 

Attachments

  • maze.jar
    308.9 KB · Views: 358
  • maze.zip
    1.6 KB · Views: 381
Last edited:

ilan

Expert
Licensed User
Longtime User
if the blue square at top left corner is the start point, where is the end point? :)

you can put a flag wherever you want (randomly) and character needs to get to this flag
or use 1 of the other 3 edges as the finish point.

i was thinking more of collecting keys and unlock gates and like this get to the finish point. including adding enemies that hunts you and make nice lights effect
maybe you going with a torch...

this is just the generator but the game concept can be unlimited ;)
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
Hello, could you publish the source code?
I would like to try to implement some things.

If Yes Thank you.
If No Thank you anyway.
 

derez

Expert
Licensed User
Longtime User
A game I made few years ago:
1.png 2.png 3.png 4.png 5.png
You can also go inside the maze (pic 5)...
 

derez

Expert
Licensed User
Longtime User
is this a 3d option in pic 5?
Yes, you can go from top view to 3d and see the path you did, also you see in the 3d view your path marked by "x" (if you look back).
My experience - it is very hard to reach the end in 3d view only...
 

Attachments

  • 6.png
    6.png
    56.2 KB · Views: 305
  • 7.png
    7.png
    276.3 KB · Views: 321

ilan

Expert
Licensed User
Longtime User
Yes, you can go from top view to 3d and see the path you did, also you see in the 3d view your path marked by "x" (if you look back).
My experience - it is very hard to reach the end in 3d view only...

looks very interesting derez. very nice! :)
 
Top