mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-23 13:36:15 -04:00
wip
This commit is contained in:
parent
11c797bc59
commit
64a85200b9
23 changed files with 1849 additions and 329 deletions
|
@ -9,11 +9,12 @@ import {
|
|||
pickedUpgradesHTMl,
|
||||
reasonLevelIsLocked,
|
||||
} from "./game_utils";
|
||||
import { getTotalScore } from "./settings";
|
||||
import { getSettingValue, getTotalScore } from "./settings";
|
||||
import { stopRecording } from "./recording";
|
||||
import { asyncAlert } from "./asyncAlert";
|
||||
import { rawUpgrades } from "./upgrades";
|
||||
import { run } from "jest";
|
||||
import { editRawLevelList } from "./levelEditor";
|
||||
|
||||
export function addToTotalPlayTime(ms: number) {
|
||||
try {
|
||||
|
@ -30,11 +31,18 @@ export function addToTotalPlayTime(ms: number) {
|
|||
export function gameOver(title: string, intro: string) {
|
||||
if (!gameState.running) return;
|
||||
if (gameState.isGameOver) return;
|
||||
|
||||
gameState.isGameOver = true;
|
||||
pause(true);
|
||||
stopRecording();
|
||||
addToTotalPlayTime(gameState.runStatistics.runTime);
|
||||
|
||||
if (typeof gameState.isEditorTrialRun === "number") {
|
||||
editRawLevelList(gameState.isEditorTrialRun);
|
||||
restart({});
|
||||
return;
|
||||
}
|
||||
|
||||
// unlocks
|
||||
const endTs = getTotalScore();
|
||||
const startTs = endTs - gameState.score;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue