3 ms·
It's very simple and lightweight, however collision code is very naive: if (obj1BoundingBox === this.RECTANGLE && obj2BoundingBox === this.RECTAN
by ghostdiver 13y ago
It's very simple and lightweight, however collision code is very naive:
if (obj1BoundingBox === this.RECTANGLE &&
obj2BoundingBox === this.RECTANGLE)
return Maths.rectanglesIntersecting(obj1, obj2);
which means it will not work for moving objects
- adam-a 13y agoIt means it won't work for very fast moving objects. For most purposes this type of collision is fine. It's a lot quicker too - doing line intersections for every potential collision is quite intensive. Often it's best to reserve more thorough checks for objects like bullets which you know will be moving fast.
- ghostdiver 13y agoIt is not like you can implement collision resolving system ad hoc as a plugin or extension if base code does not offer you some proper foundation.