Build 29062545

This commit is contained in:
Renan LE CARO 2025-04-04 09:45:35 +02:00
parent 51d112c942
commit 7d518f14e5
11 changed files with 81 additions and 50 deletions

View file

@ -17,14 +17,18 @@ Break colourful bricks, catch bouncing coins and select powerful upgrades !
## Todo ## Todo
## Next release - Perks list now only lists upgrades that have been picked, or have banned levels
- After clearing a level, that level is dimmed in the clairvoyant level list [Bearded-Axe]
- limited clairvoyant to level one outside looped runs [obigre]
- yoyo now has more effect when the ball is at the top of the screen [obigre]
- telekinesis now has more effect when the ball is at the bottom of the screen
- "Top is lava" combo lost text is now spawned a bit lower to be more visible [obigre]
## 29061838
- New perk : Fountain toss [colin] - loosing coins makes your combo grow - New perk : Fountain toss [colin] - loosing coins makes your combo grow
- Boosted : Asceticism now decreases combo instead of resetting it - Boosted : Asceticism now decreases combo instead of resetting it
- Graphics : show respawn particles even in basic mode [obigre]
## 29061801
- Graphics : show respawn particles even in basic mode
- Graphics : adjusted the brightness of the game a bit more - Graphics : adjusted the brightness of the game a bit more
## 29061490 ## 29061490

View file

@ -29,8 +29,8 @@ android {
applicationId = "me.lecaro.breakout" applicationId = "me.lecaro.breakout"
minSdk = 21 minSdk = 21
targetSdk = 34 targetSdk = 34
versionCode = 29061838 versionCode = 29062545
versionName = "29061838" versionName = "29062545"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
useSupportLibrary = true useSupportLibrary = true

File diff suppressed because one or more lines are too long

43
dist/index.html vendored
View file

@ -874,7 +874,7 @@ async function openUpgradesPicker(gameState) {
level: gameState.currentLevel + 1, level: gameState.currentLevel + 1,
max: (0, _gameUtils.max_levels)(gameState) max: (0, _gameUtils.max_levels)(gameState)
})} </p> })} </p>
<p>${(0, _gameUtils.levelsListHTMl)(gameState)}</p> <p>${(0, _gameUtils.levelsListHTMl)(gameState, gameState.currentLevel + 1)}</p>
`, `,
...actions, ...actions,
(0, _gameUtils.pickedUpgradesHTMl)(gameState), (0, _gameUtils.pickedUpgradesHTMl)(gameState),
@ -983,7 +983,7 @@ async function openScorePanel() {
}), }),
content: [ content: [
(0, _gameUtils.pickedUpgradesHTMl)(gameState), (0, _gameUtils.pickedUpgradesHTMl)(gameState),
(0, _gameUtils.levelsListHTMl)(gameState), (0, _gameUtils.levelsListHTMl)(gameState, gameState.currentLevel),
gameState.rerolls ? (0, _i18N.t)("score_panel.rerolls_count", { gameState.rerolls ? (0, _i18N.t)("score_panel.rerolls_count", {
rerolls: gameState.rerolls rerolls: gameState.rerolls
}) : "" }) : ""
@ -1482,7 +1482,7 @@ const upgrades = (0, _upgrades.rawUpgrades).map((u)=>({
})); }));
},{"./data/palette.json":"ktRBU","./data/levels.json":"8JSUc","./data/version.json":"iyP6E","./upgrades":"1u3Dx","./getLevelBackground":"7OIPf","./levelIcon":"6rQoT","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"iyP6E":[function(require,module,exports,__globalThis) { },{"./data/palette.json":"ktRBU","./data/levels.json":"8JSUc","./data/version.json":"iyP6E","./upgrades":"1u3Dx","./getLevelBackground":"7OIPf","./levelIcon":"6rQoT","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"iyP6E":[function(require,module,exports,__globalThis) {
module.exports = JSON.parse("\"29061838\""); module.exports = JSON.parse("\"29062545\"");
},{}],"1u3Dx":[function(require,module,exports,__globalThis) { },{}],"1u3Dx":[function(require,module,exports,__globalThis) {
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
@ -2062,7 +2062,7 @@ const rawUpgrades = [
threshold: 145000, threshold: 145000,
giftable: false, giftable: false,
id: "clairvoyant", id: "clairvoyant",
max: 3, max: 1,
name: (0, _i18N.t)("upgrades.clairvoyant.name"), name: (0, _i18N.t)("upgrades.clairvoyant.name"),
help: (lvl)=>(0, _i18N.t)("upgrades.clairvoyant.help"), help: (lvl)=>(0, _i18N.t)("upgrades.clairvoyant.help"),
fullHelp: (0, _i18N.t)("upgrades.clairvoyant.fullHelp") fullHelp: (0, _i18N.t)("upgrades.clairvoyant.fullHelp")
@ -2622,8 +2622,8 @@ parcelHelpers.export(exports, "levelsListHTMl", ()=>levelsListHTMl);
parcelHelpers.export(exports, "currentLevelInfo", ()=>currentLevelInfo); parcelHelpers.export(exports, "currentLevelInfo", ()=>currentLevelInfo);
parcelHelpers.export(exports, "isPickyEatingPossible", ()=>isPickyEatingPossible); parcelHelpers.export(exports, "isPickyEatingPossible", ()=>isPickyEatingPossible);
parcelHelpers.export(exports, "reachRedRowIndex", ()=>reachRedRowIndex); parcelHelpers.export(exports, "reachRedRowIndex", ()=>reachRedRowIndex);
parcelHelpers.export(exports, "isTelekinesisActive", ()=>isTelekinesisActive); parcelHelpers.export(exports, "telekinesisEffectRate", ()=>telekinesisEffectRate);
parcelHelpers.export(exports, "isYoyoActive", ()=>isYoyoActive); parcelHelpers.export(exports, "yoyoEffectRate", ()=>yoyoEffectRate);
parcelHelpers.export(exports, "findLast", ()=>findLast); parcelHelpers.export(exports, "findLast", ()=>findLast);
parcelHelpers.export(exports, "distance2", ()=>distance2); parcelHelpers.export(exports, "distance2", ()=>distance2);
parcelHelpers.export(exports, "distanceBetween", ()=>distanceBetween); parcelHelpers.export(exports, "distanceBetween", ()=>distanceBetween);
@ -2633,6 +2633,7 @@ parcelHelpers.export(exports, "isMovingWhilePassiveIncome", ()=>isMovingWhilePas
parcelHelpers.export(exports, "highScoreForMode", ()=>highScoreForMode); parcelHelpers.export(exports, "highScoreForMode", ()=>highScoreForMode);
var _loadGameData = require("./loadGameData"); var _loadGameData = require("./loadGameData");
var _i18N = require("./i18n/i18n"); var _i18N = require("./i18n/i18n");
var _pureFunctions = require("./pure_functions");
function describeLevel(level) { function describeLevel(level) {
let bricks = 0, colors = new Set(), bombs = 0; let bricks = 0, colors = new Set(), bombs = 0;
level.bricks.forEach((color)=>{ level.bricks.forEach((color)=>{
@ -2689,7 +2690,7 @@ function max_levels(gameState) {
return Math.max(7 + gameState.perks.extra_levels - gameState.loop, 1); return Math.max(7 + gameState.perks.extra_levels - gameState.loop, 1);
} }
function pickedUpgradesHTMl(gameState) { function pickedUpgradesHTMl(gameState) {
const upgradesList = getPossibleUpgrades(gameState).map((u)=>{ const upgradesList = getPossibleUpgrades(gameState).filter((u)=>gameState.bannedPerks[u.id] || gameState.perks[u.id]).map((u)=>{
const newMax = Math.max(0, u.max - gameState.bannedPerks[u.id]); const newMax = Math.max(0, u.max - gameState.bannedPerks[u.id]);
let bars = []; let bars = [];
for(let i = 0; i < Math.max(u.max, newMax, gameState.perks[u.id]); i++){ for(let i = 0; i < Math.max(u.max, newMax, gameState.perks[u.id]); i++){
@ -2719,11 +2720,11 @@ function pickedUpgradesHTMl(gameState) {
}).sort((a, b)=>a.state - b.state).map((a)=>a.html); }).sort((a, b)=>a.state - b.state).map((a)=>a.html);
return ` <p>${(0, _i18N.t)("score_panel.upgrades_picked")}</p>` + upgradesList.join(""); return ` <p>${(0, _i18N.t)("score_panel.upgrades_picked")}</p>` + upgradesList.join("");
} }
function levelsListHTMl(gameState) { function levelsListHTMl(gameState, level) {
if (!gameState.perks.clairvoyant) return ""; if (!gameState.perks.clairvoyant) return "";
if (gameState.mode === "creative") return ""; if (gameState.mode === "creative") return "";
let list = ""; let list = "";
for(let i = 0; i < max_levels(gameState); i++)list += `<span style="opacity: ${i >= gameState.currentLevel ? 1 : 0.2}" title="${gameState.runLevels[i].name}">${(0, _loadGameData.icons)[gameState.runLevels[i].name]}</span>`; for(let i = 0; i < max_levels(gameState); i++)list += `<span style="opacity: ${i >= level ? 1 : 0.2}" title="${gameState.runLevels[i].name}">${(0, _loadGameData.icons)[gameState.runLevels[i].name]}</span>`;
return `<p>${(0, _i18N.t)("score_panel.upcoming_levels")}</p><p>${list}</p>`; return `<p>${(0, _i18N.t)("score_panel.upcoming_levels")}</p><p>${list}</p>`;
} }
function currentLevelInfo(gameState) { function currentLevelInfo(gameState) {
@ -2749,11 +2750,11 @@ function reachRedRowIndex(gameState) {
if (maxYCount === size) return -1; if (maxYCount === size) return -1;
return maxY; return maxY;
} }
function isTelekinesisActive(gameState, ball) { function telekinesisEffectRate(gameState, ball) {
return gameState.perks.telekinesis && ball.vy < 0; return gameState.perks.telekinesis && ball.vy < 0 && (0, _pureFunctions.clamp)(ball.y / gameState.gameZoneHeight * 1.1 + 0.1, 0, 1) || 0;
} }
function isYoyoActive(gameState, ball) { function yoyoEffectRate(gameState, ball) {
return gameState.perks.yoyo && ball.vy > 0; return gameState.perks.yoyo && ball.vy > 0 && (0, _pureFunctions.clamp)(1 - ball.y / gameState.gameZoneHeight * 1.1 + 0.1, 0, 1) || 0;
} }
function findLast(arr, predicate) { function findLast(arr, predicate) {
let i = arr.length; let i = arr.length;
@ -2823,7 +2824,7 @@ function highScoreForMode(mode) {
return ""; return "";
} }
},{"./loadGameData":"l1B4x","./i18n/i18n":"eNPRm","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"2n0gK":[function(require,module,exports,__globalThis) { },{"./loadGameData":"l1B4x","./i18n/i18n":"eNPRm","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3","./pure_functions":"6pQh7"}],"2n0gK":[function(require,module,exports,__globalThis) {
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
parcelHelpers.defineInteropFlag(exports); parcelHelpers.defineInteropFlag(exports);
if ("serviceWorker" in navigator && window.location.href.endsWith("/index.html?isPWA=true")) { if ("serviceWorker" in navigator && window.location.href.endsWith("/index.html?isPWA=true")) {
@ -3520,13 +3521,13 @@ function ballTick(gameState, ball, delta) {
ball.previousVX = ball.vx; ball.previousVX = ball.vx;
ball.previousVY = ball.vy; ball.previousVY = ball.vy;
let speedLimitDampener = 1 + gameState.perks.telekinesis + gameState.perks.ball_repulse_ball + gameState.perks.puck_repulse_ball + gameState.perks.ball_attract_ball; let speedLimitDampener = 1 + gameState.perks.telekinesis + gameState.perks.ball_repulse_ball + gameState.perks.puck_repulse_ball + gameState.perks.ball_attract_ball;
if ((0, _gameUtils.isTelekinesisActive)(gameState, ball)) { if ((0, _gameUtils.telekinesisEffectRate)(gameState, ball) > 0) {
speedLimitDampener += 3; speedLimitDampener += 3;
ball.vx += (gameState.puckPosition - ball.x) / 1000 * delta * gameState.perks.telekinesis; ball.vx += (gameState.puckPosition - ball.x) / 1000 * delta * gameState.perks.telekinesis * (0, _gameUtils.telekinesisEffectRate)(gameState, ball);
} }
if ((0, _gameUtils.isYoyoActive)(gameState, ball)) { if ((0, _gameUtils.yoyoEffectRate)(gameState, ball) > 0) {
speedLimitDampener += 3; speedLimitDampener += 3;
ball.vx += (gameState.puckPosition - ball.x) / 1000 * delta * gameState.perks.yoyo; ball.vx += (gameState.puckPosition - ball.x) / 1000 * delta * gameState.perks.yoyo * (0, _gameUtils.yoyoEffectRate)(gameState, ball);
} }
if (ball.vx * ball.vx + ball.vy * ball.vy < gameState.baseSpeed * gameState.baseSpeed * 2) { if (ball.vx * ball.vx + ball.vy * ball.vy < gameState.baseSpeed * gameState.baseSpeed * 2) {
ball.vx *= 1 + 0.02 / speedLimitDampener; ball.vx *= 1 + 0.02 / speedLimitDampener;
@ -3555,7 +3556,7 @@ function ballTick(gameState, ball, delta) {
if (borderHitCode) { if (borderHitCode) {
if (gameState.perks.left_is_lava && borderHitCode % 2 && ball.x < gameState.offsetX + gameState.gameZoneWidth / 2) resetCombo(gameState, ball.x, ball.y); if (gameState.perks.left_is_lava && borderHitCode % 2 && ball.x < gameState.offsetX + gameState.gameZoneWidth / 2) resetCombo(gameState, ball.x, ball.y);
if (gameState.perks.right_is_lava && borderHitCode % 2 && ball.x > gameState.offsetX + gameState.gameZoneWidth / 2) resetCombo(gameState, ball.x, ball.y); if (gameState.perks.right_is_lava && borderHitCode % 2 && ball.x > gameState.offsetX + gameState.gameZoneWidth / 2) resetCombo(gameState, ball.x, ball.y);
if (gameState.perks.top_is_lava && borderHitCode >= 2) resetCombo(gameState, ball.x, ball.y + gameState.ballSize); if (gameState.perks.top_is_lava && borderHitCode >= 2) resetCombo(gameState, ball.x, ball.y + gameState.ballSize * 3);
if (gameState.perks.trampoline) decreaseCombo(gameState, gameState.perks.trampoline, ball.x, ball.y + gameState.ballSize); if (gameState.perks.trampoline) decreaseCombo(gameState, gameState.perks.trampoline, ball.x, ball.y + gameState.ballSize);
schedulGameSound(gameState, "wallBeep", ball.x, 1); schedulGameSound(gameState, "wallBeep", ball.x, 1);
gameState.levelWallBounces++; gameState.levelWallBounces++;
@ -3997,15 +3998,17 @@ function render(gameState) {
const drawingColor = gameState.ballsColor; const drawingColor = gameState.ballsColor;
// The white border around is to distinguish colored balls from coins/bg // The white border around is to distinguish colored balls from coins/bg
drawBall(ctx, drawingColor, gameState.ballSize, ball.x, ball.y, gameState.puckColor); drawBall(ctx, drawingColor, gameState.ballSize, ball.x, ball.y, gameState.puckColor);
if ((0, _gameUtils.isTelekinesisActive)(gameState, ball) || (0, _gameUtils.isYoyoActive)(gameState, ball)) { if ((0, _gameUtils.telekinesisEffectRate)(gameState, ball) || (0, _gameUtils.yoyoEffectRate)(gameState, ball)) {
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(gameState.puckPosition, gameState.gameZoneHeight); ctx.moveTo(gameState.puckPosition, gameState.gameZoneHeight);
ctx.globalAlpha = Math.max((0, _gameUtils.telekinesisEffectRate)(gameState, ball), (0, _gameUtils.yoyoEffectRate)(gameState, ball));
ctx.strokeStyle = gameState.puckColor; ctx.strokeStyle = gameState.puckColor;
ctx.bezierCurveTo(gameState.puckPosition, gameState.gameZoneHeight, gameState.puckPosition, ball.y, ball.x, ball.y); ctx.bezierCurveTo(gameState.puckPosition, gameState.gameZoneHeight, gameState.puckPosition, ball.y, ball.x, ball.y);
ctx.stroke(); ctx.stroke();
ctx.lineWidth = 2; ctx.lineWidth = 2;
ctx.setLineDash(emptyArray); ctx.setLineDash(emptyArray);
} }
ctx.globalAlpha = 1;
if (gameState.perks.clairvoyant && gameState.ballStickToPuck) { if (gameState.perks.clairvoyant && gameState.ballStickToPuck) {
ctx.strokeStyle = gameState.ballsColor; ctx.strokeStyle = gameState.ballsColor;
ctx.beginPath(); ctx.beginPath();

View file

@ -1,5 +1,5 @@
// The version of the cache. // The version of the cache.
const VERSION = "29061838"; const VERSION = "29062545";
// The name of the cache // The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`; const CACHE_NAME = `breakout-71-${VERSION}`;

View file

@ -1 +1 @@
"29061838" "29062545"

View file

@ -291,7 +291,7 @@ export async function openUpgradesPicker(gameState: GameState) {
level: gameState.currentLevel + 1, level: gameState.currentLevel + 1,
max: max_levels(gameState), max: max_levels(gameState),
})} </p> })} </p>
<p>${levelsListHTMl(gameState)}</p> <p>${levelsListHTMl(gameState, gameState.currentLevel + 1)}</p>
`, `,
...actions, ...actions,
pickedUpgradesHTMl(gameState), pickedUpgradesHTMl(gameState),
@ -456,7 +456,7 @@ async function openScorePanel() {
content: [ content: [
pickedUpgradesHTMl(gameState), pickedUpgradesHTMl(gameState),
levelsListHTMl(gameState), levelsListHTMl(gameState, gameState.currentLevel),
gameState.rerolls gameState.rerolls
? t("score_panel.rerolls_count", { rerolls: gameState.rerolls }) ? t("score_panel.rerolls_count", { rerolls: gameState.rerolls })
: "", : "",

View file

@ -24,8 +24,8 @@ import {
getRowColIndex, getRowColIndex,
isMovingWhilePassiveIncome, isMovingWhilePassiveIncome,
isPickyEatingPossible, isPickyEatingPossible,
isTelekinesisActive, telekinesisEffectRate,
isYoyoActive, yoyoEffectRate,
makeEmptyPerksMap, makeEmptyPerksMap,
max_levels, max_levels,
reachRedRowIndex, reachRedRowIndex,
@ -1428,17 +1428,22 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
gameState.perks.puck_repulse_ball + gameState.perks.puck_repulse_ball +
gameState.perks.ball_attract_ball; gameState.perks.ball_attract_ball;
if (isTelekinesisActive(gameState, ball)) { if (telekinesisEffectRate(gameState, ball) > 0) {
speedLimitDampener += 3; speedLimitDampener += 3;
ball.vx += ball.vx +=
((gameState.puckPosition - ball.x) / 1000) * ((gameState.puckPosition - ball.x) / 1000) *
delta * delta *
gameState.perks.telekinesis; gameState.perks.telekinesis *
telekinesisEffectRate(gameState, ball);
} }
if (isYoyoActive(gameState, ball)) { if (yoyoEffectRate(gameState, ball) > 0) {
speedLimitDampener += 3; speedLimitDampener += 3;
ball.vx += ball.vx +=
((gameState.puckPosition - ball.x) / 1000) * delta * gameState.perks.yoyo; ((gameState.puckPosition - ball.x) / 1000) *
delta *
gameState.perks.yoyo *
yoyoEffectRate(gameState, ball);
} }
if ( if (
ball.vx * ball.vx + ball.vy * ball.vy < ball.vx * ball.vx + ball.vy * ball.vy <
@ -1511,7 +1516,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
} }
if (gameState.perks.top_is_lava && borderHitCode >= 2) { if (gameState.perks.top_is_lava && borderHitCode >= 2) {
resetCombo(gameState, ball.x, ball.y + gameState.ballSize); resetCombo(gameState, ball.x, ball.y + gameState.ballSize * 3);
} }
if (gameState.perks.trampoline) { if (gameState.perks.trampoline) {
decreaseCombo( decreaseCombo(

View file

@ -2,6 +2,7 @@ import { Ball, GameState, Level, PerkId, PerksMap } from "./types";
import { icons, upgrades } from "./loadGameData"; import { icons, upgrades } from "./loadGameData";
import { t } from "./i18n/i18n"; import { t } from "./i18n/i18n";
import { brickAt } from "./level_editor/levels_editor_util"; import { brickAt } from "./level_editor/levels_editor_util";
import { clamp } from "./pure_functions";
export function describeLevel(level: Level) { export function describeLevel(level: Level) {
let bricks = 0, let bricks = 0,
@ -83,6 +84,7 @@ export function max_levels(gameState: GameState) {
export function pickedUpgradesHTMl(gameState: GameState) { export function pickedUpgradesHTMl(gameState: GameState) {
const upgradesList = getPossibleUpgrades(gameState) const upgradesList = getPossibleUpgrades(gameState)
.filter((u) => gameState.bannedPerks[u.id] || gameState.perks[u.id])
.map((u) => { .map((u) => {
const newMax = Math.max(0, u.max - gameState.bannedPerks[u.id]); const newMax = Math.max(0, u.max - gameState.bannedPerks[u.id]);
@ -118,12 +120,12 @@ export function pickedUpgradesHTMl(gameState: GameState) {
return ` <p>${t("score_panel.upgrades_picked")}</p>` + upgradesList.join(""); return ` <p>${t("score_panel.upgrades_picked")}</p>` + upgradesList.join("");
} }
export function levelsListHTMl(gameState: GameState) { export function levelsListHTMl(gameState: GameState, level: number) {
if (!gameState.perks.clairvoyant) return ""; if (!gameState.perks.clairvoyant) return "";
if (gameState.mode === "creative") return ""; if (gameState.mode === "creative") return "";
let list = ""; let list = "";
for (let i = 0; i < max_levels(gameState); i++) { for (let i = 0; i < max_levels(gameState); i++) {
list += `<span style="opacity: ${i >= gameState.currentLevel ? 1 : 0.2}" title="${gameState.runLevels[i].name}">${icons[gameState.runLevels[i].name]}</span>`; list += `<span style="opacity: ${i >= level ? 1 : 0.2}" title="${gameState.runLevels[i].name}">${icons[gameState.runLevels[i].name]}</span>`;
} }
return `<p>${t("score_panel.upcoming_levels")}</p><p>${list}</p>`; return `<p>${t("score_panel.upcoming_levels")}</p><p>${list}</p>`;
} }
@ -159,11 +161,21 @@ export function reachRedRowIndex(gameState: GameState) {
return maxY; return maxY;
} }
export function isTelekinesisActive(gameState: GameState, ball: Ball) { export function telekinesisEffectRate(gameState: GameState, ball: Ball) {
return gameState.perks.telekinesis && ball.vy < 0; return (
(gameState.perks.telekinesis &&
ball.vy < 0 &&
clamp((ball.y / gameState.gameZoneHeight) * 1.1 + 0.1, 0, 1)) ||
0
);
} }
export function isYoyoActive(gameState: GameState, ball: Ball) { export function yoyoEffectRate(gameState: GameState, ball: Ball) {
return gameState.perks.yoyo && ball.vy > 0; return (
(gameState.perks.yoyo &&
ball.vy > 0 &&
clamp(1 - (ball.y / gameState.gameZoneHeight) * 1.1 + 0.1, 0, 1)) ||
0
);
} }
export function findLast<T>( export function findLast<T>(

View file

@ -7,8 +7,8 @@ import {
currentLevelInfo, currentLevelInfo,
isMovingWhilePassiveIncome, isMovingWhilePassiveIncome,
isPickyEatingPossible, isPickyEatingPossible,
isTelekinesisActive, telekinesisEffectRate,
isYoyoActive, yoyoEffectRate,
max_levels, max_levels,
reachRedRowIndex, reachRedRowIndex,
} from "./game_utils"; } from "./game_utils";
@ -363,10 +363,16 @@ export function render(gameState: GameState) {
gameState.puckColor, gameState.puckColor,
); );
if (isTelekinesisActive(gameState, ball) || isYoyoActive(gameState, ball)) { if (
telekinesisEffectRate(gameState, ball) ||
yoyoEffectRate(gameState, ball)
) {
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(gameState.puckPosition, gameState.gameZoneHeight); ctx.moveTo(gameState.puckPosition, gameState.gameZoneHeight);
ctx.globalAlpha = Math.max(
telekinesisEffectRate(gameState, ball),
yoyoEffectRate(gameState, ball),
);
ctx.strokeStyle = gameState.puckColor; ctx.strokeStyle = gameState.puckColor;
ctx.bezierCurveTo( ctx.bezierCurveTo(
gameState.puckPosition, gameState.puckPosition,
@ -381,6 +387,7 @@ export function render(gameState: GameState) {
ctx.lineWidth = 2; ctx.lineWidth = 2;
ctx.setLineDash(emptyArray); ctx.setLineDash(emptyArray);
} }
ctx.globalAlpha = 1;
if (gameState.perks.clairvoyant && gameState.ballStickToPuck) { if (gameState.perks.clairvoyant && gameState.ballStickToPuck) {
ctx.strokeStyle = gameState.ballsColor; ctx.strokeStyle = gameState.ballsColor;
ctx.beginPath(); ctx.beginPath();

View file

@ -596,7 +596,7 @@ export const rawUpgrades = [
threshold: 145000, threshold: 145000,
giftable: false, giftable: false,
id: "clairvoyant", id: "clairvoyant",
max: 3, max: 1,
name: t("upgrades.clairvoyant.name"), name: t("upgrades.clairvoyant.name"),
help: (lvl: number) => t("upgrades.clairvoyant.help"), help: (lvl: number) => t("upgrades.clairvoyant.help"),
fullHelp: t("upgrades.clairvoyant.fullHelp"), fullHelp: t("upgrades.clairvoyant.fullHelp"),