I really like the idea for fast and simple collision detection. I’m testing the library around but I’m having mixed success.
At first, it took me a while to figure out that it requires Lodash to work. I’m new to Javascript so I’m pretty happy to make silly mistakes. Even after I’ve added lodash.js to the project, I cannot parse the updated collisiondetection.js script without first removing the " _.extend(CollisionDetection.prototype, {…} )" block and then returning it.
In the documentation, we have the simplest example for collision detection with:
Explode.prototype = { colliding: function(other)
With the new scripting system, I’ve tried to use:
Explode.prototype.colliding = function(other) but I’m always getting undefined for other.
I’ve had a similar issue as Pako_St re: underscore, but declaring it as a var if it didn’t exist got around that. I’m not sure why load order didn’t solve the issue, though.
I am having other issues with the new version. If I attach the collisiondetection.js script and a simplebody.js to an object, the browser just hangs and eventually crashes. I’m not seeing this problem with the previous version that used the legacy script system.
Is there a working example of the latest version of your scripts? I tried to follow your links to the github repository, but I’m getting rejected (non-existent or permissions?).
Sorry! I’m still primarily using the legacy version because I need source code control - so I’ve probably not done anywhere near as much testing as I should!