Crafty Blog - JavaScript Game Engine Development

Development of Crafty

0 notes &

Insanely Great Collision Detection

I have just successfully finished implementing the new and improved collision component using the Separating Axis Theorem. Was quite a challenge to learn but it works.

I was thinking about writing a tutorial on it so if anyone is interested, let me know.

The way to use it is to add the collision component, call the .collision() constructor with a polygon (using new Crafty.polygon()), then use the method .hit() or onhit() with a component.