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

Detecting Collisions

How do you detect a collision between two objects? How do you decide what to do after a collision occurs?

There are two basic ways to detect collisions inside Flash. You can use the MovieClip.hitTest() method, which is useful in particular cases. As another option, you can rely on good old distance formulas, which are more flexible and not that hard to handle.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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