I have three variables, two of them randomly generate the position (x and y) and the other generates the number of times the code will repeat (number of rooms)
If a room is born diagonally, and there is no room next to it, it is impossible to access it, so when creating a room, an object is created on: the left, right, top, and bottom of the room, if the room does not collide with this block, it means that it is impossible to access it normally, and the game generates a room again
there is another object in each possible position that can be generated a room, if the room collides with this object, it gains a room number (which is also saved in an array)
with the array, I know the exits possibilities, and I create walls that way
I also have a filter that prevents two rooms from being born in the same position, to avoid an bug that causes only 2 rooms to be spawn