O'Reilly logo

Foundation HTML5 Animation with JavaScript by Billy Lamberta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required