Simple Question: Why doesn't my program move?
in
Programming Questions
•
1 year ago
Original Code:
https://courses.soe.ucsc.edu/courses/cmps10/Winter12/01/pages/assignments/cmps10-homework5-program-rfrobot.txt
Instructions: https://courses.soe.ucsc.edu/courses/cmps10/Winter12/01/pages/assignments/cmps10-homework5-due-1-24v2.pdf
My Attempt:
Instructions: https://courses.soe.ucsc.edu/courses/cmps10/Winter12/01/pages/assignments/cmps10-homework5-due-1-24v2.pdf
My Attempt:
void setup() {
size(720, 480);
}
void draw() {
background(64);
int x=0;
smooth();
strokeWeight(2);
ellipseMode(RADIUS);
//Neck
stroke(102); // Set stroke to gray
line(266+x, 257+x, 266+x, 162+x); // Left
line(276+x, 257+x, 276+x, 162+x); // Middle
line(286+x, 257+x, 286+x, 162+x); // Right
// Antennae
line(276+x, 155+x, 246+x, 112+x); // Small
line(276+x, 155+x, 306+x, 56+x); // Tall
line(276+x, 155+x, 342+x, 170+x); // Medium
// Body
noStroke(); // Disable stroke
fill(102);
// Set to gray
ellipse(264+x, 377+x, 33+x, 33+x);// Antigravity Orb
fill(0); // Set to black
rect(219, 257, 90, 120); // Main body
fill(102); // Set back to gray
rect(219, 274, 90, 6); // Gray stripe
// Head
fill(127,0,0); // Set to black
ellipse(276+x, 155+x, 45+x, 45+x);// Head
fill(0,255,0); // Set to white
ellipse(288+x, 150+x, 14+x, 14+x);// Large eye
fill(255,200,200); // Set to black
ellipse(288+x, 150+x, 3+x, 3+x); // Pupil
fill(0,0,102); // Set to gray
ellipse(263+x, 148+x, 5+x, 5+x); // Small eye 1
ellipse(296+x, 130+x, 4+x, 4+x); // Small eye 2
ellipse(305+x, 162+x, 3+x, 3+x); // Small eye 3
x=x+1;
}
I'm pretty sure I followed everything correctly and didn't make any mistakes. Any help would be much appreciated!
1