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 AppGameKit Corner / Creating a short delay between program steps/levels

Author
Message
LordCucumber77
9
Years of Service
User Offline
Joined: 7th Mar 2015
Location:
Posted: 15th Mar 2015 16:56
How would you guys create a short delay (in seconds) pausing a game before moving to a next level for instance. I've been messing around with for loops but I am not getting it right somehow.

Ideas anyone?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Mar 2015 18:05 Edited at: 15th Mar 2015 18:05
The simplest way (which doesn't account for anything else happening) is:



Quidquid latine dictum sit, altum sonatur
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 17th Mar 2015 16:46 Edited at: 17th Mar 2015 16:47
Another way is to use a state machine (these are a great way to make a series of events happen in a certain order with a certain timing). It's more complicated initially, but it scales better if you need a lot of different steps or events.




On Steam!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Mar 2015 20:46
+1 to what BMacZero says. This is my method too. The example above is step 1, to understand the concept.

Quidquid latine dictum sit, altum sonatur

Login to post a reply

Server time is: 2024-11-21 11:29:08
Your offset time is: 2024-11-21 11:29:08