private void generate(){        
        for (int y = 0; y < map.length; y++){
            for (int x = 0; x < map[0].length; x++){
                map [y][x] = new Tile(x, y, this);
                addObject (map[y][x], x*20+10 + leftSpace, y*20+10 + topSpace);
            }
        }
        map[endYf][endXf].setMovement(true);

        //sets the special colors
        map [startX][startY].setId (2, true);
        map [endY1][endX1].setId (3, true);
        map [endY1][endX2].setId (3, true);
        map [endYf][endXf].setId (4, true);
    }