Closed samuel-massinon closed 8 years ago
No, that's how we add libraries, by adding them to the project in /lib. There is a post about how other projects add libraries here: http://nolanlawson.com/2015/10/19/the-struggles-of-publishing-a-javascript-library/ Just looking at the length of the article may give you a hint why we don't do things that way.
This particular library gives me a sense of deja vu. We used to include SAT. Nothing wrong with that, when I rewrote Waterbear to use custom elements I pulled out everything I could until it could earn its way back in. If we're going to include SAT, perhaps we should use it more (I believe it has a good implementation of vectors, for instance, that we could replace our implementation with).
Do you have any idea how we can write automated tests for collisions?
My comments above are more food for thought than anything else. This looks good. :shipit:
I'm not sure how easy it would be to replace our current vector implementation with SAT but I could look into it more. I'm wrestling with trying to make our current code work with SAT but it might be a good idea to try to replace some parts of it with SAT instead.
For testing, I think we could easy make up objects, do the math to see if they collide or not and run the tests according to that.
Forgot to reference this issue https://github.com/waterbearlang/waterbear/issues/1207
I've tested out collision with this library and it seems to work pretty good.
https://github.com/jriecken/sat-js
Is there a better way to add a library to project or is what I did fine?