Open Cosmitar opened 10 years ago
Hi, I cannot say currently when I will have the time to look into this, but I have noted it for now and will take a look at it as soon as possible.
It also fails on scaleY = -1
.
Which becomes quite a bigger problem with the quick fix above (collisions are detected as if the object was not vertically scaled, which is the point of the patch, but gives wrong collision coordinates).
Another quickfix, with better results :
In _collisionDistancePrecheck = function(bitmap1,bitmap2)
:
Change the return value to:
return(Math.abs(b2.x - b1.x) < ir2.width * Math.abs(bitmap2.scaleX) + ir1.width * Math.abs(bitmap1.scaleX)
&& Math.abs(b2.y - b1.y) < ir2.height * Math.abs(bitmap2.scaleY) + ir1.height * Math.abs(bitmap2.scaleY))
Hi, im testing this great library playing with some sprites and I found that no collision is detected when I reflect the sprite with scaleX = -1 To solve and check this, I save and restore scaleX when it is = -1
I guess this is a bug. Hope this help!