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 / Using Multiple "do...loop"s

Author
Message
Twisted Steel Software
17
Years of Service
User Offline
Joined: 21st May 2007
Location: Teh Interwebs
Posted: 21st Jan 2008 20:29
Hello all,
Is there a way to get multiple loops in GDK? It would help me out tremendously... In DBP I used to use a seperate do loop for the main menu, then a do loop for the 3D drawing... then a do loop for a pause menu etc.

Can I possibly just call LoopGDK(); in a while loop?

Thanks in advance,
Jim

Intel Pentium 4 3.40 Ghz HT, 1.5 GB RAM, Nvidia Geforce 6800, 19" Dell CRT Monitor ... I need to upgrade ^-^
John Goewert
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Cornfield, MO
Posted: 22nd Jan 2008 00:27
Sort of, though the traditional way is to set a Game State variable and then call the code for what you are handling based on the current game state.

The Dark Invaders tutorial has a decent implementation of this using an enum called eMode:

enum eMode { eGameSetup , eGameReset , eGameTitle , eGameWaitForFire , eGameLevel , eGameLevelWait , eGameLevelWait2 , eGamePlay , eGameDie , eGameWin , eGameOver };

Then setting the mode:
eMode g_eGameMode = eGameSetup;

For simple game states, this is a really good way to go.

Using DGDK since 01/01/2008
Blah - http://www.john.goewert.org
Twisted Steel Software
17
Years of Service
User Offline
Joined: 21st May 2007
Location: Teh Interwebs
Posted: 22nd Jan 2008 01:46
What tutorial is this? I have not been able to find it...

Intel Pentium 4 3.40 Ghz HT, 1.5 GB RAM, Nvidia Geforce 6800, 19" Dell CRT Monitor ... I need to upgrade ^-^
John Goewert
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Cornfield, MO
Posted: 22nd Jan 2008 03:31
Click Start->Program Files->The Game Creators->Tutorials.

Using DGDK since 01/01/2008
Blah - http://www.john.goewert.org
Twisted Steel Software
17
Years of Service
User Offline
Joined: 21st May 2007
Location: Teh Interwebs
Posted: 22nd Jan 2008 06:19
gah... sorry... I feel stupid

I thought it was a forum-based tutorial

Intel Pentium 4 3.40 Ghz HT, 1.5 GB RAM, Nvidia Geforce 6800, 19" Dell CRT Monitor ... I need to upgrade ^-^

Login to post a reply

Server time is: 2024-09-29 09:28:51
Your offset time is: 2024-09-29 09:28:51