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 & HelpSyntax Questions › create a break in the sketch
Page Index Toggle Pages: 1
create a break in the sketch (Read 215 times)
create a break in the sketch
Nov 11th, 2008, 1:38pm
 
Hallo everybody!

Is there any possibilty to create a short break in a sketch if any key is pushed and if a key is pushed again the sketch shall carry on running.

Thanks!

David
Re: create a break in the sketch
Reply #1 - Nov 11th, 2008, 2:07pm
 
Code:
boolean run=true;

//normal setup...

void draw()
{
if(run)
{
//normal drawing stuff.
}
}

void keyReleased()
{
if(key=='p')
run=!run;
}
Re: create a break in the sketch
Reply #2 - Nov 11th, 2008, 2:16pm
 
wow! thanks for the immediate answer! it works perfectly!

regards,

david
Page Index Toggle Pages: 1