MCPcopy
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / drawBall

Function drawBall

assets/js/pingpong.js:98–105  ·  view source on GitHub ↗
(x, y, radius, color)

Source from the content-addressed store, hash-verified

96
97// function to draw ball
98function drawBall(x, y, radius, color) {
99 ctx.fillStyle = color;
100 ctx.beginPath();
101 // syntax --> arc(x, y, radius, startAngle, endAngle, antiClockwise_or_not)
102 ctx.arc(x, y, radius, 0, Math.PI * 2, true); // π * 2 Radians = 360 degrees
103 ctx.closePath();
104 ctx.fill();
105}
106
107/* drawing functions end */
108

Callers 1

renderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected