Hey guys, I am working on a code and I am stuck. The idea is for the random circles to stop when you press a key if not continue working until it stops. There’s an image running in the background. Eventually I want to turn it into a video game. but for now I just need help with this simple code.
PImage desert;
boolean button = false;
float r;
float g;
float b;
float a;
float diam;
float x;
float y;
void setup() {
size(987, 496);
smooth();
desert = loadImage ("desert.jpg");
}
void draw () {
image (desert, 0, 0);
tint (258,142);
r = random(235);
g = random(255);
b = random (255);
a = random (255);
diam = random (125);
x = random (width);
x = random (width);
y = random (height);
y = random (height);
noStroke();
fill(r, g, b, a);
ellipse(x, y, diam, diam);
}