This should be a very easy question, basically I have two squares, and I'm trying to see if they overlap. So far I've figured out the right and bottom collisions, but I can't figure out collisions from the left and top. Here's my code:
if (e.getX() >= player.getX() && e.getX() <= player.getX() + Entity.SIZE && e.getY() >= player.getY() && e.getY() <= player.getY() + Entity.SIZE) {
return true;
Let e be the entity that I'm checking and Entity.SIZE be the size for both the squares. What am I doing wrong?