mouseClicked and if statement?
in
Programming Questions
•
11 months ago
I tried putting mouseClicked in an if-statement. such as
if(mouseClicked && x==1) {
make a circle
x++;
}
if(mouseClicked && x==2) {
make another circle
x++;
}
However, when I tried this it says there was an error with the void and boolean inside the if-statement. I cannot figure this out. Help!
I know mouseClicked in a void, but I thought it wouldn't matter? I tried casting it inside the if-statement like (boolean)mouseClicked, but that didn't work out.
if(mouseClicked && x==1) {
make a circle
x++;
}
if(mouseClicked && x==2) {
make another circle
x++;
}
However, when I tried this it says there was an error with the void and boolean inside the if-statement. I cannot figure this out. Help!
I know mouseClicked in a void, but I thought it wouldn't matter? I tried casting it inside the if-statement like (boolean)mouseClicked, but that didn't work out.
1