//setup
translate(xorigin,yorigin);
.
pushMatrix();
rotate(wingangle);
ellipse(xPos-90,yPos+120,40,180); // wing left
popMatrix();
pushMatrix();
rotate(-wingangle);
ellipse(xPos+90,yPos+120,40,180); // wing right
popMatrix();
.
if (wingangle>upperwinglimit) {
winglimitBO = false;
}
if (winglimitBO) {
wingangle = wingangle + wingspeed;
}
if (winglimitBO == false) {
wingangle = wingangle - wingspeed;
}
if (wingangle<lowerwinglimit) {
winglimitBO = true;
}
This isn’t the full code but it is all the code relating to the position/angle of the wings the wings flap up and down like they are meant to when stationary but if you change the X position of the penguin through something such as xPos += 1; then the wings will start moving up and down without any change to the Y axis being made and I cant figure out why. I was wondering if there is an error or a way to fix this?
Maybe the position of the wings should not be calculated based on (xPos, yPos) which must be I think the position of the total image. Thus, it would be enough to change the position of the whole by a translate(xPos,yPos) before drawing everything including the wings.