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.

Newcomers DBPro Corner / Reset and Winning clashes.

Author
Message
ghostkrashers
14
Years of Service
User Offline
Joined: 19th Jul 2010
Location:
Posted: 22nd Jul 2010 22:52
So In my game, Im trying to have a winning function. When you reach a certain point( its a maze), it will display You Win. Then reset. Im trying to have a wait between the reset, because, it just flashes the text and resets. When I try adding Wait 2000 it just waits for the text too. Help!
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 23rd Jul 2010 01:38
Maybe you can use timer to do that?

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
ghostkrashers
14
Years of Service
User Offline
Joined: 19th Jul 2010
Location:
Posted: 23rd Jul 2010 02:06
I tried that. It had a syntax error.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 23rd Jul 2010 05:15 Edited at: 23rd Jul 2010 05:16
You can use WAIT KEY to pause the action till the user hits a key.



Or wait for a MOUSECLICK():



Dia
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 23rd Jul 2010 08:41
or you can wrap your whole game loop inside a while/endwhile statement

i.e.

while winstate=0 (run the game loop) endwhile
while winstate=1 (run the 'you win' loop) endwhile

inside your game loop just have a line that sets winstate=1 inside your main game loop

this can then be expanded so that you can have menu screens, config screens, random info screens, credits screens etc

This is not the Sig you are looking for....
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 23rd Jul 2010 21:34
Multi Loop idea isn't bad, i use that method for ingame pause menu.So when the proper condition is fulfiled the game goes in the menu loop or whatever you want.You can reset the game in this extra loop without anything you do takes effect on screen, wait 5 seconds after this go to main loop again.Something like that.You need to figure it out for yourself.Anything else depends on your coding.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!

Login to post a reply

Server time is: 2024-09-28 20:33:39
Your offset time is: 2024-09-28 20:33:39