We learned a lot in this chapter about drawing shapes and creating interaction with the new HTML5 canvas element and the drawing API.
Specifically, we covered:
Drawing different paths and shapes in canvas, including circles, arcs, and lines.
Adding mouse events and interaction with the drawn paths in the canvas.
Dragging drawn paths in the canvas.
Checking line intersection with the help of mathematics formulas.
Creating an untangle puzzle game in which players need to drag the circles so the connecting lines are not intersected by each other.
Now that we've learned about basic drawing functions in the canvas and drawing API, use them to create a puzzle solving game in canvas. We're ready to learn some advanced drawing techniques in canvas. In the next chapter, we will enhance our untangle puzzle game with more canvas drawing APIs, such as drawing text, drawing images, and drawing gradients.