ippa / jaws

Jaws - HTML5 canvas javascript 2D Game Framework
https://jawsjs.ippa.se
GNU Lesser General Public License v3.0
364 stars 75 forks source link

Remove SpriteList, fix for collide(list, list) #103

Closed videlais closed 11 years ago

videlais commented 11 years ago

This removes the SpriteList instance and makes it just an array. This also adds another array, sprites2, to use for the collide(list, list) testing.

It turns out that in some browsers (notably IE and Safari), the testing would register twice. First, with the right values and then again with the false ones. Firefox and Chrome would take the first result and IE and Safari (and possibly others) would take the second.

ippa commented 11 years ago

I think Quadtree.collide(list, list) is a usecase that should work, see mail for more details.

ippa commented 11 years ago

After out discussions I'll merge this for now, nice with passing tests in all browsers. We'll think further on exactly how we should move forward with the jaws.collide - quadtree.collide thingie.

I saw you had a working version of quadtree with combination()-call .. but you think it was a lot slower, which might not be so nice either :P. Maybe a benchmark later on. I always had the feeling that jaws.collide got Faster with combination()... cause I was causing a whole lot less callbacks happening. But I should benchmark that too.

ippa commented 11 years ago

also, nice to get rid of one more SpriteList :)