mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 21:16:14 -04:00
Build 29083397
This commit is contained in:
parent
d43dd90a86
commit
a388cd0898
26 changed files with 691 additions and 155 deletions
|
@ -1,5 +1,5 @@
|
|||
// The version of the cache.
|
||||
const VERSION = "29083143";
|
||||
const VERSION = "29083397";
|
||||
|
||||
// The name of the cache
|
||||
const CACHE_NAME = `breakout-71-${VERSION}`;
|
||||
|
|
|
@ -43,6 +43,7 @@ export async function openCreativeModePerksPicker() {
|
|||
const customLevels = (getSettingValue("custom_levels", []) as RawLevel[]).map(
|
||||
transformRawLevel,
|
||||
);
|
||||
|
||||
while (
|
||||
(choice = await asyncAlert<Upgrade | Level | "reset">({
|
||||
title: t("lab.menu_entry"),
|
||||
|
@ -65,7 +66,7 @@ export async function openCreativeModePerksPicker() {
|
|||
(u.max + (creativeModePerks.limitless || 0)),
|
||||
value: u,
|
||||
className: creativeModePerks[u.id]
|
||||
? "sandbox"
|
||||
? "sandbox highlight"
|
||||
: "sandbox grey-out-unless-hovered",
|
||||
tooltip: u.help(creativeModePerks[u.id] || 1),
|
||||
})),
|
||||
|
@ -79,6 +80,10 @@ export async function openCreativeModePerksPicker() {
|
|||
value: l,
|
||||
disabled: !!problem,
|
||||
tooltip: problem || describeLevel(l),
|
||||
className:
|
||||
getSettingValue("creativeModeLevel", "") === l.name
|
||||
? "highlight"
|
||||
: "",
|
||||
};
|
||||
}),
|
||||
...customLevels.map((l) => ({
|
||||
|
@ -97,6 +102,7 @@ export async function openCreativeModePerksPicker() {
|
|||
});
|
||||
} else if ("bricks" in choice) {
|
||||
setSettingValue("creativeModePerks", creativeModePerks);
|
||||
setSettingValue("creativeModeLevel", choice.name);
|
||||
if (await confirmRestart(gameState)) {
|
||||
restart({
|
||||
perks: creativeModePerks,
|
||||
|
|
|
@ -1 +1 @@
|
|||
"29083143"
|
||||
"29083397"
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@purple: #6262ea;
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
@ -583,3 +585,41 @@ h2.histogram-title strong {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#stats {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 40px;
|
||||
width: 100vw;
|
||||
max-width: 400px;
|
||||
color: white;
|
||||
z-index: 3;
|
||||
pointer-events: none;
|
||||
opacity: 1;
|
||||
& > div {
|
||||
background: rgba(38, 38, 38, 0.5);
|
||||
position: relative;
|
||||
> div {
|
||||
background: @purple;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
transform-origin: top left;
|
||||
}
|
||||
> strong {
|
||||
position: relative;
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.highlight {
|
||||
position: relative;
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(-45deg, @purple, transparent);
|
||||
mix-blend-mode: screen;
|
||||
opacity: 0.3;
|
||||
}
|
||||
}
|
||||
|
|
112
src/game.ts
112
src/game.ts
|
@ -53,8 +53,8 @@ import {
|
|||
import {
|
||||
backgroundCanvas,
|
||||
gameCanvas,
|
||||
getHaloScale,
|
||||
haloCanvas,
|
||||
haloScale,
|
||||
render,
|
||||
scoreDisplay,
|
||||
} from "./render";
|
||||
|
@ -160,6 +160,7 @@ export const fitSize = (gameState: GameState) => {
|
|||
gameCanvas.height = height;
|
||||
backgroundCanvas.width = width;
|
||||
backgroundCanvas.height = height;
|
||||
const haloScale = getHaloScale();
|
||||
haloCanvas.width = width / haloScale;
|
||||
haloCanvas.height = height / haloScale;
|
||||
|
||||
|
@ -424,8 +425,7 @@ export function hitsSomething(x: number, y: number, radius: number) {
|
|||
}
|
||||
|
||||
export function tick() {
|
||||
startWork("tick init");
|
||||
|
||||
startWork("physics");
|
||||
const currentTick = performance.now();
|
||||
const timeDeltaMs = currentTick - gameState.lastTick;
|
||||
gameState.lastTick = currentTick;
|
||||
|
@ -445,9 +445,7 @@ export function tick() {
|
|||
);
|
||||
}
|
||||
|
||||
startWork("normalizeGameState");
|
||||
normalizeGameState(gameState);
|
||||
startWork("gameStateTick");
|
||||
if (gameState.running) {
|
||||
gameState.levelTime += timeDeltaMs * frames;
|
||||
gameState.runStatistics.runTime += timeDeltaMs * frames;
|
||||
|
@ -459,11 +457,11 @@ export function tick() {
|
|||
gameState.needsRender = false;
|
||||
render(gameState);
|
||||
}
|
||||
startWork("recordOneFrame");
|
||||
startWork("record video");
|
||||
if (gameState.running) {
|
||||
recordOneFrame(gameState);
|
||||
}
|
||||
startWork("playPendingSounds");
|
||||
startWork("sound");
|
||||
if (isOptionOn("sound")) {
|
||||
playPendingSounds(gameState);
|
||||
}
|
||||
|
@ -480,12 +478,12 @@ setInterval(() => {
|
|||
FPSCounter = 0;
|
||||
}, 1000);
|
||||
|
||||
const showStats = window.location.search.includes("stress");
|
||||
const stats = document.getElementById("stats") as HTMLDivElement;
|
||||
let total = {};
|
||||
let lastTick = performance.now();
|
||||
let doing = "";
|
||||
let doing = "idle";
|
||||
export function startWork(what) {
|
||||
if (!showStats) return;
|
||||
if (!gameState.startParams.stress) return;
|
||||
const newNow = performance.now();
|
||||
if (doing) {
|
||||
total[doing] = (total[doing] || 0) + (newNow - lastTick);
|
||||
|
@ -493,28 +491,38 @@ export function startWork(what) {
|
|||
lastTick = newNow;
|
||||
doing = what;
|
||||
}
|
||||
if (showStats)
|
||||
setInterval(() => {
|
||||
const totalTime = sumOfValues(total);
|
||||
console.debug(
|
||||
liveCount(gameState.coins) +
|
||||
" coins\n" +
|
||||
Object.entries(total)
|
||||
.sort((a, b) => b[1] - a[1])
|
||||
.filter((a) => a[1] > 1)
|
||||
.map(
|
||||
(t) =>
|
||||
t[0] +
|
||||
":" +
|
||||
((t[1] / totalTime) * 100).toFixed(2) +
|
||||
"% (" +
|
||||
t[1] +
|
||||
"ms)",
|
||||
)
|
||||
.join("\n"),
|
||||
);
|
||||
total = {};
|
||||
}, 2000);
|
||||
setInterval(() => {
|
||||
if (!gameState.startParams.stress) {
|
||||
stats.style.display = "none";
|
||||
return;
|
||||
}
|
||||
|
||||
stats.style.display = "block";
|
||||
const totalTime = sumOfValues(total);
|
||||
stats.innerHTML =
|
||||
`
|
||||
<div>
|
||||
<strong>Coins ${liveCount(gameState.coins)} / ${getCurrentMaxCoins()} - Particles : ${liveCount(gameState.particles) + liveCount(gameState.lights) + liveCount(gameState.texts)}</strong>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
` +
|
||||
Object.entries(total)
|
||||
// .sort((a, b) => b[1] - a[1])
|
||||
.map(
|
||||
(t) =>
|
||||
` <div>
|
||||
<div style="transform: scale(${clamp(t[1] / totalTime, 0, 1)},1)"></div>
|
||||
<strong>${t[0]} : ${t[1]} ms</strong>
|
||||
</div>
|
||||
`,
|
||||
)
|
||||
.join("\n");
|
||||
|
||||
total = {};
|
||||
}, 1000);
|
||||
|
||||
setInterval(() => {
|
||||
monitorLevelsUnlocks(gameState);
|
||||
|
@ -669,11 +677,19 @@ async function openSettingsMenu() {
|
|||
if (options[key]) {
|
||||
actions.push({
|
||||
icon: isOptionOn(key)
|
||||
? icons["icon:checkmark_checked"]
|
||||
: icons["icon:checkmark_unchecked"],
|
||||
? icons["icon:checkmark_checked"]
|
||||
: icons["icon:checkmark_unchecked"],
|
||||
text: options[key].name,
|
||||
help: options[key].help,
|
||||
disabled : (key=='extra_bright' && isOptionOn('basic')) || (key=='contrast' && isOptionOn('basic')) || false,
|
||||
disabled:
|
||||
(isOptionOn("basic") &&
|
||||
[
|
||||
"extra_bright",
|
||||
"contrast",
|
||||
"smooth_lighting",
|
||||
"precise_lighting",
|
||||
].includes(key)) ||
|
||||
false,
|
||||
value: () => {
|
||||
toggleOption(key);
|
||||
fitSize(gameState);
|
||||
|
@ -843,6 +859,20 @@ async function openSettingsMenu() {
|
|||
}
|
||||
},
|
||||
});
|
||||
actions.push({
|
||||
text: t("settings.autoplay"),
|
||||
help: t("settings.autoplay_help"),
|
||||
async value() {
|
||||
startComputerControlledGame(false);
|
||||
},
|
||||
});
|
||||
actions.push({
|
||||
text: t("settings.stress_test"),
|
||||
help: t("settings.stress_test_help"),
|
||||
async value() {
|
||||
startComputerControlledGame(true);
|
||||
},
|
||||
});
|
||||
|
||||
const cb = await asyncAlert<() => void>({
|
||||
title: t("main_menu.settings_title"),
|
||||
|
@ -1034,7 +1064,7 @@ document.addEventListener("keyup", async (e) => {
|
|||
pageLoad < Date.now() - 500
|
||||
) {
|
||||
if (gameState.startParams.computer_controlled) {
|
||||
return startComputerControlledGame();
|
||||
return startComputerControlledGame(gameState.startParams.stress);
|
||||
}
|
||||
// When doing ctrl + R in dev to refresh, i don't want to instantly restart a run
|
||||
if (await confirmRestart(gameState)) {
|
||||
|
@ -1054,6 +1084,7 @@ export function restart(params: RunParams) {
|
|||
Object.assign(gameState, newGameState(params));
|
||||
// Recompute brick size according to level
|
||||
fitSize(gameState);
|
||||
|
||||
pauseRecording();
|
||||
setLevel(gameState, 0);
|
||||
if (params?.computer_controlled) {
|
||||
|
@ -1061,15 +1092,14 @@ export function restart(params: RunParams) {
|
|||
}
|
||||
}
|
||||
if (window.location.search.match(/autoplay|stress/)) {
|
||||
startComputerControlledGame();
|
||||
if (!isOptionOn("show_fps")) toggleOption("show_fps");
|
||||
startComputerControlledGame(window.location.search.includes("stress"));
|
||||
} else {
|
||||
restart({});
|
||||
}
|
||||
|
||||
export function startComputerControlledGame() {
|
||||
export function startComputerControlledGame(stress: boolean = false) {
|
||||
const perks: Partial<PerksMap> = { base_combo: 20, pierce: 3 };
|
||||
if (window.location.search.includes("stress")) {
|
||||
if (stress) {
|
||||
Object.assign(perks, {
|
||||
base_combo: 5000,
|
||||
pierce: 20,
|
||||
|
@ -1082,7 +1112,6 @@ export function startComputerControlledGame() {
|
|||
} else {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const u = sample(upgrades);
|
||||
|
||||
perks[u.id] ||= Math.floor(Math.random() * u.max) + 1;
|
||||
}
|
||||
perks.superhot = 0;
|
||||
|
@ -1091,6 +1120,7 @@ export function startComputerControlledGame() {
|
|||
level: sample(allLevels.filter((l) => l.color === "#000000")),
|
||||
computer_controlled: true,
|
||||
perks,
|
||||
stress,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
distanceBetween,
|
||||
getClosestBall,
|
||||
getCoinRenderColor,
|
||||
getCornerOffset,
|
||||
getMajorityValue,
|
||||
getPossibleUpgrades,
|
||||
getRowColIndex,
|
||||
|
@ -106,7 +107,7 @@ function computerControl(gameState: GameState) {
|
|||
10,
|
||||
);
|
||||
if (gameState.levelTime > 30000) {
|
||||
startComputerControlledGame();
|
||||
startComputerControlledGame(gameState.startParams.stress);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,11 +184,7 @@ export function normalizeGameState(gameState: GameState) {
|
|||
),
|
||||
);
|
||||
|
||||
const corner =
|
||||
(gameState.levelTime
|
||||
? gameState.perks.corner_shot * gameState.puckWidth
|
||||
: 0) -
|
||||
gameState.perks.unbounded * gameState.brickWidth;
|
||||
const corner = getCornerOffset(gameState);
|
||||
|
||||
let minX = gameState.offsetXRoundedDown + gameState.puckWidth / 2 - corner;
|
||||
|
||||
|
@ -638,7 +635,7 @@ export function schedulGameSound(
|
|||
) {
|
||||
if (!vol) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
if (gameState.startParams.computer_controlled) return;
|
||||
|
||||
x ??= gameState.offsetX + gameState.gameZoneWidth / 2;
|
||||
const ex = gameState.aboutToPlaySound[sound] as { vol: number; x: number };
|
||||
|
||||
|
@ -1068,7 +1065,7 @@ export function gameStateTick(
|
|||
(gameState.levelTime && !remainingBricks && !liveCount(gameState.coins))
|
||||
) {
|
||||
if (gameState.startParams.computer_controlled) {
|
||||
startComputerControlledGame();
|
||||
startComputerControlledGame(gameState.startParams.stress);
|
||||
} else if (gameState.currentLevel + 1 < max_levels(gameState)) {
|
||||
setLevel(gameState, gameState.currentLevel + 1);
|
||||
} else {
|
||||
|
@ -1738,7 +1735,7 @@ export function ballTick(gameState: GameState, ball: Ball, frames: number) {
|
|||
gameState.runStatistics.balls_lost++;
|
||||
if (!gameState.balls.find((b) => !b.destroyed)) {
|
||||
if (gameState.startParams.computer_controlled) {
|
||||
startComputerControlledGame();
|
||||
startComputerControlledGame(gameState.startParams.stress);
|
||||
} else {
|
||||
gameOver(
|
||||
t("gameOver.lost.title"),
|
||||
|
|
|
@ -412,3 +412,12 @@ export function getCoinRenderColor(gameState: GameState, coin: Coin) {
|
|||
return coin.color;
|
||||
return "#ffd300";
|
||||
}
|
||||
|
||||
export function getCornerOffset(gameState: GameState) {
|
||||
return (
|
||||
(gameState.levelTime
|
||||
? gameState.perks.corner_shot * gameState.brickWidth
|
||||
: 0) -
|
||||
gameState.perks.unbounded * gameState.brickWidth
|
||||
);
|
||||
}
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
"score_panel.title": "{{score}} نقطة في المستوى {{level}}/{{max}} ",
|
||||
"score_panel.upcoming_levels": "المستويات القادمة :",
|
||||
"score_panel.upgrades_picked": "الترقيات التي تم اختيارها في هذه اللعبة:",
|
||||
"settings.autoplay": "",
|
||||
"settings.autoplay_help": "",
|
||||
"settings.basic": "الرسومات الأساسية",
|
||||
"settings.basic_help": "أداء أفضل.",
|
||||
"settings.colorful_coins": "عملات معدنية ملونة",
|
||||
|
@ -190,8 +192,10 @@
|
|||
"settings.mobile_help": "يترك مساحة تحت المجداف.",
|
||||
"settings.pointer_lock": "قفل مؤشر الماوس",
|
||||
"settings.pointer_lock_help": "يقوم بقفل وإخفاء مؤشر الماوس.",
|
||||
"settings.precise_physics": "",
|
||||
"settings.precise_physics_help": "",
|
||||
"settings.precise_lighting": "",
|
||||
"settings.precise_lighting_help": "",
|
||||
"settings.precise_physics": "الفيزياء الدقيقة",
|
||||
"settings.precise_physics_help": "احسب حركة الكرة والعملة المعدنية في أربع خطوات صغيرة بدلاً من خطوة واحدة لتجنب مرور الكرات السريعة جدًا عبر الطوب. عطّل هذه الميزة لزيادة معدل الإطارات في الثانية بنسبة ١٠٪ تقريبًا على الأجهزة البطيئة.",
|
||||
"settings.record": "تسجيل مقاطع فيديو للعبة",
|
||||
"settings.record_download": "تنزيل الفيديو ({{size}} ميجابايت)",
|
||||
"settings.record_help": "احصل على فيديو لكل مستوى.",
|
||||
|
@ -210,8 +214,12 @@
|
|||
"settings.show_fps_help": "مراقبة أداء التطبيق",
|
||||
"settings.show_stats": "عرض الإحصائيات في الوقت الحقيقي",
|
||||
"settings.show_stats_help": "العملات المعدنية، الوقت، الارتدادات، الأخطاء",
|
||||
"settings.smooth_lighting": "",
|
||||
"settings.smooth_lighting_help": "",
|
||||
"settings.sounds": "أصوات اللعبة",
|
||||
"settings.sounds_help": "قد يؤدي إلى إبطاء بعض الهواتف.",
|
||||
"settings.sounds_help": "أصوات صفير وبلبل و برررر",
|
||||
"settings.stress_test": "",
|
||||
"settings.stress_test_help": "",
|
||||
"starting_perks.checked": "عند بدء لعبة جديدة، ستُمنح إحدى هذه المزايا. انقر على أي ميزة لاستبعادها.",
|
||||
"starting_perks.help": "اختر الترقيات الأولية الممكنة",
|
||||
"starting_perks.random": "لقد تم إزالة جميع المزايا، وسيكون الاختيار عشوائيًا.",
|
||||
|
|
|
@ -5807,6 +5807,76 @@
|
|||
<folder_node>
|
||||
<name>settings</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>autoplay</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>autoplay_help</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>basic</name>
|
||||
<description/>
|
||||
|
@ -6787,6 +6857,76 @@
|
|||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>precise_lighting</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>precise_lighting_help</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>precise_physics</name>
|
||||
<description/>
|
||||
|
@ -7487,6 +7627,76 @@
|
|||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>smooth_lighting</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>smooth_lighting_help</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>sounds</name>
|
||||
<description/>
|
||||
|
@ -7545,7 +7755,77 @@
|
|||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>stress_test</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>tr-TR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>stress_test_help</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>ar-LB</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>de-DE</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-CL</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>ru-RU</language>
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
"score_panel.title": "{{score}} Punkte auf Stufe {{level}}/{{max}} ",
|
||||
"score_panel.upcoming_levels": "Kommende Stufen :",
|
||||
"score_panel.upgrades_picked": "Die in diesem Spiel gewählten Upgrades laufen:",
|
||||
"settings.autoplay": "",
|
||||
"settings.autoplay_help": "",
|
||||
"settings.basic": "Grundlegende Grafiken",
|
||||
"settings.basic_help": "Bessere Leistung.",
|
||||
"settings.colorful_coins": "Bunte Münzen",
|
||||
|
@ -190,8 +192,10 @@
|
|||
"settings.mobile_help": "Lässt Platz unter dem Paddel.",
|
||||
"settings.pointer_lock": "Mauszeigersperre",
|
||||
"settings.pointer_lock_help": "Sperrt und versteckt den Mauszeiger.",
|
||||
"settings.precise_physics": "",
|
||||
"settings.precise_physics_help": "",
|
||||
"settings.precise_lighting": "",
|
||||
"settings.precise_lighting_help": "",
|
||||
"settings.precise_physics": "Präzise Physik",
|
||||
"settings.precise_physics_help": "Berechnen Sie die Bewegung von Bällen und Münzen in vier kleinen Schritten statt in einem, um zu vermeiden, dass sehr schnelle Bälle durch Ziegelsteine fliegen. Deaktivieren Sie diese Option, um die FPS auf langsamen Geräten um ca. 10 % zu erhöhen.",
|
||||
"settings.record": "Spielvideos aufnehmen",
|
||||
"settings.record_download": "Video herunterladen ({{size}} MB)",
|
||||
"settings.record_help": "Holen Sie sich ein Video von jedem Level.",
|
||||
|
@ -210,8 +214,12 @@
|
|||
"settings.show_fps_help": "Überwachen Sie die Leistung der Anwendung",
|
||||
"settings.show_stats": "Echtzeit-Statistiken anzeigen",
|
||||
"settings.show_stats_help": "Münzen, Zeit, Sprünge, Fehlschüsse",
|
||||
"settings.smooth_lighting": "",
|
||||
"settings.smooth_lighting_help": "",
|
||||
"settings.sounds": "Spiel-Sounds",
|
||||
"settings.sounds_help": "Kann einige Telefone verlangsamen.",
|
||||
"settings.sounds_help": "Piepsen, Bloops und Brrrr",
|
||||
"settings.stress_test": "",
|
||||
"settings.stress_test_help": "",
|
||||
"starting_perks.checked": "Wenn Sie ein neues Spiel beginnen, wird Ihnen eine dieser Vergünstigungen angeboten. Klicken Sie auf eine Vergünstigung, um sie auszuschließen.",
|
||||
"starting_perks.help": "Wählen Sie mögliche Start-Upgrades",
|
||||
"starting_perks.random": "Alle Vorteile wurden gestrichen, die Auswahl erfolgt nach dem Zufallsprinzip.",
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
"score_panel.title": "{{score}} points at level {{level}}/{{max}} ",
|
||||
"score_panel.upcoming_levels": "Upcoming levels :",
|
||||
"score_panel.upgrades_picked": "Upgrades picked in this game run : ",
|
||||
"settings.autoplay": "Auto play",
|
||||
"settings.autoplay_help": "Start a session with random upgrades and a computer controlled paddle",
|
||||
"settings.basic": "Basic graphics",
|
||||
"settings.basic_help": "Better performance.",
|
||||
"settings.colorful_coins": "Colorful coins",
|
||||
|
@ -190,8 +192,10 @@
|
|||
"settings.mobile_help": "Leaves space under the paddle.",
|
||||
"settings.pointer_lock": "Mouse pointer lock",
|
||||
"settings.pointer_lock_help": "Locks and hides the mouse cursor.",
|
||||
"settings.precise_physics": "More precise physics",
|
||||
"settings.precise_physics_help": "Compute fast ball motion in smaller steps, might reduce performance",
|
||||
"settings.precise_lighting": "Precise lighting",
|
||||
"settings.precise_lighting_help": "Use a smaller grid for background light effect",
|
||||
"settings.precise_physics": "Precise physics",
|
||||
"settings.precise_physics_help": "Compute ball and coin motion in 4 small steps instead of one to avoid very fast balls passing through bricks. Disable to increase FPS by ~10% on slow devices. ",
|
||||
"settings.record": "Record gameplay videos",
|
||||
"settings.record_download": "Download video ({{size}} MB)",
|
||||
"settings.record_help": "Get a video of each level.",
|
||||
|
@ -210,8 +214,12 @@
|
|||
"settings.show_fps_help": "Monitor the app's performance",
|
||||
"settings.show_stats": "Show real time stats",
|
||||
"settings.show_stats_help": "Coins, time, bounces, misses",
|
||||
"settings.smooth_lighting": "Smooth lighting",
|
||||
"settings.smooth_lighting_help": "Blur the background light effects to make them look less square. Increases lag.",
|
||||
"settings.sounds": "Game sounds",
|
||||
"settings.sounds_help": "Can slow down some phones.",
|
||||
"settings.sounds_help": "Beeps, bloops and brrrr",
|
||||
"settings.stress_test": "Stress test",
|
||||
"settings.stress_test_help": "Start a bot controlled game with a very high number of coins, to test the performance limits of your device.",
|
||||
"starting_perks.checked": "When you start a new game, one of those perks will be given to you. Click a perk to exclude it. ",
|
||||
"starting_perks.help": "Choose possible starting upgrades",
|
||||
"starting_perks.random": "All benefits have been removed, the choice will be random.",
|
||||
|
@ -413,7 +421,7 @@
|
|||
"upgrades.trampoline.tooltip": "+{{lvl}} combo per paddle bounce,-{{lvl}} combo per bounce on any border",
|
||||
"upgrades.trampoline.verbose_description": "One of the rare combo upgrades that don't add a reset condition",
|
||||
"upgrades.transparency.name": "Transparency",
|
||||
"upgrades.transparency.tooltip": "The higher the ball is on the screen, the more transparent it becomes. The more transparent it is, the more coins it produces.",
|
||||
"upgrades.transparency.tooltip": "The higher the ball is on the screen, the more transparent it becomes, and the more coins it produces (+{{percent}} % at full transparency).",
|
||||
"upgrades.transparency.verbose_description": "Higher levels make the ball transparent sooner and increase the point bonus.",
|
||||
"upgrades.trickledown.name": "Trickle down economics",
|
||||
"upgrades.trickledown.tooltip": "The coins appear at the top of the screen.",
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
"score_panel.title": "{{score}} puntos en {{level}}/{{max}} nivel",
|
||||
"score_panel.upcoming_levels": "Niveles de partido :",
|
||||
"score_panel.upgrades_picked": "Mejoras elegidas durante el juego :",
|
||||
"settings.autoplay": "",
|
||||
"settings.autoplay_help": "",
|
||||
"settings.basic": "Gráficos básicos",
|
||||
"settings.basic_help": "Mejor rendimiento.",
|
||||
"settings.colorful_coins": "Monedas de colores",
|
||||
|
@ -190,8 +192,10 @@
|
|||
"settings.mobile_help": "Deja espacio debajo de la paleta.",
|
||||
"settings.pointer_lock": "Bloqueo del puntero del ratón",
|
||||
"settings.pointer_lock_help": "Bloquea y oculta el cursor del mouse.",
|
||||
"settings.precise_physics": "",
|
||||
"settings.precise_physics_help": "",
|
||||
"settings.precise_lighting": "",
|
||||
"settings.precise_lighting_help": "",
|
||||
"settings.precise_physics": "Física precisa",
|
||||
"settings.precise_physics_help": "Calcula el movimiento de la bola y la moneda en 4 pasos pequeños en lugar de uno para evitar que las bolas atraviesen ladrillos muy rápido. Desactívalo para aumentar los FPS en aproximadamente un 10 % en dispositivos lentos.",
|
||||
"settings.record": "Grabar vídeos de juego",
|
||||
"settings.record_download": "Descargar vídeo ({{size}} MB)",
|
||||
"settings.record_help": "Obtenga un vídeo de cada nivel.",
|
||||
|
@ -210,8 +214,12 @@
|
|||
"settings.show_fps_help": "Supervisar el rendimiento de la aplicación",
|
||||
"settings.show_stats": "Mostrar estadísticas en tiempo real",
|
||||
"settings.show_stats_help": "Monedas, tiempo, rebotes, fallos.",
|
||||
"settings.smooth_lighting": "",
|
||||
"settings.smooth_lighting_help": "",
|
||||
"settings.sounds": "Sonidos del juego",
|
||||
"settings.sounds_help": "Puede ralentizar algunos teléfonos.",
|
||||
"settings.sounds_help": "Pitidos, bloops y brrrr",
|
||||
"settings.stress_test": "",
|
||||
"settings.stress_test_help": "",
|
||||
"starting_perks.checked": "Al empezar una partida nueva, recibirás una de esas ventajas. Haz clic en una ventaja para excluirla.",
|
||||
"starting_perks.help": "Elija posibles actualizaciones iniciales",
|
||||
"starting_perks.random": "Se han eliminado todos los beneficios, la elección será aleatoria.",
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
"score_panel.title": "{{score}} points au niveau {{level}}/{{max}} ",
|
||||
"score_panel.upcoming_levels": "Niveaux de la parties : ",
|
||||
"score_panel.upgrades_picked": "Améliorations choisies pendant la partie :",
|
||||
"settings.autoplay": "",
|
||||
"settings.autoplay_help": "",
|
||||
"settings.basic": "Graphismes simplifiés",
|
||||
"settings.basic_help": "Meilleures performances.",
|
||||
"settings.colorful_coins": "Pièces colorées",
|
||||
|
@ -190,8 +192,10 @@
|
|||
"settings.mobile_help": "Laisse un espace sous la raquette.",
|
||||
"settings.pointer_lock": "Verrouillage du pointeur",
|
||||
"settings.pointer_lock_help": "Cache aussi le curseur de la souris.",
|
||||
"settings.precise_physics": "",
|
||||
"settings.precise_physics_help": "",
|
||||
"settings.precise_lighting": "",
|
||||
"settings.precise_lighting_help": "",
|
||||
"settings.precise_physics": "Physique précise",
|
||||
"settings.precise_physics_help": "Calculez le mouvement des balles et des pièces en quatre petites étapes au lieu d'une seule pour éviter que les balles très rapides ne traversent les briques. Désactivez cette option pour augmenter le nombre d'images par seconde d'environ 10 % sur les appareils lents.",
|
||||
"settings.record": "Enregistrer des vidéos de jeu",
|
||||
"settings.record_download": "Télécharger la vidéo ({{size}} MB)",
|
||||
"settings.record_help": "Obtenez une vidéo de chaque niveau.",
|
||||
|
@ -210,8 +214,12 @@
|
|||
"settings.show_fps_help": "Surveiller la performance du jeu",
|
||||
"settings.show_stats": "Statistiques en temps réel",
|
||||
"settings.show_stats_help": "Pièces, temps, rebonds, ratés",
|
||||
"settings.smooth_lighting": "",
|
||||
"settings.smooth_lighting_help": "",
|
||||
"settings.sounds": "Sons du jeu",
|
||||
"settings.sounds_help": "Ralentis certains téléphones.",
|
||||
"settings.sounds_help": "Bips, bloops et brrrr",
|
||||
"settings.stress_test": "",
|
||||
"settings.stress_test_help": "",
|
||||
"starting_perks.checked": "Lorsque vous démarrez une nouvelle partie, l'un de ces avantages vous sera attribué. Cliquez sur un avantage pour l'exclure.",
|
||||
"starting_perks.help": "Choisissez les avantages de départ",
|
||||
"starting_perks.random": "Tous les avantages ont été retirés, le choix sera aléatoire.",
|
||||
|
@ -413,7 +421,7 @@
|
|||
"upgrades.trampoline.tooltip": "+{{lvl}} combo à chaque rebond d'une balle sur la raquette,-{{lvl}} combo à chaque rebond sur un des bords",
|
||||
"upgrades.trampoline.verbose_description": "Une des rares améliorations à ne pas avoir de condition de remise à zéro",
|
||||
"upgrades.transparency.name": "Camouflage",
|
||||
"upgrades.transparency.tooltip": "Plus la balle est haut à l'écran, plus elle devient transparente. Plus elle est transparente, plus elle produit de pièces.",
|
||||
"upgrades.transparency.tooltip": "Plus la balle est haut à l'écran, plus elle devient transparente et plus elle produit de pièces (+{{percent}} % à transparence maximum).",
|
||||
"upgrades.transparency.verbose_description": "Les niveaux plus élevés rendent la balle transparente plus tôt et augmentent le bonus de points.",
|
||||
"upgrades.trickledown.name": "Ruissellement",
|
||||
"upgrades.trickledown.tooltip": "Les pièces apparaissent en haut de l'écran.",
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
"score_panel.title": "{{score}} очков на уровне {{level}}/{{max}} ",
|
||||
"score_panel.upcoming_levels": "Предстоящие уровни :",
|
||||
"score_panel.upgrades_picked": "Обновления, выбранные в этой игре, запускаются :",
|
||||
"settings.autoplay": "",
|
||||
"settings.autoplay_help": "",
|
||||
"settings.basic": "Базовая графика",
|
||||
"settings.basic_help": "Улучшенная производительность.",
|
||||
"settings.colorful_coins": "Разноцветные монеты",
|
||||
|
@ -190,8 +192,10 @@
|
|||
"settings.mobile_help": "Оставляет место под лопаткой.",
|
||||
"settings.pointer_lock": "Блокировка указателя мыши",
|
||||
"settings.pointer_lock_help": "Фиксирует и скрывает курсор мыши.",
|
||||
"settings.precise_physics": "",
|
||||
"settings.precise_physics_help": "",
|
||||
"settings.precise_lighting": "",
|
||||
"settings.precise_lighting_help": "",
|
||||
"settings.precise_physics": "Точная физика",
|
||||
"settings.precise_physics_help": "Вычислять движение мяча и монеты за 4 небольших шага вместо одного, чтобы избежать очень быстрых мячей, проходящих через кирпичи. Отключить, чтобы увеличить FPS примерно на 10% на медленных устройствах.",
|
||||
"settings.record": "Запись видеороликов игрового процесса",
|
||||
"settings.record_download": "Скачать видео ({{size}} МБ)",
|
||||
"settings.record_help": "Получите видеозапись каждого уровня.",
|
||||
|
@ -210,8 +214,12 @@
|
|||
"settings.show_fps_help": "Контролируйте работу приложения",
|
||||
"settings.show_stats": "Показывайте статистику в реальном времени",
|
||||
"settings.show_stats_help": "Монеты, время, отскоки, промахи",
|
||||
"settings.smooth_lighting": "",
|
||||
"settings.smooth_lighting_help": "",
|
||||
"settings.sounds": "Звуки игры",
|
||||
"settings.sounds_help": "Может замедлять работу некоторых телефонов.",
|
||||
"settings.sounds_help": "Бипы, блепы и брррр",
|
||||
"settings.stress_test": "",
|
||||
"settings.stress_test_help": "",
|
||||
"starting_perks.checked": "Когда вы начнете новую игру, вам будет дано одно из этих преимуществ. Щелкните по перку, чтобы исключить его.",
|
||||
"starting_perks.help": "Выберите возможные стартовые апгрейды",
|
||||
"starting_perks.random": "Все преимущества были убраны, выбор будет случайным.",
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
"score_panel.title": " {{level}}/{{max}} seviyesinde{{score}} puan",
|
||||
"score_panel.upcoming_levels": "Yaklaşan seviyeler :",
|
||||
"score_panel.upgrades_picked": "Bu oyun çalışmasında seçilen yükseltmeler:",
|
||||
"settings.autoplay": "",
|
||||
"settings.autoplay_help": "",
|
||||
"settings.basic": "Temel grafikler",
|
||||
"settings.basic_help": "Daha iyi performans.",
|
||||
"settings.colorful_coins": "Renkli madeni paralar",
|
||||
|
@ -190,8 +192,10 @@
|
|||
"settings.mobile_help": "Kürek altında boşluk bırakır.",
|
||||
"settings.pointer_lock": "Fare işaretçisi kilidi",
|
||||
"settings.pointer_lock_help": "Fare imlecini kilitler ve gizler.",
|
||||
"settings.precise_physics": "",
|
||||
"settings.precise_physics_help": "",
|
||||
"settings.precise_lighting": "",
|
||||
"settings.precise_lighting_help": "",
|
||||
"settings.precise_physics": "Kesin fizik",
|
||||
"settings.precise_physics_help": "Çok hızlı topların tuğlaların arasından geçmesini önlemek için top ve jeton hareketini bir adım yerine 4 küçük adımda hesaplayın. Yavaş cihazlarda FPS'yi ~%10 artırmak için devre dışı bırakın.",
|
||||
"settings.record": "Oyun videolarını kaydedin",
|
||||
"settings.record_download": "Videoyu indir ({{size}} MB)",
|
||||
"settings.record_help": "Her seviyenin videosunu edinin.",
|
||||
|
@ -210,8 +214,12 @@
|
|||
"settings.show_fps_help": "Uygulamanın performansını izleyin",
|
||||
"settings.show_stats": "Gerçek zamanlı istatistikleri göster",
|
||||
"settings.show_stats_help": "Paralar, zaman, sekmeler, ıskalar",
|
||||
"settings.smooth_lighting": "",
|
||||
"settings.smooth_lighting_help": "",
|
||||
"settings.sounds": "Oyun sesleri",
|
||||
"settings.sounds_help": "Bazı telefonları yavaşlatabilir.",
|
||||
"settings.sounds_help": "Bipler, blooplar ve brrrr",
|
||||
"settings.stress_test": "",
|
||||
"settings.stress_test_help": "",
|
||||
"starting_perks.checked": "Yeni bir oyuna başladığınızda, bu avantajlardan biri size verilecektir. Bir avantajı hariç tutmak için tıklayın.",
|
||||
"starting_perks.help": "Olası başlangıç yükseltmelerini seçin",
|
||||
"starting_perks.random": "Tüm avantajlar kaldırıldı, seçim rastgele olacak.",
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
<body>
|
||||
<button id="menu">☰ <span id="menuLabel">menu</span></button>
|
||||
<button id="score"></button>
|
||||
<div id="stats" style="display: none"></div>
|
||||
|
||||
<canvas id="game"></canvas>
|
||||
<div id="popup">
|
||||
|
|
|
@ -142,7 +142,7 @@ export function newGameState(params: RunParams): GameState {
|
|||
creative:
|
||||
params?.computer_controlled ||
|
||||
sumOfValues(params.perks) > 1 ||
|
||||
(params.level && !params.level.name.startsWith("icon:"))
|
||||
(params.level && !params.level.name.startsWith("icon:")),
|
||||
};
|
||||
resetBalls(gameState);
|
||||
|
||||
|
|
|
@ -30,6 +30,16 @@ export const options = {
|
|||
name: t("settings.extra_bright"),
|
||||
help: t("settings.extra_bright_help"),
|
||||
},
|
||||
smooth_lighting: {
|
||||
default: true,
|
||||
name: t("settings.smooth_lighting"),
|
||||
help: t("settings.smooth_lighting_help"),
|
||||
},
|
||||
precise_lighting: {
|
||||
default: true,
|
||||
name: t("settings.precise_lighting"),
|
||||
help: t("settings.precise_lighting_help"),
|
||||
},
|
||||
contrast: {
|
||||
default: false,
|
||||
name: t("settings.contrast"),
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
brickCenterY,
|
||||
currentLevelInfo,
|
||||
getCoinRenderColor,
|
||||
getCornerOffset,
|
||||
isMovingWhilePassiveIncome,
|
||||
isPickyEatingPossible,
|
||||
max_levels,
|
||||
|
@ -50,7 +51,9 @@ const haloCanvasCtx = haloCanvas.getContext("2d", {
|
|||
alpha: false,
|
||||
}) as CanvasRenderingContext2D;
|
||||
|
||||
export const haloScale = 16;
|
||||
export function getHaloScale() {
|
||||
return 16 * (isOptionOn("precise_lighting") ? 1 : 2);
|
||||
}
|
||||
|
||||
export function render(gameState: GameState) {
|
||||
startWork("render:init");
|
||||
|
@ -77,13 +80,9 @@ export function render(gameState: GameState) {
|
|||
scoreDisplay.innerHTML =
|
||||
(isOptionOn("show_fps") || gameState.startParams.computer_controlled
|
||||
? `
|
||||
<span>
|
||||
${Math.floor((liveCount(gameState.coins) / getCurrentMaxCoins()) * 100)} %
|
||||
</span><span> / </span>
|
||||
<span class="${(Math.abs(lastMeasuredFPS - 60) < 2 && " ") || (Math.abs(lastMeasuredFPS - 60) < 10 && "good") || "bad"}">
|
||||
${lastMeasuredFPS} FPS
|
||||
</span><span> / </span>
|
||||
|
||||
`
|
||||
: "") +
|
||||
(isOptionOn("show_stats")
|
||||
|
@ -110,6 +109,7 @@ export function render(gameState: GameState) {
|
|||
"";
|
||||
// Clear
|
||||
if (!isOptionOn("basic") && level.svg && level.color === "#000000") {
|
||||
const haloScale = getHaloScale();
|
||||
startWork("render:halo:clear");
|
||||
haloCanvasCtx.globalCompositeOperation = "source-over";
|
||||
haloCanvasCtx.globalAlpha = 0.99;
|
||||
|
@ -176,11 +176,12 @@ export function render(gameState: GameState) {
|
|||
);
|
||||
});
|
||||
|
||||
startWork("render:halo:scale_up");
|
||||
ctx.globalAlpha = 1;
|
||||
ctx.globalCompositeOperation = "source-over";
|
||||
|
||||
ctx.imageSmoothingEnabled = true;
|
||||
ctx.imageSmoothingQuality = "high";
|
||||
ctx.imageSmoothingEnabled = isOptionOn("smooth_lighting") || false;
|
||||
ctx.drawImage(haloCanvas, 0, 0, width, height);
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
|
||||
|
@ -541,16 +542,18 @@ export function render(gameState: GameState) {
|
|||
|
||||
startWork("render:bottom_line");
|
||||
ctx.globalAlpha = 1;
|
||||
const corner = getCornerOffset(gameState);
|
||||
drawStraightLine(
|
||||
ctx,
|
||||
gameState,
|
||||
(hasCombo && gameState.perks.compound_interest && "#FF0000") ||
|
||||
(isOptionOn("mobile-mode") && "#FFFFFF") ||
|
||||
(corner && "#FFFFFF") ||
|
||||
"",
|
||||
gameState.offsetXRoundedDown,
|
||||
gameState.gameZoneHeight,
|
||||
width - gameState.offsetXRoundedDown,
|
||||
gameState.gameZoneHeight,
|
||||
gameState.offsetXRoundedDown - corner,
|
||||
gameState.gameZoneHeight - 1,
|
||||
width - gameState.offsetXRoundedDown + corner,
|
||||
gameState.gameZoneHeight - 1,
|
||||
1,
|
||||
);
|
||||
|
||||
|
@ -561,9 +564,8 @@ export function render(gameState: GameState) {
|
|||
level.svg &&
|
||||
level.color === "#000000"
|
||||
) {
|
||||
ctx.imageSmoothingEnabled = true;
|
||||
// haloCanvasCtx.globalCompositeOperation = 'multiply';
|
||||
// haloCanvasCtx.fillRect(0,0,haloCanvas.width,haloCanvas.height)
|
||||
ctx.imageSmoothingEnabled = isOptionOn("smooth_lighting") || false;
|
||||
|
||||
haloCanvasCtx.fillStyle = "#FFFFFF";
|
||||
haloCanvasCtx.globalAlpha = 0.25;
|
||||
haloCanvasCtx.globalCompositeOperation = "screen";
|
||||
|
@ -1155,7 +1157,11 @@ export function getDashOffset(gameState: GameState) {
|
|||
let wakeLock = null,
|
||||
wakeLockPending = false;
|
||||
function askForWakeLock(gameState: GameState) {
|
||||
if (gameState.startParams.computer_controlled && !wakeLock && !wakeLockPending) {
|
||||
if (
|
||||
gameState.startParams.computer_controlled &&
|
||||
!wakeLock &&
|
||||
!wakeLockPending
|
||||
) {
|
||||
wakeLockPending = true;
|
||||
try {
|
||||
navigator.wakeLock.request("screen").then((lock) => {
|
||||
|
|
|
@ -16,6 +16,7 @@ export function playPendingSounds(gameState: GameState) {
|
|||
};
|
||||
if (ex.vol) {
|
||||
sounds[soundName](
|
||||
// In stress test, dim the sounds but play them
|
||||
Math.min(1, ex.vol),
|
||||
pixelsToPan(gameState, ex.x),
|
||||
gameState.combo,
|
||||
|
|
1
src/types.d.ts
vendored
1
src/types.d.ts
vendored
|
@ -292,6 +292,7 @@ export type RunParams = {
|
|||
computer_controlled?: boolean;
|
||||
isEditorTrialRun?: number;
|
||||
isCreativeRun?: boolean;
|
||||
stress?: boolean;
|
||||
};
|
||||
export type OptionDef = {
|
||||
default: boolean;
|
||||
|
|
|
@ -766,7 +766,8 @@ export const rawUpgrades = [
|
|||
id: "transparency",
|
||||
max: 3,
|
||||
name: t("upgrades.transparency.name"),
|
||||
help: (lvl: number) => t("upgrades.transparency.tooltip", { lvl }),
|
||||
help: (lvl: number) =>
|
||||
t("upgrades.transparency.tooltip", { lvl, percent: lvl * 50 }),
|
||||
fullHelp: t("upgrades.transparency.verbose_description"),
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue