diff --git a/Readme.md b/Readme.md index 97f08e6..7959d45 100644 --- a/Readme.md +++ b/Readme.md @@ -10,6 +10,7 @@ Break colourful bricks, catch bouncing coins and select powerful upgrades ! [itch.io](https://renanlecaro.itch.io/breakout71) - [GitLab](https://gitlab.com/lecarore/breakout71) - [Donate](https://github.com/sponsors/renanlecaro) + ## Gameplay The goal is to catch as many coins as possible during 7 levels. Coins appear when you break bricks. They fly around, bounce and roll, and you need to catch them with your puck. Your "combo" is the number of coins spawned when a brick breaks, it is displayed on your puck. Your score is displayed in the top right corner of the screen, it is the number of coins you have managed to catch since the begining of your run. @@ -29,6 +30,7 @@ There's also an easy mode for kids (slower ball) and a color-blind mode (no colo ## Doing - publish on Fdroid +- Delay the sound context stop by a few ms ## Todo @@ -37,6 +39,8 @@ There's also an easy mode for kids (slower ball) and a color-blind mode (no colo - show stats on end screen compared to other runs - handle back bouton in menu - more levels : famous simple games, letters, fruits, animals +- icons for upgrades and level +- remind users of what they have already picked. Maybe show all upgrades, disabled except the offered ones ? ## Other ideas diff --git a/app/src/main/assets/game.js b/app/src/main/assets/game.js index 1eb2c27..ecd9b3e 100644 --- a/app/src/main/assets/game.js +++ b/app/src/main/assets/game.js @@ -103,7 +103,10 @@ function pause() { running = false needsRender = true if (audioContext) { - audioContext.suspend() + setTimeout(() => { + if (!running) + audioContext.suspend() + }, 1000) } } @@ -1406,7 +1409,6 @@ function render() { ctx.fillRect(0, 0, width, height); - ctx.globalCompositeOperation = "screen"; ctx.globalAlpha = 0.6; coins.forEach((coin) => { @@ -1434,11 +1436,11 @@ function render() { } }); - // Decides how brights the bg black parts can get + // Decides how brights the bg black parts can get ctx.globalAlpha = .2; ctx.globalCompositeOperation = "multiply"; - ctx.fillStyle = "black"; - ctx.fillRect(0, 0, width, height); + ctx.fillStyle = "black"; + ctx.fillRect(0, 0, width, height); // Decides how dark the background black parts are when lit (1=black) ctx.globalAlpha = .8; ctx.globalCompositeOperation = "multiply"; @@ -1454,11 +1456,11 @@ function render() { bgctx.fillRect(0, 0, width, height); console.log("redrew context") } - if(background.complete) { + if (background.complete) { ctx.drawImage(backgroundCanvas, 0, 0) - }else{ + } else { // Background not loaded yes - ctx.fillStyle = "#000"; + ctx.fillStyle = "#000"; ctx.fillRect(0, 0, width, height); } } @@ -1514,8 +1516,8 @@ function render() { const lastExplosionDelay = Date.now() - lastexplosion + 5; const shaked = lastExplosionDelay < 200; if (shaked) { - const amplitude =( perks.bigger_explosions + 1) * 50 / lastExplosionDelay - ctx.translate(Math.sin(Date.now()) * amplitude , Math.sin(Date.now() + 36) * amplitude); + const amplitude = (perks.bigger_explosions + 1) * 50 / lastExplosionDelay + ctx.translate(Math.sin(Date.now()) * amplitude, Math.sin(Date.now() + 36) * amplitude); } ctx.globalCompositeOperation = "source-over";