Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 2827 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:

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.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!