mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-29 00:09:14 -04:00
wip
This commit is contained in:
parent
aa8d816d68
commit
0035a9abb5
7 changed files with 2124 additions and 2124 deletions
|
@ -204,7 +204,7 @@
|
|||
"credit": ""
|
||||
},
|
||||
{
|
||||
"name": "icon:hypnosis",
|
||||
"name": "icon:golden_goose",
|
||||
"size": 8,
|
||||
"bricks": "_bbby____bbb_y___bbby_y__y_y_y_y__y_y_y____y_y_y____y_y______y_y",
|
||||
"credit": ""
|
||||
|
|
11
src/game.ts
11
src/game.ts
|
@ -113,6 +113,7 @@ export async function play() {
|
|||
}
|
||||
|
||||
export function pause(playerAskedForPause: boolean) {
|
||||
|
||||
if (!gameState.running) return;
|
||||
if (gameState.pauseTimeout) return;
|
||||
if (gameState.startParams.computer_controlled) {
|
||||
|
@ -457,7 +458,10 @@ export function tick() {
|
|||
Math.max(0, ...gameState.balls.map(({ vx, vy }) => vx * vx + vy * vy)),
|
||||
) * frames;
|
||||
const steps = Math.ceil(maxBallSpeed / 8);
|
||||
for (let i = 0; i < steps; i++) gameStateTick(gameState, frames / steps);
|
||||
for (let i = 0; i < steps; i++) {
|
||||
gameStateTick(gameState, frames / steps);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (gameState.running || gameState.needsRender) {
|
||||
|
@ -535,11 +539,6 @@ setInterval(() => {
|
|||
monitorLevelsUnlocks(gameState);
|
||||
}, 500);
|
||||
|
||||
window.addEventListener("visibilitychange", () => {
|
||||
if (document.hidden) {
|
||||
pause(true);
|
||||
}
|
||||
});
|
||||
|
||||
scoreDisplay.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
|
|
|
@ -28,10 +28,12 @@ export function addToTotalPlayTime(ms: number) {
|
|||
|
||||
export function gameOver(title: string, intro: string) {
|
||||
if (!gameState.running) return;
|
||||
|
||||
// Ignore duplicated calls, can happen when ticking is split in multiple updates because the ball goes fast
|
||||
if (gameState.isGameOver) return;
|
||||
|
||||
gameState.isGameOver = true;
|
||||
pause(true);
|
||||
pause(false);
|
||||
askForPersistentStorage();
|
||||
stopRecording();
|
||||
addToTotalPlayTime(gameState.runStatistics.runTime);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -230,7 +230,7 @@
|
|||
"unlocks.category.advanced": "## Advanced upgrades\n\nThose are typically not very useful by themselves, but will can become very powerful when combined with the right combo upgrade. ",
|
||||
"unlocks.category.beginner": "## Beginner friendly upgrades\n\nThose upgrades are very helpful for beginners, they help you play longer and miss the ball less.\n",
|
||||
"unlocks.category.combo": "## Combo upgrades\n\nThose upgrades help increase your combo progressively, but also add a combo reset condition. Taking one is a good idea, taking more increases the risk and reward.",
|
||||
"unlocks.category.combo_boost": "## Combo boosters\n\nThose upgrades increase the combo or combo multiplier without adding a reset condition. ",
|
||||
"unlocks.category.combo_boost": "## Combo booster upgrades\n\nThose upgrades increase the combo or combo multiplier without adding a reset condition. ",
|
||||
"unlocks.category.simple": "## Helper upgrades\n\nThose upgrades are useful in almost any build.\n",
|
||||
"unlocks.greyed_out_help": "The grayed out upgrades can be unlocked by increasing your total score. The total score increases every time you score in game.",
|
||||
"unlocks.intro": "Your total score is {{ts}}. Click an upgrade below to start a game with it.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue