The collidesWith() method is a method of the Sprite class. It is used to check the collision of this Sprite with a specified Sprite. The general syntax of this method is as follows:
Here, sprite is the instance of the Sprite class to test the collision with another Sprite.
The pixellevel parameter takes either true or false value. It takes true to test for collision on a pixel-by-pixel basis, and false to test using simple bounds checking.
This method returns true if two Sprites have collided, else it returns false.
Download practice question and study guide for scmad for exam. Become SUN SCMAD Mobile Application Developer certified.