mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 04:56:15 -04:00
Build 29062687
This commit is contained in:
parent
f76c96019c
commit
85ece0b975
21 changed files with 74 additions and 68 deletions
|
@ -1,5 +1,5 @@
|
|||
// The version of the cache.
|
||||
const VERSION = "29062545";
|
||||
const VERSION = "29062687";
|
||||
|
||||
// The name of the cache
|
||||
const CACHE_NAME = `breakout-71-${VERSION}`;
|
||||
|
|
|
@ -28,7 +28,7 @@ let lastClickedItemIndex = -1;
|
|||
export function requiredAsyncAlert<t>(p: {
|
||||
title?: string;
|
||||
content: (string | AsyncAlertAction<t>)[];
|
||||
className?:string;
|
||||
className?: string;
|
||||
}): Promise<t> {
|
||||
return asyncAlert({ ...p, allowClose: false });
|
||||
}
|
||||
|
@ -37,16 +37,16 @@ export async function asyncAlert<t>({
|
|||
title,
|
||||
content = [],
|
||||
allowClose = true,
|
||||
className = '',
|
||||
className = "",
|
||||
}: {
|
||||
title?: string;
|
||||
content: (string | AsyncAlertAction<t>)[];
|
||||
allowClose?: boolean;
|
||||
className?:string;
|
||||
className?: string;
|
||||
}): Promise<t | void> {
|
||||
updateAlertsOpen(+1);
|
||||
return new Promise((resolve) => {
|
||||
popupWrap.className = className ;
|
||||
popupWrap.className = className;
|
||||
closeModaleButton.style.display = allowClose ? "" : "none";
|
||||
|
||||
const popup = document.createElement("div");
|
||||
|
|
|
@ -53,7 +53,7 @@ export async function openCreativeModePerksPicker(
|
|||
while (
|
||||
(choice = await requiredAsyncAlert<Upgrade | Level | "reset">({
|
||||
title: t("lab.title", { lvl: currentLevel + 1 }),
|
||||
className:'actionsAsGrid',
|
||||
className: "actionsAsGrid",
|
||||
content: [
|
||||
t("lab.instructions"),
|
||||
{
|
||||
|
|
|
@ -1 +1 @@
|
|||
"29062545"
|
||||
"29062687"
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
* {
|
||||
font-family: Courier New,
|
||||
Courier,
|
||||
Lucida Sans Typewriter,
|
||||
Lucida Typewriter,
|
||||
monospace;
|
||||
font-family:
|
||||
Courier New,
|
||||
Courier,
|
||||
Lucida Sans Typewriter,
|
||||
Lucida Typewriter,
|
||||
monospace;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
@ -248,7 +249,6 @@ body:not(.has-alert-open) #popup {
|
|||
}
|
||||
|
||||
@media (min-width: 1400px) {
|
||||
|
||||
&.settings {
|
||||
&:before {
|
||||
opacity: 0;
|
||||
|
@ -256,12 +256,10 @@ body:not(.has-alert-open) #popup {
|
|||
|
||||
& > div {
|
||||
margin-right: 0;
|
||||
max-width: 400px
|
||||
max-width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*Unlocks progress bar*/
|
||||
|
|
|
@ -798,7 +798,7 @@ async function openSettingsMenu() {
|
|||
title: t("main_menu.settings_title"),
|
||||
content: [t("main_menu.settings_help"), ...actions],
|
||||
allowClose: true,
|
||||
className:'settings',
|
||||
className: "settings",
|
||||
});
|
||||
if (cb) {
|
||||
cb();
|
||||
|
@ -875,7 +875,8 @@ async function openUnlocksList() {
|
|||
t("unlocks.level"),
|
||||
...levelActions,
|
||||
],
|
||||
allowClose: true,className:'actionsAsGrid',
|
||||
allowClose: true,
|
||||
className: "actionsAsGrid",
|
||||
});
|
||||
if (tryOn) {
|
||||
if (await confirmRestart(gameState)) {
|
||||
|
|
|
@ -430,7 +430,7 @@ export function explodeBrick(
|
|||
cy,
|
||||
ball.previousVX * (0.5 + Math.random()),
|
||||
ball.previousVY * (0.5 + Math.random()),
|
||||
color,
|
||||
color,
|
||||
|
||||
points,
|
||||
);
|
||||
|
@ -583,7 +583,9 @@ export function addToScore(gameState: GameState, coin: Coin) {
|
|||
coin.previousY,
|
||||
(gameState.canvasWidth - coin.x) / 100,
|
||||
-coin.y / 100,
|
||||
gameState.perks.metamorphosis || isOptionOn("colorful_coins") ? coin.color : 'gold',
|
||||
gameState.perks.metamorphosis || isOptionOn("colorful_coins")
|
||||
? coin.color
|
||||
: "gold",
|
||||
|
||||
true,
|
||||
gameState.coinSize / 2,
|
||||
|
@ -1116,7 +1118,10 @@ export function gameStateTick(
|
|||
coin.x,
|
||||
coin.y,
|
||||
0,
|
||||
gameState.baseSpeed, gameState.perks.metamorphosis || isOptionOn("colorful_coins") ? coin.color : 'gold',
|
||||
gameState.baseSpeed,
|
||||
gameState.perks.metamorphosis || isOptionOn("colorful_coins")
|
||||
? coin.color
|
||||
: "gold",
|
||||
true,
|
||||
5,
|
||||
250,
|
||||
|
|
|
@ -99,10 +99,6 @@ export function render(gameState: GameState) {
|
|||
scoreDisplay.className =
|
||||
gameState.lastScoreIncrease > gameState.levelTime - 500 ? "active" : "";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Clear
|
||||
if (!isOptionOn("basic") && level.svg && level.color === "#000000") {
|
||||
haloCanvasCtx.globalCompositeOperation = "source-over";
|
||||
|
@ -113,8 +109,10 @@ export function render(gameState: GameState) {
|
|||
haloCanvasCtx.globalCompositeOperation = "screen";
|
||||
|
||||
forEachLiveOne(gameState.coins, (coin) => {
|
||||
const color= gameState.perks.metamorphosis || isOptionOn("colorful_coins") ?
|
||||
coin.color : 'gold';
|
||||
const color =
|
||||
gameState.perks.metamorphosis || isOptionOn("colorful_coins")
|
||||
? coin.color
|
||||
: "gold";
|
||||
haloCanvasCtx.globalAlpha = 0.5;
|
||||
drawFuzzyBall(
|
||||
haloCanvasCtx,
|
||||
|
@ -136,7 +134,7 @@ export function render(gameState: GameState) {
|
|||
}
|
||||
});
|
||||
gameState.balls.forEach((ball) => {
|
||||
haloCanvasCtx.globalAlpha = 0.5;
|
||||
haloCanvasCtx.globalAlpha = 0.5;
|
||||
drawFuzzyBall(
|
||||
haloCanvasCtx,
|
||||
gameState.ballsColor,
|
||||
|
@ -145,14 +143,13 @@ export function render(gameState: GameState) {
|
|||
ball.y / haloScale,
|
||||
);
|
||||
if (isOptionOn("extra_bright")) {
|
||||
|
||||
haloCanvasCtx.globalAlpha = 0.2;
|
||||
drawFuzzyBall(
|
||||
haloCanvasCtx,
|
||||
gameState.ballsColor,
|
||||
(gameState.ballSize * 6) / haloScale,
|
||||
ball.x / haloScale,
|
||||
ball.y / haloScale,
|
||||
haloCanvasCtx,
|
||||
gameState.ballsColor,
|
||||
(gameState.ballSize * 6) / haloScale,
|
||||
ball.x / haloScale,
|
||||
ball.y / haloScale,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -182,13 +179,13 @@ export function render(gameState: GameState) {
|
|||
y / haloScale,
|
||||
);
|
||||
if (isOptionOn("extra_bright")) {
|
||||
haloCanvasCtx.globalAlpha *= 0.5
|
||||
haloCanvasCtx.globalAlpha *= 0.5;
|
||||
drawFuzzyBall(
|
||||
haloCanvasCtx,
|
||||
color,
|
||||
(size * 6) / haloScale,
|
||||
x / haloScale,
|
||||
y / haloScale,
|
||||
haloCanvasCtx,
|
||||
color,
|
||||
(size * 6) / haloScale,
|
||||
x / haloScale,
|
||||
y / haloScale,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -276,8 +273,10 @@ export function render(gameState: GameState) {
|
|||
// Coins
|
||||
ctx.globalAlpha = 1;
|
||||
forEachLiveOne(gameState.coins, (coin) => {
|
||||
const color= gameState.perks.metamorphosis || isOptionOn("colorful_coins") ?
|
||||
coin.color : 'gold'
|
||||
const color =
|
||||
gameState.perks.metamorphosis || isOptionOn("colorful_coins")
|
||||
? coin.color
|
||||
: "gold";
|
||||
// ctx.globalCompositeOperation = "source-over";
|
||||
ctx.globalCompositeOperation =
|
||||
color === "gold" ||
|
||||
|
@ -550,22 +549,25 @@ export function render(gameState: GameState) {
|
|||
1,
|
||||
);
|
||||
|
||||
|
||||
if (!isOptionOn("basic") && isOptionOn("contrast") && level.svg && level.color === "#000000") {
|
||||
|
||||
if (
|
||||
!isOptionOn("basic") &&
|
||||
isOptionOn("contrast") &&
|
||||
level.svg &&
|
||||
level.color === "#000000"
|
||||
) {
|
||||
// haloCanvasCtx.globalCompositeOperation = 'multiply';
|
||||
// haloCanvasCtx.fillRect(0,0,haloCanvas.width,haloCanvas.height)
|
||||
haloCanvasCtx.fillStyle = 'white'
|
||||
haloCanvasCtx.fillStyle = "white";
|
||||
haloCanvasCtx.globalAlpha = 0.25;
|
||||
haloCanvasCtx.globalCompositeOperation = 'screen';
|
||||
haloCanvasCtx.fillRect(0,0,haloCanvas.width,haloCanvas.height)
|
||||
haloCanvasCtx.globalCompositeOperation = "screen";
|
||||
haloCanvasCtx.fillRect(0, 0, haloCanvas.width, haloCanvas.height);
|
||||
ctx.globalAlpha = 1;
|
||||
ctx.globalCompositeOperation = "soft-light";
|
||||
ctx.drawImage(haloCanvas, 0, 0, width, height);
|
||||
}
|
||||
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.globalAlpha = 1;
|
||||
ctx.globalCompositeOperation = "source-over";
|
||||
ctx.globalAlpha = 1;
|
||||
if (isOptionOn("mobile-mode") && !gameState.running) {
|
||||
drawText(
|
||||
ctx,
|
||||
|
@ -578,7 +580,6 @@ export function render(gameState: GameState) {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
if (shaked) {
|
||||
ctx.resetTransform();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@ export async function openStartingPerksEditor() {
|
|||
});
|
||||
|
||||
const perk: Upgrade | null | void = await asyncAlert({
|
||||
title: t("main_menu.starting_perks"),className:'actionsAsGrid',
|
||||
title: t("main_menu.starting_perks"),
|
||||
className: "actionsAsGrid",
|
||||
content: [
|
||||
t("main_menu.starting_perks_checked"),
|
||||
...buttons.filter((b) => b.checked),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue