When my player collides with the end at the last level game_finish becomes true,also at the collision check it will show a image with congrats, i want to hide the image and then show a text with the score, my score variable is scor,menu_load() is the function which loads the menu.When I run this code, it shows the image, i press a key nothing happens, i press it again and it goes to menu.
My final result I wanted it to be something like i collide, it shows me the image, i press a key it hides the image, and shows the score, i press another key it starts menu_load() and hides the text.
What should I modify?
Later Edit:
The image is shown in the collision check, if the score is bigger than a certain amount it shows something,or something else,(if the level is the last and the player collides with the finish, game_finish becomes true).
And the text is shown from the input function(where I check what key the user presses,is the if that I try to show the score.
In the main loop this is the order
user_input();
finishlevel();
Also I'm not a very advanced programer, so I Would like to use dbText.
if (game_finish==true && dbScanCode()>0)
{
dbHideAllSprites();
dbWaitKey();
game_cont=false;
dbSetTextSize (32);
char szscor[ 256 ] = "";
strcpy ( szscor, "scor = " );
strcat ( szscor, dbStr ( scor ) );
dbText(dbScreenWidth()/2,dbScreenHeight(),szscor);
if (dbScanCode()>0)
{
game_finish=false;
menu_load();
}
}
Many forward thanks.