For starters, how can I use defineCollisionRectangle API?
I've done some research about it and I think it doesn't have any use at all.
True that I can just use collidesWith()
to check if 2 sprites collide.
But what I want to use a sprite that has parameters like house with a backyard fence around it.
I tried using the defineCollisionRectangle()
in a condition, set it in the constructor but I don't know how to use it.
I can just use object.getX/gety
and object.getWidth/getHeight
, to make a Parameter around the sprite.
What does defineCollisionRectangle
really do and how do I use it?