HitTest: Detect if an object hit another object

The function hitTestObject detects if one object hits another object. One problem is that the event is considered to occur if the bounding rectangles of the two objects touch. In ActionScript the asteroid has hit the planet, even though it does not look like they are touching.

touching


Get Adobe Flash player
There is no code in the movie, all of the code is in the Asteroid.as

Download the movie.
INDEX, Detect if an object hit another, Detect if an object hit a target inside another, Catch a Falling Star Game, Add a paddle, Add code to movie for hit and miss, Modify FallingStar to hit and miss, Add code to move the paddle
Next lesson: Strings in ActionScript

Copyright © Zebra0.com
All rights reserved worldwide.

 
 

Detect if an object hit another