You’re almost there; now you’re ready to fix the bracket pairs. In your Meich class move that closing bracket after the class variables all the way to the end, plus you’ll need one more closing bracket at the end. Class structure looks like this:
class Meich {
// class variables
...
//constructor
Meich() {
...
}
void display() {
for () {
...
}
}
}
After that you will need to add all the class variables that was in your original post. You have left a few of them out of the second code post. After all of that I think it will run.
Man, I am still struggling. So this is what I have:
Meich meich;
int eyeSize, eyeSize2;
void setup() {
}
void draw() {
}
class Meich {
// Meich's variables
float meichX, meichY, meichW, meichH, eyeSize;
// Meich constructor
Meich(float tempX, float tempY, float tempW, float tempH, float tempEyeSize) {
meichX = tempX;
meichY = tempY;
meichW = tempW;
meichH = tempH;
eyeSize = tempEyeSize;
}
// Move Meich
void jiggle(float speed) {
// Change the location of Meich randomly
meichX = meichX + random(-1, 1)*speed;
meichY = meichY + random(-1, 1)*speed;
// Constrain Meich to window
meichX = constrain(meichX, 0, width);
meichY = constrain(meichY, 0, height);
}
// Display Meich
void display() {
// Set ellipses and rects to CENTER mode
ellipseMode(CENTER);
rectMode(CENTER);
}
// Loop Arms
for (float i = meichY + 5; i < meichY + meichH; i += 10) {
stroke(0);
line(meichX-meichW/3, i, meichX+meichW/3, i);
// Draw body
//head
//eyes
//nose
// mouth
//legs
}
}
With these changes, it is now the error "incomplete statement or extra code near extraneous input “for” expecting
it won’t let me make new replys because I am new, but THANK YOU!!! it worked!
That worked Thank you so much. I know I will be back on with more questions, but you helped me understand this far more than I have learned thus far. I now just need to put my class in the other tab and I will be good. Seriously, I am so so grateful that you took the time to teach me.
A lot of us here are either active or past teachers so we understand. The main thing is that you kept trying and that’s important for success. Good luck with your course.