private void setPath(){
        ArrayList <ArrayList <Integer>> finalPath = new ArrayList <ArrayList <Integer>>();
        if (flyingLevel){   //flying level path is always the same
            finalPath = flyingPath;
        }
        else{
            //generates the 3 paths for each checkpoint
            finalPath.add (pf1.generatePath());       
            finalPath.add (pf2.generatePath());
            finalPath.add (pf3.generatePath());
        }

        for (int Y = 0; Y < map.length; Y++){
            for (int X = 0; X < map[0].length; X++){
                map [Y][X].reset();
            }
        }

        for (int n = 0; n < 3; n++){
            ArrayList<Integer> tempPath = finalPath.get (n);
            for (int i = tempPath.size()-1; i >=0 ;i--){            
                int tempY = tempPath.get (i);
                i--;
                int tempX = tempPath.get (i);

                //changes the id of the tile so it is walkable
                map [tempY][tempX].setId (1);

                //setting the direction for the tiles if its not the last tile
                if (i >= 2){
                    int tempPathX = tempPath.get (i-2);
                    int tempPathY = tempPath.get (i-1);

                    int movementX = tempPathX - tempX;
                    int movementY = tempPathY - tempY;
                    map[tempY][tempX].setMovement (movementX, movementY, n);
                }
            }
        }
        map[endYf][endXf].setMovement(true);
    }