This commit is contained in:
Renan LE CARO 2025-03-24 12:53:09 +01:00
parent 8b8e49595d
commit 83d335b05e
6 changed files with 8 additions and 10 deletions

View file

@ -438,12 +438,11 @@ export function explodeBrick(
if (
gameState.perks.nbricks &&
ball.brokenSinceBounce == gameState.perks.nbricks+1
ball.brokenSinceBounce == gameState.perks.nbricks + 1
) {
resetCombo(gameState, ball.x, ball.y);
}
if (!isExplosion) {
// color change
if (
@ -1445,7 +1444,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
}
if (
gameState.perks.nbricks &&
ball.brokenSinceBounce< gameState.perks.nbricks
ball.brokenSinceBounce < gameState.perks.nbricks
) {
resetCombo(gameState, ball.x, ball.y);
}
@ -1561,7 +1560,6 @@ 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 &&