Cutting edge off screen
in
Programming Questions
•
6 months ago
So I've got this. I want the squares to disappear as soon as I hit the edge, instead of it getting cut off. I'm stuck and I don't know if I used the if condition right. Please advise.
void setup()
{
size (200,200);
smooth();
frameRate(15);
}
void draw()
{
background(255);
rect(mouseX, mouseY, 10, 10);
rect(mouseX+20, mouseY, 10, 10);
}
if (mouseX + mouseY > width);
void setup()
{
size (200,200);
smooth();
frameRate(15);
}
void draw()
{
background(255);
rect(mouseX, mouseY, 10, 10);
rect(mouseX+20, mouseY, 10, 10);
}
if (mouseX + mouseY > width);
1