ESP32 Display Controller and Graphics Library

◆ detectCollision() [1/2]

Sprite * detectCollision ( Sprite sprite,
bool  removeCollidingSprites = true 

Detects first collision with the specified sprite.

It is necessary to call CollisionDetector.update() before detectCollision() so sprites position and size are correctly updated.

spriteThe sprite to detect collision.
removeCollidingSpritesIf true the collided sprites are automatically removed from the collision detector.
The other sprite that collided with the specified sprite.

Definition at line 427 of file collisiondetector.cpp.