May 2, 2016 Replies: 11 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! Attachments maze.jar maze.jar 308.9 KB · Views: 718 maze.zip maze.zip 1.6 KB · Views: 752 Last edited: Jan 2, 2018 Click to expand...
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!
aeric Expert Licensed User Longtime User May 2, 2016 #2 if the blue square at top left corner is the start point, where is the end point?
ilan Expert Licensed User Longtime User May 2, 2016 #3 aeric said: if the blue square at top left corner is the start point, where is the end point? Click to expand... 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
aeric said: if the blue square at top left corner is the start point, where is the end point? Click to expand... 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 Dec 31, 2017 #5 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.
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 Dec 31, 2017 #6 A game I made few years ago: You can also go inside the maze (pic 5)...
ilan Expert Licensed User Longtime User Dec 31, 2017 #7 derez said: A game I made few years ago: View attachment 63304 View attachment 63305 View attachment 63306 View attachment 63307 View attachment 63308 You can also go inside the maze (pic 5)... Click to expand... is this a 3d option in pic 5?
derez said: A game I made few years ago: View attachment 63304 View attachment 63305 View attachment 63306 View attachment 63307 View attachment 63308 You can also go inside the maze (pic 5)... Click to expand... is this a 3d option in pic 5?
derez Expert Licensed User Longtime User Dec 31, 2017 #8 ilan said: is this a 3d option in pic 5? Click to expand... 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 56.2 KB · Views: 791 7.png 276.3 KB · Views: 781
ilan said: is this a 3d option in pic 5? Click to expand... 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...
ilan Expert Licensed User Longtime User Dec 31, 2017 #9 derez said: 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... Click to expand... looks very interesting derez. very nice!
derez said: 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... Click to expand... looks very interesting derez. very nice!
derez Expert Licensed User Longtime User Dec 31, 2017 #10 The solution (pic 2) is found using my Astar algorithm https://www.b4x.com/android/forum/threads/a-astar-library-b4j-also.48825/.
The solution (pic 2) is found using my Astar algorithm https://www.b4x.com/android/forum/threads/a-astar-library-b4j-also.48825/.
ilan Expert Licensed User Longtime User Jan 2, 2018 #11 Eme Fibonacci said: 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. Click to expand... source available in post #1. this is my first free "B4X Share" in 2018!
Eme Fibonacci said: 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. Click to expand... source available in post #1. this is my first free "B4X Share" in 2018!
Eme Fibonacci Well-Known Member Licensed User Longtime User Jan 2, 2018 #12 ilan said: source available in post #1. this is my first free "B4X Share" in 2018! Click to expand... Thank you, I made one too, I will compare the results.
ilan said: source available in post #1. this is my first free "B4X Share" in 2018! Click to expand... Thank you, I made one too, I will compare the results.