Collision detection is a key feature of the Game API, enabling the developers to quickly and easily determine whether two elements of a game have collided or not.
The collision detection methods are provided in the Sprite class, and they allow the developer to detect a collision between a Sprite and either a TiledLayer, an Image, or another Sprite.
Sprites have a defined collision rectangle that indicates the region to be included for collision detection. By default, this region corresponds to the overall bounds of the Sprite. However, it can be redefined to cover any rectangular region as needed.
A special collision rectangle allows areas of a Sprite to be excluded from the collision detection ...