Gigiux
Coder
Hello,
I am new to JS and I would like to create a function to draw a PacMan using sin/cos functions. I defined a function
However, the result is not that.
What am I getting wrong?
Thank you
I am new to JS and I would like to create a function to draw a PacMan using sin/cos functions. I defined a function
draw_pacman that takes the context, the angle of the open mouth, the x/y position of the object and the radius of the object. The angle is defined as a mouth object multiplied by Greek pi. In theory, the function arc will draw from angle to -angle and the function lineTo should draw a line at the coordinates (cos(angle) * radius, sin(angle) * radius).However, the result is not that.
What am I getting wrong?
Thank you
