public void loadMap(String file) {
        InputStream in = getClass().getResourceAsStream("/maps/" + file + ".map");
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        try {
            this.cols = Integer.parseInt(br.readLine());
            this.rows = Integer.parseInt(br.readLine());
            this.map = new int[rows][cols];
            this.width = cols * tileSize;
            this.height = rows * tileSize;
            this.xMin = Game.WIDTH - width;
            this.xMax = 0;
            this.yMin = Game.HEIGHT - height;
            this.yMax = 0;
            
            String delim = "\\s+";
            for (int row = 0; row < rows; row++) {
                String line = br.readLine();
                String[] tokens = line.split(delim);
                for (int col = 0; col < cols; col++)
                    map[row][col] = Integer.parseInt(tokens[col]);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }