my codes for the game is like this
if(spriteA.collidesWith(bulletImage, 18,18, true))
the bulletImage just overlaps the sprite image
the 18 is the pixel size of the bulletImage.
Did i use this right?
public final boolean collidesWith(Sprite s,
Checks for a collision between this Sprite and the specified Sprite.
If pixel-level detection is used, a collision is detected only if opaque pixels collide. That is, an opaque pixel in the first Sprite would have to collide with an opaque pixel in the second Sprite for a collision to be detected. Only those pixels within the Sprites' respective collision rectangles are checked.
If pixel-level detection is not used, this method simply checks if the Sprites' collision rectangles intersect.
Any transforms applied to the Sprites are automatically accounted for.
Both Sprites must be visible in order for a collision to be detected.
s - the Sprite to test for collision with
pixelLevel - true to test for collision on a pixel-by-pixel basis, false to test using simple bounds checking.
true if the two Sprites have collided, otherwise false
NullPointerException - if Sprite s is null
(Note that is from the first Google result).