@@ -176,13 +176,13 @@ const game = (getBallLevel, sleepFunction, gameBoard) => {
176176 return [ ...dots ]
177177 }
178178
179- function cleanupDots ( dots , cb ) {
179+ function cleanupDots ( dots ) {
180180 const map = { }
181181 const keep = { }
182182 for ( let i = 0 ; i < 7 ; i ++ ) {
183183 map [ i ] = { }
184184 keep [ i ] = { }
185- for ( let j = - 1 ; j < 7 ; j ++ ) {
185+ for ( let j = - 2 ; j < 7 ; j ++ ) {
186186 map [ i ] [ j ] = null
187187 keep [ i ] [ j ] = true
188188 }
@@ -198,9 +198,9 @@ const game = (getBallLevel, sleepFunction, gameBoard) => {
198198 map [ d . x >= 6 ? 6 : d . x + 1 ] [ d . y ] ,
199199 map [ d . x <= 0 ? 0 : d . x - 1 ] [ d . y ] ,
200200 map [ d . x ] [ d . y >= 6 ? 6 : d . y + 1 ] ,
201- map [ d . x ] [ d . y <= 0 ? 0 : d . y - 1 ]
201+ map [ d . x ] [ d . y <= - 1 ? - 1 : d . y - 1 ]
202202 ]
203- . filter ( n => n && n . type === d . type )
203+ . filter ( n => n && n . type === d . type && n . key !== d . key )
204204 . reduce ( ( l , d ) => l . concat ( checkTile ( d ) ) , [ d ] )
205205 }
206206
@@ -223,7 +223,7 @@ const game = (getBallLevel, sleepFunction, gameBoard) => {
223223 ball ( newColoredDot . x , newColoredDot . y , newColoredDot . type + 1 )
224224 )
225225 }
226- l . forEach ( ( d , i ) => {
226+ l . forEach ( ( d ) => {
227227 keep [ d . x ] [ d . y ] = false
228228 updateScore ( state . score + ( newColoredDot . type + 1 ) * 5 )
229229 } )
0 commit comments