HTML and CSS Reference
<div style="position: absolute; top: 50px; left: 50px;">
<canvas id="canvasOne" width="500" height="500">
Your browser does not support HTML5 Canvas.
Figure 5-11 illustrates how this code will look in the browser.
Figure 5-11. Multiple balls of different sizes bouncing off one another with friction applied
Curve and Circular Movement
Whew! Moving and colliding balls on vectors can create some cool effects. However,
moving in straight lines is not the only way you might want to move objects. In this
section, we will show you some ways to animate objects using circles, spirals, and