I need some help with the project "Moles in holes"
var drawMole = function(moleX, moleY) {
var moleX = 248;
var moleY = 185;
noStroke();
fill(125, 93, 43);
ellipse(moleX, moleY, 60, 60); // face
fill(255, 237, 209);
ellipse(moleX, moleY+10, 33, 28);
fill(0, 0, 0);
ellipse(moleX-10, moleY-15, 10, 10); // eyes
ellipse(moleX+10, moleY-15, 10, 10);
ellipse(moleX, moleY-5, 10, 10); // nose
ellipse(moleX, moleY+10, 20, 5); // mouth
};
background(52, 168, 83); // green grass
fill(0, 0, 0);
ellipse(200, 200, 100, 30); // holes!
ellipse(70, 119, 100, 30);
ellipse(300, 60, 100, 30);
ellipse(297, 350, 100, 30);
drawMole(moleX, moleY);
Please look at this and see if anyone can find the error. The oh noes guy keeps saying this** you are trying to use MoleX and moleY in your call to the drawMole function, This doesn't work because function parameters and variables declared inside a function can't be seen outside of that function (they are"undefined" outside of the function). This will be explained more when we talk about local and global variables.
If anyone can find the error please advise and thanks!
U moet u aanmelden om een opmerking te plaatsen.