My code has been acting odd. I made a function that layers my art resources but only the last tile of my art resource acts the way it should. My character goes behind and in front of the last tile and gets printed correctly. Strangely its really exclusive to the last tiles I print. What I need is to figure out in step by step order what going on with my code sample below and be able to layer the resources.
Here is a small sample of my main function. This is how I do my rendering.
Code:
Int main (int arc, char* args[])
{
//Move class
Move character;
//Class Tile & Side Tile
Tile *tiles [TOTAL_TILES];
SideTile *walls [TOTAL_TILES_WALL];
//Render the floor tiles first
for (int t = 0; t < TOTAL_TILES_WALL; t++)
{
//Call a show function to render tiles
tiles[t]->show();
}
for (int tz = 0; tz < TOTAL_TILES_WALL; tz++)
{
if (character.layer_maintance(tiles, walls)==1)
{
//By changing the order of the calls I print them on screen differently
character.show();
Character.show_attack();
wall[tz]->show_side();
}
if (character.layer_maintance(tiles, walls)==2)
{
character.show();
Character.show_attack();
wall[tz]->show_side();
}
if (character.layer_maintance(tiles, walls)==3)
{
wall[tz]->show_side();
character.show();
Character.show_attack();
}
}
//Finally I print to the screen with this function.
SDL_Flip(screen)
}
}