images

Chapter 6

Boundaries and Friction

What we'll cover in this chapter:

  • Environmental boundaries
  • Friction

You covered a lot of ground in the preceding chapters. You can create graphics with the canvas drawing API and use all kinds of forces to move them around the screen. However, you've probably run into a small annoyance with many of the examples: If an object moves off the screen, it's gone. Sometimes, you have no way of knowing how to get it back and your only option is to reload the web page.

In most real-world scenarios, some boundaries exist, usually the ground beneath you, and sometimes walls with a ceiling. Unless you're making a space ...

Get Foundation HTML5 Animation with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.