//evaluates to determine if mouse is pressed. If true, then it prints out the mouseX and mouseY location.
if(mousePressed == true){
print(x1+y1);
}
}
So I can't get this to work. Everytime I click on the screen that pops up when I run, all it returns is "00000".
I essentially want to have a variable that stores the x and y mouse location when it's pressed so I can use it later. But i'm not sure why my logic is wrong. Can somebody help me fix it?
ellipse(250 + (0.25)*(xBody)+ xOffset,250 - (0.25)*(yBody) + yOffset,2*sqrt(xBody*yBody/128),2*sqrt(xBody*yBody/128)); // sclera of the fish (white part of the eye)
fill(0);
//ellipse(250 + 0.5*sqrt((xBody+yBody)*(xBody-yBody)) + xOffset,250 - (yBody*yBody/xBody) + sqrt(xBody*yBody/128) + yOffset,2*sqrt(xBody*yBody/pow(2,9)),2*sqrt(xBody*yBody/pow(2,9))); //iris of the fish
ellipse(250 - (0.25)*(xBody)+ xOffset,250 - (0.25)*(yBody) + yOffset,2*sqrt(xBody*yBody/128),2*sqrt(xBody*yBody/128)); // sclera of the fish (white part of the eye)
fill(0);
//ellipse(250 + 0.5*sqrt((xBody+yBody)*(xBody-yBody)) + xOffset,250 - (yBody*yBody/xBody) + sqrt(xBody*yBody/128) + yOffset,2*sqrt(xBody*yBody/pow(2,9)),2*sqrt(xBody*yBody/pow(2,9))); //iris of the fish
So basically when I try to run this code, I get an error saying " expecting EOF, found 'if' "
I've only been programming for 1 week now but i'm not sure if what i'm doing is even possible or if it's more of a language issue that i'm saying.
Basically what i want this to do is the following. I have to draw a fish.
um i have a parameter called "d" If I put in a "1", I want the fish to have a "right" orientation. However if i put in a "0", I want the fish to have a "left" orientation. I think I can do this with an if statement
because there's only 2 states right? left and right. I can say if the "d" value is "1" then draw a fish with a right orientation.
(Now this part i'm not sure... ) else if "d" value is "0" then draw a fish with a left orientation.