diff --git a/dist/index.html b/dist/index.html
index fe775d4..ed0efea 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -2754,6 +2754,7 @@ function explodeBrick(gameState, index, ball, isExplosion) {
else gameState.combo += gameState.perks.reach;
}
if (gameState.lastPuckMove && gameState.perks.passive_income && gameState.lastPuckMove > gameState.levelTime - 500 * gameState.perks.passive_income) resetCombo(gameState, x, y);
+ if (gameState.perks.nbricks && ball.brokenSinceBounce == gameState.perks.nbricks + 1) resetCombo(gameState, ball.x, ball.y);
if (!isExplosion) {
// color change
if ((gameState.perks.picky_eater || gameState.perks.pierce_color) && color !== gameState.ballsColor && color) {
@@ -3212,7 +3213,7 @@ function ballTick(gameState, ball, delta) {
}
if (gameState.perks.streak_shots) resetCombo(gameState, ball.x, ball.y);
if (gameState.perks.trampoline) gameState.combo += gameState.perks.trampoline;
- if (gameState.perks.nbricks && gameState.perks.nbricks !== ball.brokenSinceBounce) resetCombo(gameState, ball.x, ball.y);
+ if (gameState.perks.nbricks && ball.brokenSinceBounce < gameState.perks.nbricks) resetCombo(gameState, ball.x, ball.y);
if (gameState.perks.respawn) ball.hitItem.slice(0, -1).slice(0, gameState.perks.respawn).forEach(({ index, color })=>{
if (!gameState.bricks[index] && color !== "black") // respawns with full hp
setBrick(gameState, index, color);
diff --git a/src/gameStateMutators.ts b/src/gameStateMutators.ts
index d893f94..deb96bf 100644
--- a/src/gameStateMutators.ts
+++ b/src/gameStateMutators.ts
@@ -436,6 +436,14 @@ export function explodeBrick(
resetCombo(gameState, x, y);
}
+ if (
+ gameState.perks.nbricks &&
+ ball.brokenSinceBounce == gameState.perks.nbricks+1
+ ) {
+ resetCombo(gameState, ball.x, ball.y);
+ }
+
+
if (!isExplosion) {
// color change
if (
@@ -1437,7 +1445,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
}
if (
gameState.perks.nbricks &&
- gameState.perks.nbricks !== ball.brokenSinceBounce
+ ball.brokenSinceBounce< gameState.perks.nbricks
) {
resetCombo(gameState, ball.x, ball.y);
}
@@ -1553,6 +1561,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
const initialBrickColor = gameState.bricks[hitBrick];
ball.brokenSinceBounce++;
+
explodeBrick(gameState, hitBrick, ball, false);
if (
ball.sapperUses < gameState.perks.sapper &&