Tuesday, 29 January 2013

#3.7 Tutorial (LibGDX & MTX) Test_06_CollisionDetection

Some developers may need collision detection for actors.


Collision detection is very simple, nothing complicated or impressive about it. I created a class CollisionDetector which has only one method at the moment (it will be improved more in the future)  to detect collision of two actors from their rectangles, and returns true or false

        CollisionDetector.getActorsCollisionFromRectangles(Actor a1, Actor a2) 

In my example I created two actors (a1 and a2), I created checkCollision() method which constantly check collision in render().

1 comment:

  1. Hello , what if you use box2d with mtx ? is it possible to integrate actors with box2d ?
    and thanks