Yes! I did get it to work, thank you for the help. Everytime the player goes through a door, the game randomizes a number that is responsible for choosing a room, which is then created (as a tilemap) at the correct distance. There are different events depending on which type of door you touch (left, right, up or down) and some rooms are restricted to appearing only from the sides, the ceiling, etc. Anyway, it did end up being way more simple than i thought, so again, thank you for the help.

Here is an example. I get rid of lot's of things like walls and other stuffs because I was using it in another project.You can start from here and then add walls which is basically checking the edges. You can use the array I was using to see where is ground and where is not ( value 0) so you know where is the edge. And make sure to enlarge the passages enough so your walls don't block it.https://www.dropbox.com/s/388lo3tgqa4fw ... .capx?dl=0

Here is an example. I get rid of lot's of things like walls and other stuffs because I was using it in another project.You can start from here and then add walls which is basically checking the edges. You can use the array I was using to see where is ground and where is not ( value 0) so you know where is the edge. And make sure to enlarge the passages enough so your walls don't block it.https://www.dropbox.com/s/388lo3tgqa4fw ... .capx?dl=0

For some reason i couldn't open your project. It is saying i need to upgrade my version of C2 to r237. And as far as i know, the newest version is r233.

The way I did it was to generate random rooms of different sizes using the default grid. It keeps checking until it can place the room somewhere suitable.

Check out http://plinkie.neocities.org/ and keep refreshing/reloading the game. It generates 3 little rooms each time in close quarters at random spots, with the 'boss' being inside a room and the 'player' being outside of the room spawning at a random location.

I'm going to expand this to generate tinier rooms and then go on to spawn other enemies at random inside the rooms using enemy counts. Then onto the actual gameplay I guess...