public bool collidesRect(CGameObject aGameObject) { if (getX() + getLeftOffsetBoundingBox() < aGameObject.getX() + aGameObject.getWidth() - aGameObject.getRightOffsetBoundingBox() && getX() + getWidth() - getRightOffsetBoundingBox() > aGameObject.getX() + aGameObject.getLeftOffsetBoundingBox() && getY() + getTopOffsetBoundingBox() < aGameObject.getY() + aGameObject.getHeight() - aGameObject.getBottomOffsetBoundingBox() && getHeight() + getY() - getBottomOffsetBoundingBox() > aGameObject.getY() + aGameObject.getTopOffsetBoundingBox()) { return(true); } else { return(false); } }