louisstow/Crafty — Issue #203: Collision Circle Bug
Author: dbsleiman
Created: 2012-02-03 16:49:12+00:00
State: open

I'm not sure if it's a bug or just my misunderstanding of how to use it, but it seems that if you pass a circle to the collision constructor, no matter what values you pass for the x and y of the circle, it is always drawn at 0,0 relative to the entity. According to the documentation, this shouldn't be the case:

When creating a circle for an entity, each point should be offset or relative from the entities x and y (don't include the absolute values as it will automatically calculate this).

I have managed to get around this by modified the following line of the collision constructor:

this.map.shift(area.x, area.y);

with

this.map.shift(area._x + (poly.x || 0), area._y + (poly.y || 0));