public boolean isShipColliding(int loc){
        if((loc >= 0) && (loc < 5)){
            for(int i = 0; i < ships[loc].getLength(); i++){
                for(int a = 0; a < 5; a++){
                    if(a != loc){
                        if(ships[loc].getVertical()){
                            if(ships[a].occupiesSpace(ships[loc].getX(), ships[loc].getY() + i)){
                                return true;
                            }
                        }else{
                            if(ships[a].occupiesSpace(ships[loc].getX() + i, ships[loc].getY())){
                                return true;
                            }
                        }
                    }
                }
            }
        }
        return false;
    }