This content has been marked as final. Show 5 replies
what doesn't work like it should? are you getting any compiler errors or runtime errors?
No errors reported. I compiled both sample FLAs he provided and they run, but no collision is triggered like in the provided SWFs. Dragging the ball in the first one never makes the maze shape turn red, and the balls in the second one float right over the spinning shape without exploding.
I gotta get the detection working by Monday am. Would hitTest work instead for an oval?
it may be that you do not have Grant's collisionDetection class file within the folder.
however, yes for your situation it's most likely that you can use the native Flash hitTest method with a shpae flag for what you would like to do here. since really you only need to to test a single 'point' (eg. the tip of the dart) against the balloon instances. the easiest way to do so would be to have your darts set up so that the registration point is at the tip - then of course you can rotate the dart to a trailing position on the flight path with a bit of math. but setting the registration at the tip is important because you can then simply use the x/y coordinates of the dart in the hitTest method - while iterating through the balloon instances in the field - all of course within a loop during the dart's flight.
here's some discussion on the native Flash hitTest methods: HERE
I had rejected hitTest as a viable option because it looked like I was getting bounding box testing rather than shape testing, even when setting the shapeflag. But after seeing the previous post and trying again, I figured out that the positive results were because the transparent areas of my png were not transparent to hitTest. Kinda like bumping into Wonder Woman's invisible jet....
Testing on a round flash shape worked. So for what it's worth, don't anyone else expect non-visible areas of a png to return false with hitTest. I worked around this issue and am happily coding on!
I am working over the collision between balls. Using native functions detects the object and has oriented bounding box. so the collision looks bad. help me with some feeds for implementing an optimised collision !