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 › Re: This should work
Page Index Toggle Pages: 1
Re: This should work? (Read 206 times)
Re: This should work?
Jan 25th, 2009, 2:59pm
 
In mousePressed, you re-declare (local) variables of same names as the global variables: they "hide" the global variables. And when the function ends, they are thrown away.

Simple fix:
void mousePressed() {
  c = color(0);
  x = 0;
  y = 100;
  speed = 10;    
}
Page Index Toggle Pages: 1