Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Score showing

Author
Message
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 3rd Jan 2011 23:05 Edited at: 3rd Jan 2011 23:33
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.


Many forward thanks.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 4th Jan 2011 15:01
Ok. Let's see if I understand you correctly... When you finish the game (last level), you want an image to be shown telling the player he has completed the game. When he presses a key, the final score will be shown and it waits for a keypress. When a key is pressed, it goes to the main menu... Right?

If that's the case, I suggest using some linear programming:
main menu
game loop
end-game image
score
goto main menu

Each of those steps will be it's own sync-loop (except for goto main menu). Also, use dbCenterText(dbScreenWidth()/2,dbScreenHeight(),szscor) to show the score centered on the screen. Seems like you have the "main menu" and "game loop" already, so you need to add some things:
at the top of the "main menu" put a tag like "MainMenu:". This way you can do a "goto MainMenu;" at the end.
if you want to show the "end-game image" by itself, that's easy:

and "score" is done similarly:



I hope that helps.

The fastest code is the code never written.
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 4th Jan 2011 20:52
Yes it did, thanks.

Login to post a reply

Server time is: 2024-09-28 14:11:49
Your offset time is: 2024-09-28 14:11:49