Fix : bg color of dollar level, puck width and coins centering

This commit is contained in:
Renan LE CARO 2025-03-02 09:14:39 +01:00
parent 81224f928d
commit 63973f2072
3 changed files with 26 additions and 19 deletions

View file

@ -125,10 +125,8 @@ If the app stutters, turn on "fast mode" in the settings to render a simplified
There's also an easy mode for kids (slower ball) and a color-blind mode (no color related game mechanics).
# Roadmap
The "engine" could be better
- apk version soft locks at start.
- replace "menu" by "L2/7" once you pass level 1
- shinier coins by applying glow to them ?
- ask for permanent storage
- It's a bit confusing at first to grasp that one upgrade is applied randomly at the start of the game

View file

@ -1999,10 +1999,19 @@ function render() {
ctx.globalCompositeOperation = "source-over";
const comboText = "x " + combo
const comboTextWidth = comboText.length * puckHeight / 2.6
drawCoin(ctx, 'gold', coinSize, puck - coinSize * 1.5 - comboTextWidth / 2, gameZoneHeight - puckHeight / 2, !level.black_puck ? '#FFF' : '#000', 0)
const comboTextWidth = comboText.length * puckHeight / 1.80
const totalWidth = comboTextWidth + coinSize * 2
const left = puck - totalWidth / 2
if (totalWidth < puckWidth) {
drawCoin(ctx, 'gold', coinSize, left + coinSize / 2, gameZoneHeight - puckHeight / 2, !level.black_puck ? '#FFF' : '#000', 0)
drawText(ctx, comboText, !level.black_puck ? '#000' : '#FFF', puckHeight,
puck - comboTextWidth / 2, gameZoneHeight - puckHeight / 2, true);
left + coinSize * 1.5, gameZoneHeight - puckHeight / 2, true);
} else {
drawText(ctx, comboText, !level.black_puck ? '#000' : '#FFF', puckHeight,
puck, gameZoneHeight - puckHeight / 2, false);
}
}
// Borders
const redSides = perks.sides_are_lava && combo > baseCombo()
@ -2400,7 +2409,7 @@ function createRevivalSound(baseFreq = 440) {
// Set up the gain envelope to simulate a smooth attack and decay
gainNode.gain.setValueAtTime(0, context.currentTime); // Start at zero
gainNode.gain.linearRampToValueAtTime(0.8, context.currentTime + 0.5); // Ramp up to full volume
gainNode.gain.linearRampToValueAtTime(0.5, context.currentTime + 0.5); // Ramp up to full volume
gainNode.gain.exponentialRampToValueAtTime(0.001, context.currentTime + 2); // Slow decay
// Start all oscillators

View file

@ -3530,7 +3530,7 @@ let allLevels=[
"color": ""
},
{
"name": "Dollar",
"name": "Greed",
"size": 17,
"bricks": [
null,
@ -3841,7 +3841,7 @@ let allLevels=[
""
],
"svg": "",
"color": "#f6d32d"
"color": ""
},
{
"name": "Waves",