I am confused on how to get my x and y coodrdinates to overalap. Can you please help me or give me an example of how to do so. This is the code that I have so far:
public boolean hitBy = true;
public boolean hitBy(Bullet b) {
// PUT YOUR CODE HERE
EXPLOSION.playSound();
}
public int getHeight() {
return SPRITE.getHeight();
}
public int getWidth() {
return SPRITE.getWidth();
}
public double getUpperLeftX() {
return upperLeftX;
}
public void setUpperLeftX(int x) {
upperLeftX = x;
}
public double getUpperLeftY() {
return upperLeftY;
}
public void setUpperLeftY(int y) {
upperLeftY = y;
}
}