# Please help me. "It looks like you're mixing "active" and "static" modes."

**URL:** <https://discourse.processing.org/t/please-help-me-it-looks-like-youre-mixing-active-and-static-modes/30743>\
**Category:** Processing\
**Tags:** homework\
**Created:** [June 16, 2021, 4:53pm UTC](https://discourse.processing.org/t/please-help-me-it-looks-like-youre-mixing-active-and-static-modes/30743 "2021-06-16T16:53:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasa](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sasa](https://discourse.processing.org/u/sasa)\
**Post date:** [June 16, 2021, 4:53pm UTC](https://discourse.processing.org/t/please-help-me-it-looks-like-youre-mixing-active-and-static-modes/30743/1 "2021-06-16T16:53:15Z")

</div>

Robot r1;

void setup(){  
size(800, 600);  
r1 = new Robot();  
r1.setPos(width/2, height/2);  
}

void draw(){  
r1.display();  
}  
noStroke();  
fill(204, 10);  
rect(0, 0, width, height);  
stroke(0);  
translate(transX, transY);  
scale(1.0/ratio);  
transX += dirX \* speedX;  
if (transX \> width - 400/ratio) {  
dirX = -dirX;  
transY += 400/ratio;  
} else if (transX \< 0) {  
dirX = -dirX;  
transY += 400/ratio;  
}

class Robot {  
float x = 0;  
float y = 0;  
float faceX = x + 200;  
float faceY = y + 50;  
float faceW = 100;  
float faceH = 100;  
color faceFill = color(255);  
float l\_eyeX = faceX - 20;  
float l\_eyeY = faceY;  
float r\_eyeX = faceX + 10;  
float r\_eyeY = faceY;  
float eyeW = 10;  
float eyeH = 10;  
color eyesFill = color(0);  
float mouthX = faceX - 30;  
float mouthY = faceY + 20;  
float mouthW = 50;  
float mouthH = 10;  
float neckX1 = faceX;  
float neckY1 = faceY + 50;  
float neckX2 = faceX;  
float neckY2 = faceY + 70;  
float chestX = faceX - 50;  
float chestY = faceY + 70;  
float chestW = 100;  
float chestH = 150;  
color chestFill = color(255);  
float l\_armX = faceX - 150;  
float l\_armY = faceY + 80;  
float l\_armW = 100;  
float l\_armH = 1;  
float r\_armX = faceX + 50;  
float r\_armY = faceY + 80;  
float r\_armW = 100;  
float r\_armH = 1;  
float l\_legX = faceX - 40;  
float l\_legY = faceY + 220;  
float l\_legW = 20;  
float l\_legH = 120;  
color l\_legFill = color(#19A6E5);  
float r\_legX = faceX + 20;  
float r\_legY = faceY + 220;  
float r\_legW = 20;  
float r\_legH = 120;  
color r\_legFill = color(#19A6E5);

float transX = x;

float transY = y;

int dirX = 1;

float speedX = 5;

float ratio = 4;

Robot() {  
}

void display() {  
pushMatrix();  
translate(x, y);  
translate(-50.0/0.25, -50.0/0.25);  
update(0, 0);  
head();  
chest();  
arms();  
legs();  
popMatrix();  
}

void setPos(float x, float y){  
this.x = x;  
this.y = y;  
}

void update(float x, float y) {  
faceX = x + 200;  
faceY = y + 50;  
l\_eyeX = faceX - 20;  
l\_eyeY = faceY;  
r\_eyeX = faceX + 10;  
r\_eyeY = faceY;  
mouthX = faceX - 30;  
mouthY = faceY + 20;  
neckX1 = faceX;  
neckY1 = faceY + 50;  
neckX2 = faceX;  
neckY2 = faceY + 70;  
chestX = faceX - 50;  
chestY = faceY + 70;  
l\_armX = faceX - 150;  
l\_armY = faceY + 80;  
r\_armX = faceX + 50;  
r\_armY = faceY + 80;  
l\_legX = faceX - 40;  
l\_legY = faceY + 220;  
r\_legX = faceX + 20;  
r\_legY = faceY + 220;  
}

void head() {  
//face  
fill(faceFill);  
ellipse(faceX, faceY, faceW, faceH);  
eyes();  
mouth();  
neck();  
}

void eyes() {  
//eyes

fill(eyesFill);  
ellipse(l\_eyeX, l\_eyeY, eyeW, eyeH);  
ellipse(r\_eyeX, r\_eyeY, eyeW, eyeH);  
}

void mouth() {  
//mouth

rect(mouthX, mouthY, mouthW, mouthH);  
}

void neck() {  
//neck

line(neckX1, neckY1, neckX2 ,neckY2);  
}

void chest() {  
//chest

fill(chestFill);  
rect(chestX, chestY, chestW, chestH);  
}

void arms() {  
//left arm

rect(l\_armX, l\_armY, l\_armW, l\_armH);

//right arm

rect(r\_armX, r\_armY, r\_armW, r\_armH);  
}

void legs() {  
//left leg

fill(#19A6E5);  
rect(l\_legX, l\_legY, l\_legW, l\_legH);

//right leg

rect(r\_legX, r\_legY, r\_legW, r\_legH);  
}  
}

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 16, 2021, 5:27pm UTC](https://discourse.processing.org/t/please-help-me-it-looks-like-youre-mixing-active-and-static-modes/30743/2 "2021-06-16T17:27:47Z")

</div>

Hello,

> Troubleshooting: looks like you’re mixing active and static modes

[https://www.youtube.com/watch?v=KkHk8OLgles](https://www.youtube.com/watch?v=KkHk8OLgles)

`:)`

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 16, 2021, 7:43pm UTC](https://discourse.processing.org/t/please-help-me-it-looks-like-youre-mixing-active-and-static-modes/30743/3 "2021-06-16T19:43:06Z")

</div>

> [@sasa](#):
>
> void draw(){  
> r1.display();  
> }  
> noStroke();

Yeah, somehow you’re closing the bracket} too early so you have code outside a function. Not allowed
