New to Processing, need help quick!
in
Programming Questions
•
1 month ago
I am taking a college course using processing and I have an assignment due tomorrow that is just killing me. Could someone look at my code here and tell me why they think it isn't working?
Much appreciated, thanks:
void setup (){
size(400,400);
smooth();
frameRate(30);
}
if (mouseX < width/2) {
draw ();
background(0,30,200);
stroke(0);
fill(30,200,0);
rect(0,200,400,200);
fill(240);
rectMode(CENTER);
rect(200,175,50,50);
fill(100);
rectMode(CORNER);
rect(183,168,10,10);
rect(207,168,10,10);
fill(50,50,0);
rectMode(CENTER);
rect(200,194,8,13);
noStroke();
fill(255,255,0);
ellipseMode(CENTER);
ellipse(75,100,40,40);
fill(200,0,0);
triangle(200,130,175,150,225,150);
}
else {
draw();
background(0);
stroke(0);
fill(30,200,0);
rect(0,200,400,200);
fill(240);
rectMode(CENTER);
rect(200,175,50,50);
fill(100);
rectMode(CORNER);
rect(183,168,10,10);
rect(207,168,10,10);
fill(50,50,0);
rectMode(CENTER);
rect(200,194,8,13);
noStroke();
fill(255,0,0);
ellipseMode(CENTER);
ellipse(75,100,40,40);
fill(200,0,0);
}
Much appreciated, thanks:
void setup (){
size(400,400);
smooth();
frameRate(30);
}
if (mouseX < width/2) {
draw ();
background(0,30,200);
stroke(0);
fill(30,200,0);
rect(0,200,400,200);
fill(240);
rectMode(CENTER);
rect(200,175,50,50);
fill(100);
rectMode(CORNER);
rect(183,168,10,10);
rect(207,168,10,10);
fill(50,50,0);
rectMode(CENTER);
rect(200,194,8,13);
noStroke();
fill(255,255,0);
ellipseMode(CENTER);
ellipse(75,100,40,40);
fill(200,0,0);
triangle(200,130,175,150,225,150);
}
else {
draw();
background(0);
stroke(0);
fill(30,200,0);
rect(0,200,400,200);
fill(240);
rectMode(CENTER);
rect(200,175,50,50);
fill(100);
rectMode(CORNER);
rect(183,168,10,10);
rect(207,168,10,10);
fill(50,50,0);
rectMode(CENTER);
rect(200,194,8,13);
noStroke();
fill(255,0,0);
ellipseMode(CENTER);
ellipse(75,100,40,40);
fill(200,0,0);
}
1