This commit is contained in:
Renan LE CARO 2025-04-24 14:20:24 +02:00
parent 0035a9abb5
commit f48d9bdfa3
4 changed files with 68 additions and 75 deletions

View file

@ -18,7 +18,7 @@ Break colourful bricks, catch bouncing coins and select powerful upgrades !
## Done
- rename hypnosis to golden_goose, apply when hitting any brick
- rename hypnosis to golden_goose, apply when hitting any brick, any side at level 2
- removed comboIncreaseTexts option
- minefield : +10% coins per bomb on screen
- extra life are transparent when you have 2+ balls

50
dist/index.html vendored

File diff suppressed because one or more lines are too long

View file

@ -284,7 +284,7 @@ export function offsetCombo(
}
export function spawnExplosion(
export function spawnParticlesExplosion(
gameState: GameState,
count: number,
x: number,
@ -311,7 +311,7 @@ export function spawnExplosion(
}
}
export function spawnImplosion(
export function spawnParticlesImplosion(
gameState: GameState,
count: number,
x: number,
@ -375,9 +375,9 @@ export function explosionAt(
gameState.lastExplosion = gameState.levelTime;
if (gameState.perks.implosions) {
spawnImplosion(gameState, 7 * size, x, y, "#FFFFFF");
spawnParticlesImplosion(gameState, 7 * size, x, y, "#FFFFFF");
} else {
spawnExplosion(gameState, 7 * size, x, y, "#FFFFFF");
spawnParticlesExplosion(gameState, 7 * size, x, y, "#FFFFFF");
}
gameState.runStatistics.bricks_broken++;
@ -513,11 +513,9 @@ export function explodeBrick(
schedulGameSound(gameState, "colorChange", ball.x, 0.8);
// gameState.lastExplosion = gameState.levelTime;
gameState.ballsColor = color;
if (!isOptionOn("basic")) {
gameState.balls.forEach((ball) => {
spawnExplosion(gameState, 7, ball.previousX, ball.previousY, color);
spawnParticlesExplosion(gameState, 7, ball.previousX, ball.previousY, color);
});
}
} else {
schedulGameSound(gameState, "comboIncreaseMaybe", ball.x, 1);
}
@ -536,7 +534,7 @@ export function explodeBrick(
);
}
// Particle effect
spawnExplosion(gameState, 5 + Math.min(gameState.combo, 30), x, y, color);
spawnParticlesExplosion(gameState, 5 + Math.min(gameState.combo, 30), x, y, color);
}
if (
@ -731,7 +729,7 @@ const rainbow = [
"#70ff33",
"#33ffa7",
"#38acff",
"#7038ff",
"#6262EA",
"#ff3de5",
];
@ -1206,9 +1204,8 @@ export function gameStateTick(
if (coin.vx > 0) {
coin.vx *= -1;
}
if (!isOptionOn("basic")) {
spawnExplosion(gameState, 3, coin.x, coin.y, "#6262EA");
spawnImplosion(
spawnParticlesExplosion(gameState, 3, coin.x, coin.y, "#6262EA");
spawnParticlesImplosion(
gameState,
3,
coin.previousX,
@ -1216,7 +1213,6 @@ export function gameStateTick(
"#6262EA",
);
}
}
if (
gameState.perks.wrap_right > 1 &&
@ -1229,9 +1225,8 @@ export function gameStateTick(
if (coin.vx < 0) {
coin.vx *= -1;
}
if (!isOptionOn("basic")) {
spawnExplosion(gameState, 3, coin.x, coin.y, "#6262EA");
spawnImplosion(
spawnParticlesExplosion(gameState, 3, coin.x, coin.y, "#6262EA");
spawnParticlesImplosion(
gameState,
3,
coin.previousX,
@ -1239,7 +1234,6 @@ export function gameStateTick(
"#6262EA",
);
}
}
if (
coin.previousY < gameState.gameZoneHeight &&
@ -1352,9 +1346,14 @@ export function gameStateTick(
}
if (gameState.perks.golden_goose && typeof hitBrick !== "undefined") {
if ((gameState.perks.golden_goose && typeof hitBrick !== "undefined") || (gameState.perks.golden_goose > 1 && hitBorder)) {
const closestBall = getClosestBall(gameState, coin.x, coin.y);
if (closestBall) {
spawnParticlesExplosion(gameState, 3, coin.x, coin.y, "#6262EA");
spawnParticlesImplosion(gameState, 3, closestBall.x,
closestBall.y,
"#6262EA",
);
coin.x = closestBall.x;
coin.y = closestBall.y;
}
@ -1734,10 +1733,10 @@ export function ballTick(gameState: GameState, ball: Ball, frames: number) {
ball.vx *= -1;
}
if (!isOptionOn("basic")) {
spawnExplosion(gameState, 7, ball.x, ball.y, "#6262EA");
spawnImplosion(gameState, 7, ball.previousX, ball.previousY, "#6262EA");
}
spawnParticlesExplosion(gameState, 7, ball.x, ball.y, "#6262EA");
spawnParticlesImplosion(gameState, 7, ball.previousX, ball.previousY, "#6262EA");
}
if (
@ -1752,10 +1751,10 @@ export function ballTick(gameState: GameState, ball: Ball, frames: number) {
if (ball.vx < 0) {
ball.vx *= -1;
}
if (!isOptionOn("basic")) {
spawnExplosion(gameState, 7, ball.x, ball.y, "#6262EA");
spawnImplosion(gameState, 7, ball.previousX, ball.previousY, "#6262EA");
}
spawnParticlesExplosion(gameState, 7, ball.x, ball.y, "#6262EA");
spawnParticlesImplosion(gameState, 7, ball.previousX, ball.previousY, "#6262EA");
}
if (

View file

@ -316,7 +316,7 @@
"upgrades.ghost_coins.verbose_description": "It's not a bug, it's a feature ! Coins fly through bricks slowly. Higher levels let them move faster. ",
"upgrades.golden_goose.name": "Golden goose",
"upgrades.golden_goose.tooltip": "Coins teleport to the ball after hitting a brick",
"upgrades.golden_goose.verbose_description": "Whenever a coin hits a brick, teleport that coin to the nearest ball.",
"upgrades.golden_goose.verbose_description": "Whenever a coin hits a brick, teleport that coin to the nearest ball. At level two, coins teleport after hitting a side too.",
"upgrades.happy_family.name": "Happy family",
"upgrades.happy_family.tooltip": "More coins if you keep all balls in game. ",
"upgrades.happy_family.verbose_description": "+1 combo per extra ball per paddle bounce. Combo resets when a ball is lost. Only the ball above 1 give combo.",
@ -451,10 +451,10 @@
"upgrades.wind.verbose_description": "Wind depends on paddle position: left blows left, right blows right. Affects both balls and coins.",
"upgrades.wrap_left.name": "Wrap left",
"upgrades.wrap_left.tooltip": "Hitting the left side teleports the ball to the right side",
"upgrades.wrap_left.verbose_description": "Teleporting will NOT count as a right side bounce. Higher levels might teleport coins too.",
"upgrades.wrap_left.verbose_description": "Higher levels teleport coins too.",
"upgrades.wrap_right.name": "Wrap right",
"upgrades.wrap_right.tooltip": "Hitting the right side teleports the ball to the left side",
"upgrades.wrap_right.verbose_description": "Teleporting will NOT count as a left side bounce. Higher levels might teleport coins too",
"upgrades.wrap_right.verbose_description": "Higher levels teleport coins too.",
"upgrades.yoyo.name": "Yo-yo",
"upgrades.yoyo.tooltip": "The ball falls toward the paddle",
"upgrades.yoyo.verbose_description": "It's the opposite of telekinesis, control the ball while it's falling back down.",