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().
0 yorum:
Yorum Gönder