How can i move down png in allegro5??
What do you mean exactly? Are you asking how to set the order in which an image is drawn? If so, images are drawn from back to front in the order that you draw them. So if you draw bitmaps 1, 2, 3, and 4, the result will be that 1 is in the far "background" and 4 is in the "front". Is that what you meant?
ı want to slide down coins upthere
You can move a bitmap by setting its X and Y coordinates during the render phase. Just move its Y axis up and down.
al_draw_bitmap(bitmap, x, y, flags);
i could not:(
The attachment you provided is a Microsoft Visual Studio Solution file. It does not contain any source code, so it is not very helpful. Please take a look at the example file below:
The above draws a coin (represented by a yellow circle) and slowly moves it up and down. The vertical movement is dictated by the coin's Y value (coin_y), which is updated every frame in the update phase.
What should ı change?
You should change the Y axis of your bitmaps, like in the example I posted.
thanks but i tried its not working
thanks but i tried its not working
Do you really think that sort of response will help us help you? Try to think about how you can describe in detail what it is you did.
-Create a datastruct:
struct Coin { int x; int y; ALLEGRO_BITMAP* image; }
-Create a new Coin
-Initialize the starting point
-When the timer ticks:
coin.y += COIN_SPEED;
-Then on render you draw the coin.
-The png moves down.