private Spatial isColliding(Spatial spatial) {
        ArrayList<PhyInfo> spatialsInRange = getAllSpatialsWithinRange(spatial);
        if (spatialsInRange == null || spatialsInRange.isEmpty()) {
            return null;
        }
        for (int i = 0; i < spatialsInRange.size(); i++) {
            Spatial oppositeSpatial = spatialsInRange.get(i).spatial;
            float distance = spatialsInRange.get(i).distance;

            if (oppositeSpatial.getCollisionShape().equals("circle")) {
                if (spatial.getW() > oppositeSpatial.getW()) {
                    if (distance < spatial.getW() + 2) {
                        spatial.setSpatialColided(oppositeSpatial);
                        return oppositeSpatial;
                    }
                } else {
                    if (distance < oppositeSpatial.getW() + 2) {
                        spatial.setSpatialColided(oppositeSpatial);
                        return oppositeSpatial;
                    }
                }

            } else {
                boolean xIntersect = rangesIntersect(
                        spatial.getLocation().x,
                        spatial.getLocation().x + spatial.getW(),
                        oppositeSpatial.getLocation().x,
                        oppositeSpatial.getLocation().x + oppositeSpatial.getW());

                boolean yIntersect = rangesIntersect(
                        spatial.getLocation().y,
                        spatial.getLocation().y + spatial.getH(),
                        oppositeSpatial.getLocation().y,
                        oppositeSpatial.getLocation().y + oppositeSpatial.getH());

                if (xIntersect && yIntersect) {
                    spatial.setSpatialColided(oppositeSpatial);
                    return oppositeSpatial;
                }
            }

        }
        return null;
    }