View Full Version : hitTest of a circle,
nathan99
May 7th, 2005, 11:19 PM
hey guys,
i hav made me a circle and then made it an mc. But when i make it an MCand click a square appears around it. So when i play the game it doesnt do a precise hitTest, instead it hits around the circle, where the square appears when i click it in the editor...
how do i stop it from hitTesting the square around my circle, and instead when it actually hits the CIRCLE?
kode
May 7th, 2005, 11:38 PM
These tutorials might help:
http://www.kirupa.com/developer/actionscript/advanced_collision.htm
http://www.kirupa.com/developer/actionscript/calculating_distance2.htm
If you want my opinion, I'd use the second one (calculating the distance between the objects).
nathan99
May 7th, 2005, 11:55 PM
ok, i looked at them, but i dont no how to insert it into this
http://www.freewebs.com/nathan990/mmmmm.fla
i have stripped it down.
what i want is for them to stop when the mask of the main character hits the object named "edger" which is inside the bg1 object.........
Skribble
May 8th, 2005, 12:27 AM
you need to use shapeflag to hitTest absolute edges
if(hero.hitTest(_root.circle._x,_root.circle._y,tr ue){
blee blee
}
using the circles _x and _y coordinates will give you precise hitTesting.
nathan99
May 8th, 2005, 12:38 AM
didnt work:puzzle: can u look at the fla for me
nathan99
May 8th, 2005, 06:59 AM
is this a common problem for people, or if u no how to fix it can u look at my fla?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.