mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-23 21:46:15 -04:00
Build 29033878
This commit is contained in:
parent
a2db3004ef
commit
20534eaa8f
13 changed files with 30 additions and 24 deletions
|
@ -55,15 +55,16 @@ body {
|
|||
|
||||
#score {
|
||||
right: 0;
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
transition: color 0.3s;
|
||||
&.active {
|
||||
color: gold;
|
||||
transition: color 0.01s;
|
||||
}
|
||||
}
|
||||
|
||||
#menu {
|
||||
left: 0;
|
||||
@media screen and (orientation: portrait) {
|
||||
& > span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup {
|
||||
|
|
19
src/game.ts
19
src/game.ts
|
@ -57,6 +57,7 @@ export function pause(playerAskedForPause: boolean) {
|
|||
pauseRecording();
|
||||
gameState.pauseTimeout = null;
|
||||
document.body.className = gameState.running ? " running " : " paused ";
|
||||
scoreDisplay.className = "";
|
||||
},
|
||||
Math.min(Math.max(0, gameState.pauseUsesDuringRun - 5) * 50, 500),
|
||||
);
|
||||
|
@ -1624,13 +1625,15 @@ export function render() {
|
|||
const { width, height } = gameCanvas;
|
||||
if (!width || !height) return;
|
||||
|
||||
scoreDisplay.innerText = `L${gameState.currentLevel + 1}/${max_levels()} $${gameState.score}`;
|
||||
Object.assign(
|
||||
scoreDisplay.style,
|
||||
gameState.lastScoreIncrease < gameState.levelTime - 30
|
||||
? { color: "gold", fontWeight: "bold", opacity: 1 }
|
||||
: { opacity: 0.5, fontWeight: "normal", color: "white" },
|
||||
);
|
||||
if (gameState.currentLevel || gameState.levelTime) {
|
||||
menuLabel.innerText = `L${gameState.currentLevel + 1}/${max_levels()}`;
|
||||
} else {
|
||||
menuLabel.innerText = "menu";
|
||||
}
|
||||
scoreDisplay.innerText = `$${gameState.score}`;
|
||||
|
||||
scoreDisplay.className =
|
||||
gameState.lastScoreIncrease > gameState.levelTime - 500 ? "active" : "";
|
||||
|
||||
// Clear
|
||||
if (!isSettingOn("basic") && !level.color && level.svg) {
|
||||
|
@ -2315,6 +2318,7 @@ window.addEventListener("visibilitychange", () => {
|
|||
});
|
||||
|
||||
const scoreDisplay = document.getElementById("score") as HTMLButtonElement;
|
||||
const menuLabel = document.getElementById("menuLabel") as HTMLButtonElement;
|
||||
let alertsOpen = 0,
|
||||
closeModal: null | (() => void) = null;
|
||||
|
||||
|
@ -2616,6 +2620,7 @@ async function openSettingsPanel() {
|
|||
if (
|
||||
await asyncAlert({
|
||||
title: "Reset",
|
||||
text: "You will loose all progress you made in the game, are you sure ? ",
|
||||
actions: [
|
||||
{
|
||||
text: "Yes",
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
/>
|
||||
</head>
|
||||
<body>
|
||||
<button id="menu">☰<span> menu</span></button>
|
||||
<button id="menu">☰ <span id="menuLabel">menu</span></button>
|
||||
<button id="score"></button>
|
||||
<canvas id="game"></canvas>
|
||||
<script type="module">
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
{
|
||||
"name": "Dots",
|
||||
"size": 9,
|
||||
"bricks": "b_t_a_c____________b_t_a_c__________P_b_t_a_c__________P_b_t_a____________P_b_t_a",
|
||||
"bricks": "b_t_a_c_c__________b_t_a_c__________P_b_t_a_c__________P_b_t_a__________P_P_b_t_a",
|
||||
"svg": null
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// The version of the cache.
|
||||
const VERSION = "29033855";
|
||||
const VERSION = "29033878";
|
||||
|
||||
// The name of the cache
|
||||
const CACHE_NAME = `breakout-71-${VERSION}`;
|
||||
|
|
|
@ -1 +1 @@
|
|||
"29033855"
|
||||
"29033878"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue