mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 04:56:15 -04:00
N hits : reset as soon as you break more bricks that demanded
This commit is contained in:
parent
4710eaa152
commit
8b8e49595d
2 changed files with 12 additions and 2 deletions
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue