SCREENSHOTS:
Top Left: A building.
Top Right: An Interior.
Bottom Left: A culvert. Usually unwalkable.
Bottom Right: Inside the culvert.
The room behind the culvert:
My tile chunk, as of now:
I've written code to allow for events that affect the layout of the map:
void MapEdit()
{
if(g_bFirstCulvertOpen)
g_FirstTown[0][15]=52.1;
}
Where my default map chunk is:
float g_FirstTown[100][100]=
{
{51,12,11,51,51,51,51,51,51,51,51,51,51,51,51,52,51,51,51,51},
{51,12,11,55,55,55, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,51},
{51,12,11,53,53,53, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,51},
{51,12,11,53, 2,53, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,51},
{51,12,21,13,13,13,13,13,13,13,13,13,13,13,13,24, 3, 3, 3,51},
{51,22,14,14,14,14,14,14,14,14,14,14,14,14,23,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,53, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,12,11, 3, 3, 3,51},
{51,51,51,51,51,51,51,51,51,51,51,51,51,51,12,11,51,51,51,51}
};
by adding a floating offset to the ID of a map tile, I am affecting the ID it's given as a sprite in
rpgDrawMap():
if(MapArray[y][x]==2||
CheckOffset(MapArray[y][x],0.1))
{
dbSprite(t,ScrnPosX,ScrnPosY,MAPIMAGEID);
doUV(t,(int)MapArray[y][x]-1,10);
dbSizeSprite(t,32,32);
t++;
}
Where
t is the variable that manages the IDs for tiles that teleport the player between interior and exterior map chunks.
So, the culvert becomes walkable and a door if
g_bFirstCulvertOpen is true.
I also added code to my
Navigation() function to switch the map chunk to
g_FirstDungeon[][] when the player exits the screen above the culvert.