Added manifest

This commit is contained in:
Renan LE CARO 2025-03-14 19:43:19 +01:00
parent 7e3750c915
commit cdfe6a4978
7 changed files with 56 additions and 42 deletions

View file

@ -13,9 +13,9 @@ Break colourful bricks, catch bouncing coins and select powerful upgrades !
- [Donate](https://github.com/sponsors/renanlecaro)
# Requirements
# System requirements
The app should work offline and perform well even on low-end devices.
Breakout 71 can work offline and perform well even on low-end devices.
It's very lean and does not take much storage space (Roughly 0.1MB).
If the app stutters, turn on "fast mode" in the settings to render a simplified view that should be faster.
There's also an easy mode for kids (slower ball).

30
dist/index.html vendored
View file

@ -633,6 +633,7 @@ parcelHelpers.export(exports, "captureFileName", ()=>captureFileName);
parcelHelpers.export(exports, "findLast", ()=>findLast);
parcelHelpers.export(exports, "toggleFullScreen", ()=>toggleFullScreen);
parcelHelpers.export(exports, "setKeyPressed", ()=>setKeyPressed);
parcelHelpers.export(exports, "newGameState", ()=>newGameState);
parcelHelpers.export(exports, "gameState", ()=>gameState);
parcelHelpers.export(exports, "restart", ()=>restart);
var _loadGameData = require("./loadGameData");
@ -1367,20 +1368,6 @@ function ballTick(ball, delta) {
}
}
}
const defaultRunStats = ()=>({
started: Date.now(),
levelsPlayed: 0,
runTime: 0,
coins_spawned: 0,
score: 0,
bricks_broken: 0,
misses: 0,
balls_lost: 0,
puck_bounces: 0,
upgrades_picked: 1,
max_combo: 1,
max_level: 0
});
function getTotalScore() {
try {
return JSON.parse(localStorage.getItem("breakout_71_total_score") || "0");
@ -2635,7 +2622,20 @@ function newGameState(params) {
keyboardPuckSpeed: 0,
lastTick: performance.now(),
lastTickDown: 0,
runStatistics: defaultRunStats(),
runStatistics: {
started: Date.now(),
levelsPlayed: 0,
runTime: 0,
coins_spawned: 0,
score: 0,
bricks_broken: 0,
misses: 0,
balls_lost: 0,
puck_bounces: 0,
upgrades_picked: 1,
max_combo: 1,
max_level: 0
},
lastOffered: {},
levelTime: 0,
autoCleanUses: 0

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

15
public/manifest.json Normal file
View file

@ -0,0 +1,15 @@
{
"short_name": "B71",
"name": "Breakout 71",
"icons": [
{
"src": "/icon.png",
"sizes": "512x512",
"type": "image/png"
}
],
"start_url": ".",
"display": "fullscreen",
"theme_color": "#5DA3EA",
"background_color": "#ffffff"
}

View file

@ -316,7 +316,7 @@ body {
}
&> span:not(:hover):not(.active) > span > span {
opacity: 0;
}
}
}
h2.histogram-title {

View file

@ -665,7 +665,7 @@ export function tick() {
) {
gameState.bricks[hitBrick] = coin.color;
coin.coloredABrick = true;
sounds.colorChange(coin.x,0.3)
sounds.colorChange(coin.x, 0.3)
}
}
if (typeof hitBrick !== "undefined" || hitBorder) {
@ -1079,22 +1079,6 @@ export function ballTick(ball: Ball, delta: number) {
}
}
const defaultRunStats = () =>
({
started: Date.now(),
levelsPlayed: 0,
runTime: 0,
coins_spawned: 0,
score: 0,
bricks_broken: 0,
misses: 0,
balls_lost: 0,
puck_bounces: 0,
upgrades_picked: 1,
max_combo: 1,
max_level: 0,
}) as RunStats;
export function getTotalScore() {
try {
@ -1463,12 +1447,12 @@ export function explodeBrick(index: number, ball: Ball, isExplosion: boolean) {
if (gameState.perks.picky_eater) {
resetCombo(gameState, ball.x, ball.y);
}
sounds.colorChange(ball.x,0.8)
gameState.lastExplosion=gameState.levelTime
sounds.colorChange(ball.x, 0.8)
gameState.lastExplosion = gameState.levelTime
gameState.ballsColor = color;
if(!isSettingOn('basic')) {
gameState.balls.forEach(ball=>{
spawnExplosion(7, ball.previousX, ball.previousY, color, 150, 15)
if (!isSettingOn('basic')) {
gameState.balls.forEach(ball => {
spawnExplosion(7, ball.previousX, ball.previousY, color, 150, 15)
})
}
} else {
@ -2927,7 +2911,7 @@ document.addEventListener("keyup", async (e) => {
});
function newGameState(params: RunParams): GameState {
export function newGameState(params: RunParams): GameState {
const totalScoreAtRunStart = getTotalScore()
const firstLevel = params?.level ? allLevels.filter((l) => l.name === params?.level) : [];
@ -2988,7 +2972,20 @@ function newGameState(params: RunParams): GameState {
keyboardPuckSpeed: 0,
lastTick: performance.now(),
lastTickDown: 0,
runStatistics: defaultRunStats(),
runStatistics: {
started: Date.now(),
levelsPlayed: 0,
runTime: 0,
coins_spawned: 0,
score: 0,
bricks_broken: 0,
misses: 0,
balls_lost: 0,
puck_bounces: 0,
upgrades_picked: 1,
max_combo: 1,
max_level: 0,
},
lastOffered: {},
levelTime: 0,
autoCleanUses: 0,

View file

@ -12,6 +12,8 @@
name="description"
content="A breakout game with roguelite mechanics. Break bricks, catch coins, pick upgrades, repeat. Play for free on mobile and desktop."
/>
<link rel="manifest" href="manifest.json" />
<style>
@import "game.less";
</style>