Procedural map generation
Posted: Tue Dec 13, 2022 2:57 pm
Hello, im making a rougelike right now and although I have just made premade maps in the past and cycled through randomly in the past this time around I want to add random generation, the map is supposed to be a maze that will have a couple values, 1(wall),0 (floor), 2 (exit), 3(item), 4(jump scare). I want it so that each time the player finishs a level a map is made with these values. Does anyone know of any libraries or tutorials that could help me out? Any help is appreciated
Demo of what the map/tilemap should end up looking like after generation minus 3 and 4(the values)
Demo of what the map/tilemap should end up looking like after generation minus 3 and 4(the values)
Code: Select all
tilemap = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1},
{1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1},
{1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1},
{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1},
{1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1},
{1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1},
{1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1},
{1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1},
{1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}