Chapter 6. BOUNDARIES AND FRICTION

What we'll cover in this chapter:

  • Environmental boundaries

  • Friction

  • Important formulas in this chapter

You've covered a lot of ground in the preceding chapters; you can now get some kind of graphic into a sprite and use all kinds of forces to move it around the screen. However, you've probably already run into a small annoyance with many of the examples you've created so far: When you move the object off the screen, bangit's gone. Sometimes, if it's moving fast at some angle, you have no way of knowing how to get it back. Your only option is to restart the movie.

In most real-world scenarios, some boundaries existsometimes walls and a ceiling, but at the very least, almost always the ground. Unless you're making a ...

Get Foundation ActionScript 3.0 Animation: Making Things Move! 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.