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.

DarkBASIC Discussion / Slowing down loops....

Author
Message
Data
20
Years of Service
User Offline
Joined: 26th Nov 2004
Location: Winnipeg,Canada
Posted: 25th Nov 2006 03:41
Hi

I was making this simple game

and ran into a problem. Everything works fine, you select the amount of circles you want to appear in sequence and then you try to click on them. If you do, the game pauses, you press any button and it continues. Once it is over, it displays the amount of circles you hit, how many possible etc. etc. However, as you may have noticed the circles move really fast popping up and then disappearing in under a second. Is there any way I can slow this down? So that the loop happens slower so the user has more time to try to click the circle.


Thanks
Data

Free sigs, email addresses and contests!
JimmyR.Co.Uk
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Nov 2006 03:56 Edited at: 25th Nov 2006 04:05
You need to use a timer function and restructure your program a little.

1. Put the circle drawing in a proc or function
2. Start the timer
3. Continue checking for mouse clicks
4. Remove the circle when the timer reaches the required value

TDK

Data
20
Years of Service
User Offline
Joined: 26th Nov 2004
Location: Winnipeg,Canada
Posted: 25th Nov 2006 04:13
thanks that helps

Free sigs, email addresses and contests!
JimmyR.Co.Uk
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Nov 2006 04:33
I re-wrote part of it for you... Not sure what that function was all about...



Keep an eye on the variables you are using. Don't use floats unless you need them!

TDK

Data
20
Years of Service
User Offline
Joined: 26th Nov 2004
Location: Winnipeg,Canada
Posted: 25th Nov 2006 17:37
thanks TDK that really helps

Free sigs, email addresses and contests!
JimmyR.Co.Uk

Login to post a reply

Server time is: 2025-05-26 05:05:39
Your offset time is: 2025-05-26 05:05:39