This commit is contained in:
Renan LE CARO 2025-04-16 15:30:20 +02:00
parent 277aa5682b
commit 21fa5f105e
8 changed files with 71 additions and 50 deletions

View file

@ -26,9 +26,16 @@ languages, I may add features again.
## To do
- redo video presentation
- Back to Creative Menu at the end of a Creative level
- make Corner Shot scale like Need Some Space
## Done
- don't show unlock toast at first startup for levels that are unlocked by default
- Droplet particle color should be gold for gold coins
## 29079818
- Imported levels : Mario, Minesweeper and Target
- Fixed an issue with localstorage saving of custom levels

24
dist/index.html vendored

File diff suppressed because one or more lines are too long

View file

@ -1317,10 +1317,11 @@
"name": "Mario!",
"credit": "Suggested by Nicolas03. A Mario level ! Sprite taken from https://art.pixilart.com/sr2d5c0683c82aws3.png . The sprite belongs to Nintendo"
},
{
"color": "",
"size": 16,
"bricks": "___llltCCttBC______lllCBBttCB______ltttBttltt______ltBrBClttt______lttCCCttBt______llttCBtttt______ltCBCttlll______ltBCCtCtCt______lttCCBCBrB______llltBCCtrB______ttttttlltt______CBrttlllll______CBrBCttttl______ttCCBttBtl______tttCCCtCCt______tBttBtltBt___",
"bricks": "___llltCCttBC______lllCBBttCB______lttbBbtltt______ltBrBClttt______lttCCCttBt______llttCBtttt______ltCBCttlll______ltBCCtCtCt______lttCCBCBrB______llltBCCtrB______ttttttlltt______CBrttlllll______CBrBCttttl______ttCCBttBtl______tttCCCtCCt______tBttBtltBt___",
"name": "Minesweeper",
"credit": "Suggested by Noodlemire. For once, you'll want to trigger as many mines as possible."
},
@ -1330,5 +1331,19 @@
"bricks": "__________________________________________________________________________________________________________________________WWW_______________WrrrW_____________WrWWWrW____________WrWBWrW____________WrWWWrW_____________WrrrW_______________WWW__________________________________________________________________________________________________________________________",
"name": "Target",
"credit": "Suggested by Noodlemire. Unusually small level, with lots of room to miss your shots. Acts as decent aim practice."
},
{
"color": "",
"size": 10,
"bricks": "__________rrrrr_____WWrWWrrrrrWWrWWWWrWWWWrWWWWrWWrWrWWWWrWWWrWWWrWrWW_____WrWWW____________________",
"name": "The Boys",
"credit": "Suggested by Bearded-Axe. My boys initals"
},
{
"color": "#115988",
"size": 21,
"bricks": "__________________________________________________yy_______________yy__yy__yy___________yy__yy__yy____________yy__yy_yy_________y__yy__yy_yy________yyy_yyy_yy_yy_________yy__yy_yyyyy__________yy_yyyyyyyy___yyy____yyyyygggyyy__yyy______yyygBBBgyy_yyy________ygBBBBBgyyyy_________ygBBBBBgyyy__________yygBBBgyyyy___________yygBgyyyy____________yyyByyyy_____________yyyyByy_______________yyByy_________________r_________________________________",
"name": "A Very Dangerous High-Five",
"credit": "Suggested by Noodlemire. A unique shape, fun to bounce the ball between fingers. The palm was initially boring on its own, so I gave it a big bomb. It adds a distinct feeling between the top and bottom halves."
}
]

View file

@ -18,7 +18,7 @@ import {
currentLevelInfo,
distance2,
distanceBetween,
getClosestBall,
getClosestBall, getCoinRenderColor,
getMajorityValue,
getPossibleUpgrades,
getRowColIndex,
@ -660,9 +660,7 @@ 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
: "#ffd300",
getCoinRenderColor(gameState, coin),
true,
gameState.coinSize / 2,
@ -1237,7 +1235,7 @@ export function gameStateTick(
gameState.gameZoneHeight,
-coin.vx / 5,
-coin.vy / 5,
coin.color,
getCoinRenderColor(gameState, coin),
false,
);
}

View file

@ -1,18 +1,11 @@
import {
Ball,
GameState,
Level,
PerkId,
PerksMap,
RunHistoryItem,
UpgradeLike,
} from "./types";
import {Ball, Coin, GameState, Level, PerkId, PerksMap, RunHistoryItem, UpgradeLike,} from "./types";
import {icons, upgrades} from "./loadGameData";
import {t} from "./i18n/i18n";
import {clamp} from "./pure_functions";
import {rawUpgrades} from "./upgrades";
import {hashCode} from "./getLevelBackground";
import {getTotalScore} from "./settings";
import {isOptionOn} from "./options";
export function describeLevel(level: Level) {
let bricks = 0,
@ -400,3 +393,14 @@ export function ballTransparency(ball: Ball, gameState: GameState) {
1,
);
}
export function getCoinRenderColor(gameState: GameState, coin: Coin) {
if (
gameState.perks.metamorphosis ||
isOptionOn("colorful_coins") ||
gameState.perks.hypnosis ||
gameState.perks.rainbow
)
return coin.color;
return "#ffd300";
}

View file

@ -28,7 +28,7 @@ describe("json data checks", () => {
.filter((l) => {
const uniqueBricks = l.bricks
.split("")
.filter((b) => b !== "_" && b !== "black")
.filter((b) => b !== "_" && b !== "B")
.filter((a, b, c) => c.indexOf(a) === b);
return uniqueBricks.length > 5 && !l.name.startsWith("icon:");
})

View file

@ -32,6 +32,9 @@ export function monitorLevelsUnlocks(gameState: GameState) {
// Already unlocked
if (unlocked.has(name)) return;
// Score not reached yet
if (gameState.score < minScore) return;
if (! minScore) return;
if (gameState.score < minScore) return;
// We are missing a required perk
if (required.find((id) => !gameState.perks[id])) return;

View file

@ -4,6 +4,7 @@ import {
brickCenterX,
brickCenterY,
currentLevelInfo,
getCoinRenderColor,
isMovingWhilePassiveIncome,
isPickyEatingPossible,
max_levels,
@ -11,7 +12,7 @@ import {
telekinesisEffectRate,
yoyoEffectRate,
} from "./game_utils";
import { Coin, colorString, GameState } from "./types";
import {colorString, GameState} from "./types";
import {t} from "./i18n/i18n";
import {gameState, lastMeasuredFPS, startWork} from "./game";
import {isOptionOn} from "./options";
@ -1151,17 +1152,6 @@ export function getDashOffset(gameState: GameState) {
return Math.floor(((gameState.levelTime % 500) / 500) * 10) % 10;
}
function getCoinRenderColor(gameState: GameState, coin: Coin) {
if (
gameState.perks.metamorphosis ||
isOptionOn("colorful_coins") ||
gameState.perks.hypnosis ||
gameState.perks.rainbow
)
return coin.color;
return "#ffd300";
}
let wakeLock = null,
wakeLockPending = false;
function askForWakeLock(gameState: GameState) {