Sorry for double posting.
Here is three more examples of mazes.
One with octagons, one with several layers and one with 10 different maze generation algorithms.
Maze Thread
Re: Maze Thread
- Attachments
-
- OctagonMaze.love
- Welcome to the OCTAGON.
- (1.97 KiB) Downloaded 313 times
-
- mutliLayer.love
- Several layers
- (2.53 KiB) Downloaded 298 times
-
- JustMazes.love
- 10 maze algorithms
- (9.25 KiB) Downloaded 342 times
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Maze Thread
Yay for the multilayer one! That looks pretty awesome
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Re: Maze Thread
You guys are creating some very nice wall paper but I was wondering if you had any scripts that would permit specifying a starting position (like lower left corner) and an objective position (like upper right corner or center screen) and maze grid size - something used for game scripts?
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Maze Thread
Yeah I was thinking the same thing
Re: Maze Thread
You could just slightly modify the recursive backtracker to have a higher chance of moving towards the finish point and have it start at the start point.Ref wrote:You guys are creating some very nice wall paper but I was wondering if you had any scripts that would permit specifying a starting position (like lower left corner) and an objective position (like upper right corner or center screen) and maze grid size - something used for game scripts?
Or you could make your own recursive backtracker, it really isn't that hard.
Code: Select all
--Backtracker
function love.load()
path={math.random(1,width),math.random(1,height)}
map = newMap()
end
function love.update(dt)
if #path > 0 then
local x,y = path[#path][1],path[#path][2]
local t = {}
-- Add all the positions it CAN walk to from x and y
if #t > 0 then -- It can walk somewhere
local c = t[math.random(1,#t)]
merge(x,y,c.x,c.y) -- Merge the points
path[#path+1] = {c.x,c.y} -- Add the new point to the path
else
path[#path] = nil -- Remove the part in the path that could no walk anywhere
end
else
print('DONE')
end
end
function love.draw()
love.graphics.draw( -- draw the map
end
and as I have not seen anyone store maps the way I do here is a quick explanation:
using a texture atlas / tile sheet a table storing the different quads from 1 to 15. ( using 0 most of the time )
left,up,right,down = 1,2,4,8 -- power of two's
the first quad (quad[1])
is just quad[left] and therefore only goes left
and likewise quad[left+up+down] goes left, up and down
they can therefore be quickly added to a map where 0 is empty by doing
map[y][x] = map[y][x] + (left, up, right or down)
which is used instead of map[y][x].(left, up, right or down) = true
I use this method because:
1) its just the quad index stored in the map.
2) it take up less ram since less tables are needed.
the drawbacks are:
1) may be harder to get a hang on at first.
thats a quick summary of it, if you want a more complete explanation please tell me so.
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
Re: Maze Thread
davisdude used Max Revive!
I figured I would try out making a maze to test my programming abilities.
You can check out my progress here.
It generates a 80*60 tile maze currently, but you can play around with the configurations if you want to.
It takes around 3 minutes to fully complete.
Take a peek at the source code if you want. I tried to make it pretty readable, but I have a nasty habit of not commenting my code enough.
I figured I would try out making a maze to test my programming abilities.
You can check out my progress here.
It generates a 80*60 tile maze currently, but you can play around with the configurations if you want to.
It takes around 3 minutes to fully complete.
Take a peek at the source code if you want. I tried to make it pretty readable, but I have a nasty habit of not commenting my code enough.
- Attachments
-
- Maze.love
- (7.43 KiB) Downloaded 280 times
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Maze Thread
Finally, a maze with a start and a finish
Re: Maze Thread
Confession: I actually added the end with MS Paint.
I tried a 200 * 150 grid. Here are the results:
Green is the start, yellow is the end. Working on making it automatically choose an end.
I tried a 200 * 150 grid. Here are the results:
Green is the start, yellow is the end. Working on making it automatically choose an end.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Maze Thread
Shame on you. Not for adding the end manually, but for using ms (paint)!
I would NOT want to have to find the end in that last maze... that's crazy
I would NOT want to have to find the end in that last maze... that's crazy
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Maze Thread
The first maze was easy, you should've chosen a better end
Who is online
Users browsing this forum: Google [Bot] and 9 guests