public void readFile() {
        int i = 0;
        int j = 0;
        Scanner read = null;
        try {
            
            //se for executar pelo jar, colocar o jar ao lado da pasta res com a mapa dentro dessa pasta
//          read = new Scanner(new File("res/map1.txt")); 
            read = new Scanner(new File(this.getClass().getResource("map1.txt").getFile())); // se for executar pelo netbeans
        } catch (FileNotFoundException ex) {
            ex.printStackTrace();
        }
        while (read.hasNextLine()) {
            String tile = read.nextLine();
            String[] split = tile.trim().split(" ");
            int tipo = Integer.parseInt(split[0]);
            int x = Integer.parseInt(split[1]);
            int y = Integer.parseInt(split[2]);

            if (map[i] == null) {
                if (tipo == 1) {
                    map[i] = new Wall(x, y);
                } else if (tipo == 2) {
                    map[i] = new Wall2(x, y);
                } else if (tipo == 3) {
                    map[i] = new Base(x, y);
                }
            }
            i++;
        }
        read.close();
    }