We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › is there a delay function
Page Index Toggle Pages: 1
is there a delay function ? (Read 898 times)
is there a delay function ?
Apr 20th, 2010, 8:07am
 
hi, i am creating a game where you shoot asteroids, if the asteroid hits your ship then all of the asteroids reset but due to the speed they continually hit the ship over and over before it can reset, so i was wondering if there was a delay function that i can add to the reset class in order to delay the asteroids for about 1 second before resetting in order to let the ship reset ?

Many thanks  Huh
Re: is there a delay function ?
Reply #1 - Apr 20th, 2010, 8:09am
 
Yep
http://processing.org/reference/delay_.html

Also take a look at this... if this is what you were intending.
http://processing.org/discourse/yabb2/num_1271717243.html
Re: is there a delay function ?
Reply #2 - Apr 20th, 2010, 8:33am
 
many thanks, the delay as stated stops the whole program which is no good to me and being a noob i really dont get how to set the other one up, is there any chance you could quicly go though how to set a timer up and more importantly how to do the checks ?

Many thanks
Re: is there a delay function ?
Reply #3 - Apr 20th, 2010, 9:14am
 
Well, delay() exists, but should not be used... Not for the purpose you have!
Well, you saw this yourself...

I precisely just answered a very similar question in the Help with a game! thread.
(Should make a page with this answer and examples, I suppose...)
Page Index Toggle Pages: 1