mine/js/game.js
function _empty( x, y, force ) {
            if ( x < 0 || x >= that.width || y < 0 || y >= that.height ) return;

            var pos = that.pos(x, y);
            var d = that.grid[pos];

            if (d && (d & SLAB_MASK) && (force || !(d & APPLE_MASK))) {

                that.grid[pos] &= ~SLAB_MASK; // clear out slab

                // Clear next neighbor if this is empty tile
                if (that.grid[pos] == 0) {
                    _empty(x, y - 1) // north
                    _empty(x, y + 1) // south
                    _empty(x - 1, y) // west
                    _empty(x - 1, y - 1) // north west
                    _empty(x - 1, y + 1) // south east
                    _empty(x + 1, y) // east
                    _empty(x + 1, y - 1) // north east
                    _empty(x + 1, y + 1) // south east
                }
            }
        }
function _empty( x, y, force ) {
            if ( x < 0 || x >= that.width || y < 0 || y >= that.height ) return;

            var pos = that.pos(x, y);
            var d = that.grid[pos];

            if (d && (d & SLAB_MASK) && (force || !(d & APPLE_MASK))) {

                that.grid[pos] &= ~SLAB_MASK; // clear out slab

                // Clear next neighbor if this is empty tile
                if (that.grid[pos] == 0) {
                    _empty(x, y - 1) // north
                    _empty(x, y + 1) // south
                    _empty(x - 1, y) // west
                    _empty(x - 1, y - 1) // north west
                    _empty(x - 1, y + 1) // south east
                    _empty(x + 1, y) // east
                    _empty(x + 1, y - 1) // north east
                    _empty(x + 1, y + 1) // south east
                }
            }
        }
function _empty ( x , y , force ) { if ( x < 0 || x >= that . width || y < 0 || y >= that . height ) return ; var pos = that . pos ( x , y ) ; var d = that . grid [ pos ] ; if ( d && ( d & SLAB_MASK ) && ( force || ! ( d & APPLE_MASK ) ) ) { that . grid [ pos ] &= ~ SLAB_MASK ; // clear out slab // Clear next neighbor if this is empty tile if ( that . grid [ pos ] == 0 ) { _empty ( x , y - 1 ) // north _empty ( x , y + 1 ) // south _empty ( x - 1 , y ) // west _empty ( x - 1 , y - 1 ) // north west _empty ( x - 1 , y + 1 ) // south east _empty ( x + 1 , y ) // east _empty ( x + 1 , y - 1 ) // north east _empty ( x + 1 , y + 1 ) // south east } } }
Check where click hit Recursive function to clear empty areas
Check where click hit Recursive function to clear empty areas