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.
Become SUN SCMAD certified. Become SUN SCMAD Mobile Application Developer certified.If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
