PDA

View Full Version : Collision between MovieClips



rabskers
November 3rd, 2001, 11:49 AM
Hi all!
I really need to know how to make two movie clips Know when they are in collision with each other.

I have a car that fires bullets and the idea is to shoot other cars and for those cars to explode.

How do i make the bullet MovieClip recognise that it is in collision with the car MovieClip?

All help or pointers to a good tutorial would be very much appreciated as always.

Kind regards to all!

eyezberg
November 3rd, 2001, 03:48 PM
if (mc_bullet.hitTest(mc_car)) {
mc_car gotoAndPlay ("explode");
//or whatever action you want
}

as an example, the function checking the collision being hitTest, one clip before, the target in brackets. This gets activated (returns a boolean true or false) by the clips bounding boxes! so s'times it may seem it gets set to true before the clips actually touch..