I\'m working on an HTML5 game. I need to draw tail lines in the canvas and check for intersections in the game, which is a Tron-style game.
I\'m actually using the d
This is the basic representation of closed path:
ctx.beginPath(); ctx.moveTo(0,0); ctx.lineTo(100,0); ctx.lineTo(100,100); ctx.lineTo(0,100); ctx.closePath(); // <--the image right side has this line ctx.stroke();
The result of closePath() is that the start and the end point will be bounded.
closePath()