Hi everyone, I’m new to processing, and in this class, I’m in I’m trying to place rectangles in a scattered array behind this big star that I have already in place.
The image I have attached is my sketch for this project
the code I have right now is this
void setup(){
size(1360, 1400);
}
void draw() {
background(51);
fill(41,171,226);
stroke(255);
strokeWeight(2);
beginShape();
vertex(785, 233);
vertex(881,431);
vertex(1098,464);
vertex(939, 617);
vertex(975, 834);
vertex(781, 730);
vertex(586, 831);
vertex(625, 614);
vertex(468, 460);
vertex(686, 430);
endShape(CLOSE);
}
{
float r = 0;
float g = 0;
float b = 0;
float a = 0;
float X = 0;
float Y = 0;
if (mousePressed){
r = int(random(0, 255));
g = int(random(0, 255));
b = int(random(0, 255));
a = int(random(0, 255));
X = int(random(10, 60));
Y = int(random(10, 60));
fill(r, g, b, a);
rectMode(CENTER);
rect(mouseX, mouseY, X, Y);
}
}
whenever i run this code i only get the star and not the rectangles, i would greatly appreciate any and all help!