my_mc.hitTestPoint(mouseX,mouseY,true);
i get that when ever that the mouse comes into contact with anything inside my_mc that not part of the alpha channel if gives a return of "true" (at lest i think that's how it works)
but what i want is a MC to a MC test and i havnt yet found any thing on google that helps and i dnt know how to search the forums.
so what i think the format is
my_mc1.hitTestPoint(my_mc2.x,mymc2.y,true);
but that didnt seem to work, so what am i doing wrong or even am i in the ballpark form what i tried.
AS3 HitTestPoint
Page 1 of 17 Replies - 1443 Views - Last Post: 13 May 2011 - 11:27 AM
Replies To: AS3 HitTestPoint
#2
Re: AS3 HitTestPoint
Posted 11 May 2011 - 11:22 PM
flash does not have a built in pixel perfect collision test between two Sprites (or MovieClips). You can only test if their bounding boxes are overlapping.
People have created their own methods of doing the test using various collision algorithms. They are more complex and can't really be accomplished in 1 or 2 lines of code.
People have created their own methods of doing the test using various collision algorithms. They are more complex and can't really be accomplished in 1 or 2 lines of code.
#3
Re: AS3 HitTestPoint
Posted 12 May 2011 - 03:47 AM
ok what if i turn both my images into bitmap data, have a test for oject1 that all non-alpha points and test once it hits object2 to also find non-alpha point is that do able or am i talking out my ass now
#4
Re: AS3 HitTestPoint
Posted 12 May 2011 - 05:40 AM
ok forget what i asked by can i do a hitTest of a mc that is a child of a child of a child of a parent
-----Main------
HitTestImg............child
......................child
......................Other HitTestImg
-----Main------
HitTestImg............child
......................child
......................Other HitTestImg
This post has been edited by NiteFlame: 12 May 2011 - 05:41 AM
#5
Re: AS3 HitTestPoint
Posted 12 May 2011 - 08:18 AM
Yes...you can. That is a technique widely used when you want a large body to have specific points for hitTest. In that you add small movieclips inside the large one and use them to check collision.
#6
Re: AS3 HitTestPoint
Posted 12 May 2011 - 11:13 AM
well i was looking into somethings and it looks like if i use local to global for my bullets i can use the hitTest withing my plane class hopefully any ways
#7
Re: AS3 HitTestPoint
Posted 12 May 2011 - 08:26 PM
If you are interested in Pixel Perfect Collision as it's called, you can check out this code :
Pixel Perfect Collision
Pixel Perfect Collision
#8
Re: AS3 HitTestPoint
Posted 13 May 2011 - 11:27 AM
Prototypical, on 12 May 2011 - 10:26 PM, said:
If you are interested in Pixel Perfect Collision as it's called, you can check out this code :
Pixel Perfect Collision
Pixel Perfect Collision
that was exactly what i needed thanks
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|