Hi,

my question is about basically pixel level collision.

lets say I have two Image display objects and I get it's bitmap Data
respectively for the first one and the 2nd one.

Below is the code
----------------------------------------------
var shipBmpData:BitmapData = new
BitmapData(shipBox.width,shipBox.height,false,0);
shipBmpData.draw(shipBox);
var hitImageBmpData:BitmapData = new
BitmapData(shipBoxHit.width,shipBoxHit.height,false,0);
hitImageBmpData.draw(shipBoxHit);


if (hitImageBmpData.hitTest(new
Point(shipBoxHit.x,shipBoxHit.y),255,shipBmpData,new
Point(shipBox.x,shipBox.y),255))
{
Alert.show("final hit");
}
----------------------------------------------

I cannot understand why I can't exact pixel level detection. Basically
one of them is moving towards the other and when it is over it, it
should detect collision.

Can anyone give the correct way? I want to get a collision at pixel level.

Thanks in advance!



Reply via email to