Hy everyone. When drawing my tile map I made in mappy and then drawing my player image on the screen also, I relized that the player image was behind the tile map. So in order to fix this problem is there a command in allegro 5 that I can use to fix this problem. The tutorial series in which I learned allegro from on fixbyproximity.com only showed the command to draw the map really.
source code just in case just keep in mind the project is def not finished
Call the function to draw the map before drawing anything else, then draw the player.
else if(state == PLAY) { MapDrawBG(xOff,yOff,0,0, WIDTH, HEIGHT); // Draw map first. al_draw_bitmap(MenacerTank,200,100,0); al_stop_sample_instance(instance1); }
Every time you draw something, it goes above whatever was previously drawn. So think of it as going from the background to the foreground. If you were to draw bitmaps A, B, and then C, you would have A in the very back, followed by B, and then C in the very front.
Eric Johnson:
Call the function to draw the map before drawing anything else, then draw the player.
else if(state == PLAY)
{
MapDrawBG(xOff,yOff,0,0, WIDTH, HEIGHT); // Draw map first.
al_draw_bitmap(MenacerTank,200,100,0);
al_stop_sample_instance(instance1);
}
Every time you draw something, it goes above whatever was previously drawn. So think of it as going from the background to the foreground. If you were to draw bitmaps A, B, and then C, you would have A in the very back, followed by B, and then C in the very front.
Thanks Eric Johnson I honestly did not know that you have to put images in a certain order according to how you want it to look. Ya learn something every day!;D
You're welcome. I'm glad I could help.