• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Chapter 5. Collision Detection

What Is a Collision?

Detection Using hitTest()

Detection Using Math

Collision Detection with Advanced Shapes

Points to Remember

When you're playing a computerized game of pinball, or a platform game like Super Mario Brothers, you probably take it for granted that it has realistic-looking reactions. In pinball, the ball gets hit by the flippers and zooms away; in a platform game, the character lands on a platform or falls to the ground. There is one important thing that has to happen before any of these realistic reactions can take place: There has to be a collision, and the collision must be detected. (OK, that's two things.) Once the collision is detected, a reaction can take place—we'll get into that in the next chapter. In this chapter, we'll discuss the ins and outs of collision detection, using both hitTest(), a method of the MovieClip object sometimes useful for this purpose; and math, which is where the real power lies. We will also address the limitations of collision detection in Macromedia Flash and how you can get around them.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint