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 › Re: Help with circles
Page Index Toggle Pages: 1
Re: Help with circles (Read 761 times)
Re: Help with circles
Mar 10th, 2010, 11:48pm
 
mouseX and mouseY already are variables. Do you mean you're storing those values in some other variables (guess: x, y)?

What you are probably trying to do is something along the lines of:

Code:
// in draw()

// draw first circle

if (mousePressed) // perhaps use some other indicator
{
 // draw second circle
}


If this doesn't make sense (or help you enough), I suggest that you go through a few (more) basic tutorials until you have a better understanding of what is going on.

Check the Learning link at the top of the page.

-spxl
Re: Help with circles
Reply #1 - Mar 11th, 2010, 1:12am
 
You can do a check in draw(): if circleY is zero, don't draw the second circle.
Re: Help with circles
Reply #2 - Mar 11th, 2010, 1:16am
 
ditto wrote on Mar 11th, 2010, 12:09am:
I tried the if (mousePressed) but that does not seem to solve it.


I am guessing you did not try if (mousePressed) in the manner intended.

Please post your code so we can show you where the mistake is.

Code:
if (mousePressed) // condition
{
 // this will ONLY happen IF the condition is true
 ellipse(circleX, circleY, 50, 50);
}


-spxl
Re: Help with circles
Reply #3 - Mar 11th, 2010, 2:18am
 
You inverted yPos and circleY from your earlier post, but my advice is still valid:
Code:
int yPos = 0;
// [...]
if (yPos > 0)
{
ellipse(xPos, yPos, 50,50);
yPos= yPos+ 1;
}
Page Index Toggle Pages: 1