Track total play time and added meta description

This commit is contained in:
Renan LE CARO 2025-02-27 23:04:42 +01:00
parent 84f4b3155e
commit 384cbd7df8
4 changed files with 11 additions and 2 deletions

View file

@ -1390,12 +1390,19 @@ function addToTotalScore(points) {
}
}
function addToTotalPlayTime(ms) {
try {
localStorage.setItem('breakout_71_total_play_time', JSON.stringify(JSON.parse(localStorage.getItem('breakout_71_total_play_time') || '0') + ms))
} catch (e) {
}
}
function gameOver(title, intro) {
if (!running) return;
pause(true)
stopRecording()
addToTotalPlayTime(runStatistics.runTime)
runStatistics.max_level = currentLevel+1
let animationDelay = -300
@ -2639,7 +2646,7 @@ async function openSettingsPanel() {
},
{
text: 'Unlocks',
help: "See and try what you've unlocked",
help: "See perks and levels you unlocked",
async value() {
const ts = getTotalScore()
const actions = [...upgrades

View file

@ -8,6 +8,7 @@
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Breakout 71</title>
<meta 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="stylesheet" href="style.css?v=29011519" />
<link rel="icon" href="./icon.svg" />
</head>