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;
		}
	}

What is the problem here? Could you give us some more detail as to what you are trying to have happen.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.