Page 1 of 1

Collision Detection Without Objects Moving Each Other?

Posted: Tue Jan 24, 2012 9:05 pm
by joey_green
I'm working on a prototype and am wanting to know when two game objects are touching each other. For instance, a character collecting stars for points. I don't need any physics for something like this, I just need to know when they are touching each other.

Does love have something like this built in?

I've used Box2d in Cocos2d and there's something called a sensor that does something like this in Cocos2D. I'm looked for this in love but can't find anything.

Any ideas or should I roll my own solution?

Re: Collision Detection Without Objects Moving Each Other?

Posted: Tue Jan 24, 2012 9:09 pm
by tentus
If you're just looking for detection I'd recommend HardonCollider, a collision detection library for Love.

Re: Collision Detection Without Objects Moving Each Other?

Posted: Tue Jan 24, 2012 10:14 pm
by bartbes
joey_green wrote:there's something called a sensor that does something like this in Cocos2D.
Box2D has those too, and therefore, so does love.physics.

Here we go: Shape:setSensor

Re: Collision Detection Without Objects Moving Each Other?

Posted: Wed Jan 25, 2012 6:18 am
by ivan
It should be noted that Box2D (2.0.1 not sure about later versions) doesn't report collisions between 2 static shapes.