Yes, I agree. It is on the todo list (support sprites of different sizes). Until then, I think the code is more or less equivalent.

> On Apr 30, 2014, at 11:42 AM, breville <notifications@github.com> wrote:
> 
> In src/studio/studio.js:
> 
> >                             tiles.SPRITE_COLLIDE_DISTANCE) &&
> > -          essentiallyEqual(Studio.sprite[i].y,
> > -                           Studio.sprite[j].y,
> > +          essentiallyEqual(getNextPosition(i, true),
> > +                           getNextPosition(j, true),
> >                             tiles.SPRITE_COLLIDE_DISTANCE)) {
> >          if (0 === (Studio.sprite[i].collisionMask & Math.pow(2, j))) {
> Is this kind of collision detection (essentiallyEqual) slightly fragile? especially if we end up with different sized sprites? I have always used this to determine a collision between two rectangles:
> 
> function Collide(x1, y1, w1, h1, x2, y2, w2, h2)
> {
>   // detect a non-collision.  Otherwise we have a collision.
>   if (x1 + w1 - 1 < x2 ||
>       x1 > x2 + w2 - 1 ||
>       y1 + h1 - 1 < y2 ||
>       y1 > y2 + h2 - 1)
>     return false;
>   return true;
> }
> —
> Reply to this email directly or view it on GitHub.