Chapter 1 introduced some of the basic methods for drawing to the canvas. This chapter presents a follow-up exercise that looks more closely at the canvas coordinate system and explores how to construct paths. These concepts are critical to understanding the canvas and designing your own drawing code.
We’ll also start to add a bit more structure to our code. Complex code can be difficult to comprehend—adding structure is the main way to keep the complexity under control. Structuring code into functions allows the development of simpler code that uses ...