You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc says anySprite.circular = true; will make the sprite be interpreted as circular. In fact it doesn't work. I notice there's a block in the source code:
if (aIsASprite && bIsASprite) {
//Yes, but what kind of sprites?
if (a.diameter && b.diameter) {
//They're circles
return circleVsCircle(a, b);
} else if (a.diameter && !b.diameter) {
//The first one is a circle and the second is a rectangle
return circleVsRectangle(a, b);
} else {
//They're rectangles
return rectangleVsRectangle(a, b);
}
}
It seems that the function hit uses diameter as the flag of circle rather than circular. After my testing ,anySprite.diameter= true; works well.
It seems that function movingCircleCollision works well----I mean both the circles move when they hit each other. But rectangleCollision and circleRectangleCollision won't move the second sprite passed into function. Is that a bug?
P.S. I have passed the correct parameters, the call seems like this: b.hit(circle, rect, true, true);
The text was updated successfully, but these errors were encountered:
anySprite.circular = true;
will make the sprite be interpreted as circular. In fact it doesn't work. I notice there's a block in the source code:It seems that the function
hit
usesdiameter
as the flag of circle rather thancircular
. After my testing ,anySprite.diameter= true;
works well.movingCircleCollision
works well----I mean both the circles move when they hit each other. ButrectangleCollision
andcircleRectangleCollision
won't move the second sprite passed into function. Is that a bug?P.S. I have passed the correct parameters, the call seems like this:
b.hit(circle, rect, true, true);
The text was updated successfully, but these errors were encountered: