How to detect Actor collisions using libgdx and build in box2d?

Started by
-1 comments, last by Afesh 12 years, 2 months ago
Hi there,
I'm trying to develop my first game for Windows and Android.
After reading a bit about available options i decided that for those given platforms the best choice would be Java + libgdx.
As for my first 2d game it will be simple clone of Missile Command :-).

For now I have some missiles which can be launched to a specific target location (mouse click) with certain speed in pixels/second.
After the missile reaches target it creates Explosion object (Actor) on the screen in given location and the Explosion itself grows until max radius is reached.

I would like to detect collisions between 2 pairs of objects Explosion <-> EnemyMissile and EnemyMissile <-> Building.

I found some tutorials suggesting extending class b2ContactListener in here:
http://blog.allanbishop.com/box2d-2-1a-tutorial-%E2%80%93-part-4-collision-detection/
and
http://box2d.org/forum/viewtopic.php?f=8&p=27546#p27546

But I can't find the b2ContactListener, b2World etc...

Can someone point me to a tutorial or some sources using collision detection in Java with libgdx?

If any more info is needed from my side, please let me know.

Regards
Afesh

This topic is closed to new replies.

Advertisement