Thanks, that'll do for now, anyway. Here is part of the code I'm working on to randomly generate the dungeon:
Code:
void Dungeon_Gen()
{
int i;
int j;
int k;
int l;
int mem_i;
int mem_j;
int mem_k;
int mem_l;
int o;
int p;
//Fill screen with walls
for (i=0;i<80;i++){
for (j=0;j<24;j++){
dungeon[i][j]=1;
}
}
//i and j are the coordinates of corner 1, k and l are the coorinates of corner 2, the room should be filled in between them
i=random_range(2,70);
j=random_range(2,14);
mem_i=i;
mem_j=j;
o=random_range(3,6);
p=random_range(3,6);
k=i+o;
l=j+p;
mem_k=k;
mem_l=l;
for (i;i<k;i++){
dungeon[i][j]=0;
}
i=mem_i;
for (j;j<l;j++){
dungeon[i][j]=0;
}
j=mem_j;
mem_k=k;
mem_l=l;
for (k;k>=i;k--){
dungeon[k][l]=0;
}
k=mem_k;
for (l;l>=j;l--){
dungeon[k][l]=0;
}
dungeon[mem_k-1][mem_l-1]=2;
p_x=mem_k-2;
p_y=mem_l-2;
}
What this does, currently, is fill the screen with walls, hollow out a rectangle(but only edges, it doesn't fill in the room with floor, which is my current problem), and stick in a stair up and the @. I need to find a way to make the for loops that hollow out the edges of the rectangle hollow out a full room instead. Maybe it's because I've been sitting here working on this all day, because it seems like this should be a simple thing to do.