private void openBlockData() throws IOException {
        String line;
        int x, y, level, zeroIndex;
        BufferedReader myfile;
        URL url;
        URLConnection connection;

        url = this.getClass().getResource("blockData.dat");

        connection = url.openConnection();
        myfile = new BufferedReader(new InputStreamReader(connection.getInputStream()));

        // the file begins with the number of different types of blocks at each difficulty level
        line = myfile.readLine();
        difficultyLevels = Integer.parseInt(line);
        for (int i = 0; i < difficultyLevels; i++) {
            line = myfile.readLine();
            numBlockTypes[i] = Integer.parseInt(line);
        }
        line = myfile.readLine();
        numSymbols = Integer.parseInt(line);

        level = 0;
        zeroIndex = Block.charToSymbol('0') + numBlockTypes[difficultyLevels - 1];

        // blank line before the block data
        line = myfile.readLine();

        for (int i = 0; i < numBlockTypes[difficultyLevels - 1] + numSymbols; i++) {
            blockData[i] = new Block();

            if (i >= numBlockTypes[difficultyLevels - 1])
                line = myfile.readLine();

            // the first two lines of this block's data record the starting position
            line = myfile.readLine();
            blockData[i].x = NUMCOLS/2 + Integer.parseInt(line);
            line = myfile.readLine();
            blockData[i].y = Integer.parseInt(line);
            // next, the number of squares in the block
            line = myfile.readLine();
            blockData[i].numSquares = Integer.parseInt(line);
            // read each square's local coordinates from memory
            for (int j = 0; j < blockData[i].numSquares; j++) {
                line = myfile.readLine();
                x = Integer.parseInt(line);
                line = myfile.readLine();
                y = Integer.parseInt(line);
                blockData[i].squares[j] = new Point(x, y);
            }
            // lastly, read the color
            if (i < numBlockTypes[difficultyLevels - 1]) {
                if (i > numBlockTypes[level])
                    level++;
                line = myfile.readLine();
                blockData[i].color[0] = colorCode(Integer.parseInt(line));
                blockData[i].color[1] = difficultyColor(blockData[i].color[0], level, difficultyLevels-1);
            } else {
                if ((zeroIndex <= i) && (i < zeroIndex + 10))
                    blockData[i].color[1] = difficultyColor(STAIRCASE, i-zeroIndex+1, difficultyLevels-1);
            }

            // record the block's height in blockData
            blockData[i].height = calculateBlockHeight(blockData[i]);

            // blank line after each block's data
            line = myfile.readLine();
        }

        // get data about any blocks that do not rotate
        line = myfile.readLine();
        x = Integer.parseInt(line);
        // there are x blocks that do not rotate - read their indices now
        for (int i = 0; i < x; i++) {
            line = myfile.readLine();
            blockData[Integer.parseInt(line)].rotates = false;
        }
        myfile.close();
    }