lib/proceduralDunGen.h
/// Takes a 2d int array and generates a random dungeon in it.
Takes a 2d int array and generates a random dungeon in it.
Takes a 2d int array and generates a random dungeon in it .
void generate(int **map, const int rows, const int cols)
{
    for (int i = 0; i < rows; i++)
        for(int j = 0; j < cols; j++)
            map[i][j] = WALL;
    fillRectangle(map, rows/2, cols/2, rand()%12 + MINROOMSIZE, rand()%10 + MINROOMSIZE, FLOOR);
    for(int i = 0; i < AMOUNTOFROOMS; i++) buildFeature(map, rows, cols);
}
void generate ( int * * map , const int rows , const int cols ) { for ( int i = 0 ; i < rows ; i ++ ) for ( int j = 0 ; j < cols ; j ++ ) map [ i ] [ j ] = WALL ; fillRectangle ( map , rows / 2 , cols / 2 , rand ( ) % 12 + MINROOMSIZE , rand ( ) % 10 + MINROOMSIZE , FLOOR ) ; for ( int i = 0 ; i < AMOUNTOFROOMS ; i ++ ) buildFeature ( map , rows , cols ) ; }
Takes a 2d int array and generates a random dungeon in it.
Takes a 2d int array and generates a random dungeon in it .
// Fills array with wall tiles //start with a random rectangle somewhat in the middle // Generate rooms around it