This is my code for the project. The mouth is only opening and not closing. What is wrong here? Why is it not working?
var mouth1 = 221;
draw = function() {
background(255, 171, 171);
fill(0, 0, 0);
ellipse(105, 130, 47, 47);
fill(0, 0, 0);
ellipse(281, 130, 47, 47);
fill(255, 255, 255);
ellipse(115, 122, 12, 12);
ellipse(290, 122, 12, 12);
ellipse(104, 133, 9, 9);
ellipse(282, 133, 9, 9);
fill(0, 0, 0);
ellipse(199, 258, 123, mouth1);
mouth1 -= 2;
fill(255, 0, 0);
text("Click restart after 3 seconds.", 138, 33, 146, 85);
println(mouth1);
if (mouth1 <= 36) {
mouth1 += 2;
}
if (mouth1 >= -195) {
mouth1 -= 2;
}
};
I expected the mouth to both open and close. But the only thing that is happening is the mouth is opening. What is wrong?
AnyaGamer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
XD can someone plz help me with this? and make the explanation easy to understand. Thanks!
AnyaGamer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.