n>
</code></pre></div></div>

<h3 id="setposition-and-draw-functions">setPosition() and draw() functions</h3>

<p>The drawing function of this project depends on the position of the mouse. Since we’ll be moving from one position to another one whenever the mouse is clicked or when the mouse is moved over the canvas, we’ll need to create a setPosition() function that sets variables to the <a href="http://www.w3schools.com/jsref/event_clientx.asp" class="underline">user’s x &amp; y position</a> coordina