diff --git a/.gitignore b/.gitignore
index 6c6dd93..8a25d13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,7 @@
*.iml
.gradle
/local.properties
-/.idea/caches
-/.idea/libraries
-/.idea/modules.xml
-/.idea/workspace.xml
-/.idea/navEditor.xml
-/.idea/assetWizardSettings.xml
+/.idea
.DS_Store
/build
/captures
@@ -15,5 +10,7 @@
local.properties
node_modules
*.zip
-app/release/app-release.aab
-.parcel-cache/
\ No newline at end of file
+app/release/
+.parcel-cache/
+dist
+keystore.properties
\ No newline at end of file
diff --git a/Credits.md b/Credits.md
deleted file mode 100644
index 3664bb5..0000000
--- a/Credits.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# Credits
-
-I pulled many background patterns from https://pattern.monster/
-They are displayed in [patterns.html](patterns.html) for easy inclusion.
-
-Some of the sound generating code was written by ChatGPT, and heavily
-adapted to my usage over time.
-
-Some of the pixel art is taken from google image search results, I hope to replace it by my own over time :
-[Heart](https://www.youtube.com/watch?v=gdWiTfzXb1g)
-[Mushroom](https://pixelartmaker.com/art/cce4295a92035ea)
-https://prohama.com/whale-2-pattern/
-https://prohama.com/shark-2-pattern/
-https://prohama.com/bird-1-size-13x12/
-https://prohama.com/pingwin-4-pattern/
-https://prohama.com/dog-21-pattern/
-
-I wanted an APK to start in fullscreen and be able to list it on fdroid and the play store. I started with an empty view and went to work trimming it down, with the help of that tutorial
-https://github.com/fractalwrench/ApkGolf/blob/master/blog/BLOG_POST.md
diff --git a/Help.md b/Help.md
deleted file mode 100644
index eefd6b1..0000000
--- a/Help.md
+++ /dev/null
@@ -1,113 +0,0 @@
-
-# Goal
-
-The goal is to catch as many coins as possible during 7 levels.
-Coins appear when you break bricks.
-They fly around, bounce and roll, and you need to catch them with your puck to increase your score.
-Your score is displayed in the top right corner of the screen.
-You must delete all bricks to progress to the next level.
-If you drop the ball, it's game over, unless you had the "extra life" upgrade.
-
-# Upgrades
-
-After clearing a level, you'll be able to pick upgrades among a small selection presented to you.
-The upgrade you pick will apply until the end of the run. You will get more upgrade choices, and even the ability to pick
-multiple upgrades at the end of the level if you play well : catch all coins, clear the level quickly and never miss.
-You also get a free random upgrade at the beginning of each run. You can see which upgrades you have
-(and a few more details) by clicking your score at the top right of the screen.
-
-Upgrades apply to the whole run and can synergize. For example, if you combine "sapper" and "piercing", the first brick
-you hit after a puck bounce will immediately be transformed to an explosive brick, and detonated by the same ball,
-effectively giving you an explosive ball.
-
-Some upgrades help with aiming, like "puck control balls". Some upgrades can be picked multiple times to increase the effect, you'll see for example "+1 ball level 2" which adds a third ball.
-
-When you first play, only a few upgrades are available, you unlock the rest by simply playing and scoring points. There's a similar
-mechanic for levels unlock. At the end of a run, the things you just unlocked will be shown, and you can check the full content in menu / unlocks.
-
-Many upgrades impact your combo.
-
-# Combo
-
-Your "combo" is the number of coins spawned when a brick breaks. It is displayed on your puck, for example x4 means each
-brick will spawn 4 coins. It will reset if you miss.
-
-Many upgrades impact your combo :
-
-### Single puck hit streak
-
-The combo grows by one when breaking a brick, but resets when a ball hits the puck.
-Once you combo is high, the puck will glow red, to remind you that it will hurt your combo to touch it with any ball.
-The combo does not reset when the ball is lost, provided you have more than one ball.
-
-### +3 base combo
-
-The combo starts at 4, and resets to 4 if another upgrade resets it.
-Picking this again will raise the starting combo by 3 each time.
-There are no downsides to this upgrade.
-
-### Shoot straight
-
-The combo grow each time you break a brick.
-The combo resets whenever the ball touches the left or right of the play area.
-Once your combo is a bit high, the sides will glow red to let you know you shouldn't touch them.
-
-### Sky is the limit
-
-The combo grow each time you break a brick.
-The combo resets whenever the ball touches the top of the play area.
-Once your combo is a bit high, the top will glow red to let you know you shouldn't touch it.
-
-### Picky eater
-
-Each time you break a brick, if the ball and brick color are the same, your combo grows by one.
-Otherwise, the combo resets, and the ball takes the color of the brick.
-Bricks of the wrong colors should glow red once you have a small combo going.
-
-
-### Compound interest
-
-Each time you break a brick, your combo grows by one.
-Each time a coin falls around your puck and is lost, your combo decreases by one.
-Once you have a small combo going, the bottom of the screen will glow red around the puck, to remind you to catch all coins.
-If you level this further, then the combo grows and shrinks faster.
-
-
-### Hot start
-
-Your combo starts at 15 at the beginning of the level.
-Every second, it decreases by one.
-If you level this further, the combo starts 15 points higher and shrinks 1 point / s more.
-
-
-### Soft reset
-
-Whenever your combo resets, it only looses half of its value.
-However, whenever it should increase, it has 50% chance of staying the same.
-If you pick it a second time, the effect is more pronounced : the combo keeps 66% of its value on reset, but only grows 33% of the time.
-If you have many perks that grow the combo every time a brick breaks, then it will still grow every time just slower.
-
-# Longer runs
-
-The default run lasts 7 levels. The selection process is to pick those levels at random, then sort them (more or less) by
-number of bricks present, so that runs start with smaller levels and the bigger ones are left for the end. You can extend
-the run by picking up to three times the "+1 level" upgrade.
-
-"Sturdy bricks" and "Respawn" can also extend the game time significantly.
-
-# Aiming
-
-What decides how the ball flies away is only the position of the puck hit. If the ball hits the puck dead center, it will
-bounce back up vertically, while in you hit more on one side, it will have more angle.
-The puck speed and incoming angle have no impact on the ball direction after bouncing.
-You might find that a smaller puck makes it a bit easier to aim near corners, but also makes it much harder to catch coins.
-"Wind" and "puck controls ball" can help you aim even after the ball bounced to the wrong direction.
-"Slower ball" gives you a bit more time to aim, particularly useful in later levels where the ball goes faster. The ball also
-accelerates as you spend time in each level.
-
-# Requirements
-
-The app should work offline and perform well even on low-end devices.
-It's very lean and does not take much storage space (Roughly 0.1MB).
-If the app stutters, turn on "fast mode" in the settings to render a simplified view that should be faster.
-There's also an easy mode for kids (slower ball) and a color-blind mode (no color related game mechanics).
diff --git a/Readme.md b/Readme.md
index 83058f1..e380439 100644
--- a/Readme.md
+++ b/Readme.md
@@ -3,12 +3,600 @@
Break colourful bricks, catch bouncing coins and select powerful upgrades !
- [Play now](https://breakout.lecaro.me/)
-- [Post your comments on itch.io](https://renanlecaro.itch.io/breakout71)
-- [Help and tips about the game](./Help.md)
-- [Credits](./Credits.md)
-- [Project Roadmap](./Roadmap.md)
-- [Open source android version on F-Droid](https://f-droid.org/en/packages/me.lecaro.breakout/)
+- [Donate](https://paypal.me/renanlecaro)
+- Bitcoin : bc1qlh8kywy3ttsuqqa08yx2rdc8dqhdvyt43wlxmr
+- [Discord](https://discord.gg/bbcQw4x5zA)
+- [itch.io](https://renanlecaro.itch.io/breakout71)
+- [F-Droid](https://f-droid.org/en/packages/me.lecaro.breakout/)
- [Google Play](https://play.google.com/store/apps/details?id=me.lecaro.breakout)
- [GitLab](https://gitlab.com/lecarore/breakout71)
-- [HackerNews thread](https://news.ycombinator.com/item?id=43183131)
-- [Donate](https://github.com/sponsors/renanlecaro)
\ No newline at end of file
+
+# Changelog
+## To do
+
+
+## Done
+
+- performance tweaks suggestions
+
+## 29106110
+- reworked level up screen :
+ - bigger "level X / Y cleared"
+ - upgardes need to all be spent on the same list of perks (to avoid reading too much)
+ - instead of rerolls, you get a longer list of choices to pick from with silver/gold medals
+ - clarified challenges, only show them when you pass one of them
+ - removed the "sides bounce" challenge, bouncing on sides shouldn't be punished
+ - once you reach high score of 1000, level unlock hints appear, and required / forbidden upgrades and colored gold/red
+ - added tooltip on most items on that screen, that can be triggered on mobile by tapping the text
+
+- new perk : steering
+- boosted perk : stronger foundation (+3 combo, then +4, then +5..)
+- easy cleanup special effect (and X made of particles)
+- added a few levels
+- level end countdown (on mobile and desktop)
+- level start countdown (on mobile)
+- loosing ball is ok during level end countdown
+
+- unlocked upgrades and levels : split item description (with tooltip) and "try" button
+- creative mode : removed tooltips for perks as they were getting in the way on mobile
+- Fix: removed progress bars from unlocked level as there's no real progress
+- Fix :upgrades list now uses numbers instead of bars, looks better with limitless
+- Fix :somehow score clicks didn't register while the game was playing, that's solved
+- Fix : click tooltip to open on mobile, click anywhere to close
+- Fix: Can't press help buttons in Creative Menu
+- Fix: wait for bricks to respawn before leveling up
+- UX : score and menu button look extra clickable until you tap them 3 times and restart the app
+
+## 29097764
+
+- Added levels : Fish, Spider, GlidersLone island,Spacewyrm Jon, Taijitu, Egg pan, Inception, Chess
+
+## 29095000
+
+- hardcoded the levels unlock conditions so that they wouldn't change at each update
+- added a "display level code" button in level editor
+- passive income : paddle will be transparent for a much shorter time
+- better mobile mode detection
+- clear tooltip on page scroll
+
+## 29092809
+
+- fixed: crash when running out of levels (i think, i didn't try)
+- fixed: context menu and tooltip stuck on windows
+
+## 29091656
+
+- categorized the icons
+- color coded the icons
+- changed the wording of perks help to be shorter
+- added tooltips on perks with full help, and a help button on mobile
+- all or nothing : don't show negative number of coins cought, don't reduce score if no combo was lost
+- rename hypnosis to golden_goose, apply when hitting any brick, any side at level 2
+- removed comboIncreaseTexts option
+- minefield : +10% coins per bomb on screen
+- extra life are transparent when you have 2+ balls
+- removed : instant_upgrade
+- nerfed : helium : now need to be level 3 to have the same effect of keeping coins up
+- new level : Blinky by Big Goober
+- game over screen : perk list at the bottom, after unlocks and stats
+
+## 29088680
+
+- new perk: happy family: + lvl points per paddle bounce per extra ball, reset on ball lost
+- nerfed perk : sticky coins : stick to same color at level 1, any color at level 2+
+- nerfed perk: zen : combo increases every 3 seconds, resets on explosion
+
+## 29088513
+
+- included german corrections by Pock
+- added particle effect for wrap
+- removed grace period from passive income, updated icon
+
+## 29087440
+
+- zen : now you gain one combo per bomb on screen when breaking a brick (so no bombs, no gain)
+- sticky coins : coins stay stuck when there's an explosion
+- wrap_left / wrap_right : teleport the ball to the other side of the screen when it hits a border
+- passive income : now moving the puck makes it transparent to coins and balls, but not reset the combo
+- main menu : split level unlock and perks unlocks
+
+## 29087252
+- apply percentage boost to combo shown on brick
+- smaller puck now gives +50% coins per level
+- transparency now gives +50% coins if ALL balls are fully transparent, less otherwise
+- new perk : sticky coins (coins stick to bricks)
+- left/top/right is laval perks : at level 2+, the corresponding borders completely disappears (reachable with limitless)
+- new perk : three cushion (gain point for indirect hits)
+- live stats: coins still in the air appear as "lost" in the catch percentage, as in the final computation
+- level editor : removed the conditions on bricks count, level name and credits to be able to copy the code
+- shadow around ball when there are many coins : enabled in basic mode too
+- hot start : after reset, if you raise the combo again, only start ticking down after a whole second.
+- new perk : ottawa treaty, breaking a brick near a bomb disarms the bomb
+- shocks now doesn't add ball speed at level 1
+- creative mode UI rework
+- compound_interest : combo resets as soon as coin passes the paddle line
+- added bombs to implosion and kaboom starter levels
+- toast an error if storage is blocked
+- toast an error if migration fails
+- fixed video download in apk
+- ask for permanent storage
+- option: reuse past frame's light in new frame lighting computation when there are 150+ coins on screen, to limit the performance impact of rendering lots of lights
+
+## 29084606
+
+- simpler and more readable encoding for save files
+- removed check of payload signature on save file, seemed to fail because of the poor encoding of the name of the "côte d'ivoire" level
+- automatic detection of the number of steps required for physics
+- trial runs detection fix
+
+## 29083397
+
+- highlight last used creative level
+- access autoplay mode from the menu
+- access stress test mode from the menu, show real time stats
+- Render bottom border differently to show how far the puck can go
+- Corner Shot: scale like Need Some Space
+- grey out irrelevant options in the settings
+- Back to Creative Menu at the end of a Creative level
+
+## 29080170
+
+- don't show unlock toast at first startup for levels that are unlocked by default
+- Droplet particle color should be gold for gold coins
+- added levels: A Very Dangerous High-Five, The Boys
+
+## 29079818
+
+- Imported levels : Mario, Minesweeper and Target
+- Fixed an issue with localstorage saving of custom levels
+
+
+## 29079805
+
+- combo text on paddle will be grey if we're at the base combo
+- transparency now rounds up
+- import level up to 21 x 21
+- corrected icon of "padding"
+
+## 29079087
+
+- measured and improve the performance (test here https://breakout.lecaro.me/?stresstest)
+- added a few levels
+- autoplay mode (with wake lock and computer play https://breakout.lecaro.me/?autoplay )
+- Added particle and sound effect when coin drops below the "waterline" of the puck
+- slower coins fall once they are under the paddle
+- in game level editor
+- allow loading newer save in outdated app (for rollback)
+- game crashes when reaching level 12 (no level info in runLevels)
+
+## 29074385
+
+- added back some extra languages
+- superhot: fixed particles durations and level duration
+- bricks aattract coins : less powerfull
+- bricks attract balls
+- unbounded nerf : just adds padding around bricks, not combo add
+- don't tell user to get -100 points to unlock level
+- display colored coins when there's hypnosis or rainbow enabled
+
+## 29071903
+
+- new perk : hypnosis
+- new perk : rainbow
+- new perk : bricks attract coins
+- Extra choice: wrong text for french "2 more choices"
+- metamorphosis : when coins are spent, display them hollowed out
+- super hot : starting level rework
+- zen : added bombs to starting level
+
+## 29071527
+
+- super hot : time moves only when paddle moves. Later levels slow down even more the time when you're not moving.
+- transparency : ball becomes transparent towards top of screen, +50% coins.
+- space coins : coins bounce without loosing momentum
+- trickledown : coins spawn at the top of the screen
+- unlocked content : start with perk icon as level
+- allow removing all starting perks, to get full random
+- rename "puck" into paddle
+- use french as base language to keep consistent formal/informal tone
+- fixed memory leak in language detection code
+
+## 29069860
+
+- when rendering level icons, always use transparent background
+- resized some levels to use as flags, added some missing languages as levels
+- added machine translation, so that translators can try the game in their language first : ar,de,es,ko,ru,ur,uz,zh
+- change translation keys to get better sorted files
+- change fortunate ball to work more like coin magnet, carrying the balls around to catch them at next puck bounce
+- add a test to forbid more than 5% grey bricks on black background, remove grey bricks border
+- simplified texts to make translation easier
+- fixed some issues around saved level unlocks
+- change donation text to not suggest an amount
+- limited history to top 100 runs
+
+## 29068563
+
+- review the "next unlocks" in score and game over
+- As soon as upgrade condition is reached, toast
+- As soon as level condition is reached, lock it in and tell the user
+- extra life only saves your last ball, max 7 instead of 3
+- Don't use "RAZ" in French explanations.
+- explain ghost coin's slow down effect
+- when there are only a few coins, make them brighter
+- Perk : [colin] minefield
+- clear scheduled sounds if sounds off
+- show unlocked levels above game stats in gameover screen
+- reduce resolution of lights even more (1/16)
+
+## 29067205
+
+- tooltip isn't readable at bottom of screen
+- added levels as tributes to game players
+- display closest unlock with current perks in score and gameover screens
+- initial perk icon = first level
+- fix starting perk option not working
+- progress bar for unlock in unlocks menu
+- display runs history
+- in the runs history, only save perks that were chosen by the user
+- migration to save past content to localStorage.recovery_data right before starting a new version
+- mention unlock conditions in help
+- show unlock condition in unlocks menu for perks as tooltip
+- fallback for mobile user to see unlock conditions
+- New perk : "limitless" raises the max of all perks by 1
+- Boosted perk : side kick, now you just need to hit bricks from the left side to gain +lvl combo, hitting from the right side does -2xlvl combo
+- add unlock conditions for levels in the form "reach high score X with perk A,B,C but without perk B,C,D"
+- remove loop mode :
+ - remove basecombo
+ - remove mode
+ - clear old runs in other mode
+- ignore scores in creative mode
+- remove the slow mode
+- adjusted the light effects
+- added white border around dark grey bricks
+- remove the opaque coin options, all coins are opaque, but dark grey ones have white border
+- archive each version as an html file and apk
+- publish 29062687 on play store
+- redo video
+- review fastlane text
+
+- tried and cancelled native desktop app build with tauri because :
+ - there's no cross compilation, so no exe build on linux
+ - you need to sign executable differently for each platform
+ - the .deb and .rmp files were 3.8M for a 0.1M app
+ - the appimage was crazy big (100M)
+ - I'd need a mac to make a mac version that probably wouldn't run without doing the app store dance with apple
+
+## 29062687
+
+- tried and cancelled webgl rendering
+ - it's a lot of code
+ - i'm not great at it
+ - it requires a significant rewrite
+ - for most things, no perf difference
+ - the main goal of having more colorful backgrounds can be achieved by running the lights layer at lower res
+- "Miss warning" option is now on by default (ball's particles are red if catching it would be a "miss")
+- "Show +X in gold" option is now on by default (show a +X when combo increases)
+- "High contrast" option added, off by default (applies lights layer again as "soft light" at the end of the render)
+- "Colorful coins" option now applied at render time instead of coin spawn time, to make preview easier
+- when settings are opened on pc, they show up on the side and the overlay is transparent to let you preview the changes
+
+## 29062545
+
+- 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
+- Boosted : Asceticism now decreases combo instead of resetting it
+- Graphics : show respawn particles even in basic mode [obigre]
+- Graphics : adjusted the brightness of the game a bit more
+
+## 29061490
+
+- Graphics : option to add more light (on by default)
+- Graphics : option to make coins more readable (on by default)
+- Graphics : background light effects optimization
+- Graphics : all levels background have been checked (4 buggy ones removed) and will be assigned randomly
+- Fixed : display gained combo was showing +0 sometimes
+
+## 29060272
+
+- Fixed: Strict sample size was counting destroyed bricks, now count hits as explained in the help
+- Fixed: passive_income was resetting your combo if you moved around the end of the last level
+- Fixed: a high score issues was systematically erasing the high score in the web version, i added a migration to load the best score for your top games to recover the high score.
+- QOL: option to display gained combo as onscreen text
+- QOL: publish an apk to itch.io with every build
+- Internal: added a simple game data migration system
+
+## 29059721
+
+- QOL: icons in settings menu
+- QOL: choose starting perks
+- QOL: fixed issue with reloading with [R] key
+- QOL: gameover screen restarts in the same game mode
+- Fixed: Trampoline render sides in red.
+- Fixed: tooltips stuck on mobile
+- Fixed: issues with restarting a game with fullscreen on
+
+## 29058981
+
+- [jaceys] A visual indication of whether a ball has hit a brick this serve (as an option)
+- Top down /reach: now only the lowest level of N bricks resets combo, and all other bricks do +N combo
+- picky eater: don't reset if no brick of ball color
+- main menu : show high score
+- keep high score of past runs
+- tooltip on stats
+- fixed : looping didn't work
+- two abstract levels, stripes and openings
+- added reset button for perks in lab mode
+
+## 29058469
+
+- New game mode : loop / long game
+ - the goal is to build many different build centered on one perk
+ - At the end of level 7, you get to restart at level 1 for 6 levels.
+ - all your perks are banned except one
+ - The perk you keep is leveled up, and can be leveled up a second time during the next loop
+ - the perks you don't keep are "banned", meaning their max level is reduced by as many levels as you had picked
+ - unlocked after unlocking all perks
+- New game mode : lab / creative
+ - the goal is to come up with 3 completely different but powerful play styles
+ - you freely create 3 builds from all the perks level available
+ - you play them against the levels of your choice
+ - try to make as much score as possible in total
+ - unlocked after unlocking all perks
+- New levels :
+ - Pingwin
+ - Sunglasses
+ - Balloon
+- Adjusted levels :
+ - orca is no longer made of bombs, but gray block
+- New perks
+ - addiction : reward faster gameplay
+- Adjusted perks
+ - Hot start : 30 combo per level instead of 15
+ - Telekinesis: limited to level 1
+ - Asceticism now gives +3 combo per lvl
+ - Fortunate ball has a stronger effect
+ - Bigger puck : puck can now cover the whole screen at higher levels, but not more
+ - Corner shot : higher levels let you move further away from the play area
+ - Forgiving : level 2 halves the penalty, level 3 is a third ..
+ - Helium : stronger anti gravity at higher levels
+ - Implosions : works like bigger-explosions at higher levels
+ - Metamorphosis : coins can stain more bricks at higher levels
+ - Re-spawn : now delay based and probabilistic, to scale more easily with higher levels. no need to hit the puck
+ - sacrifice : at level 2+ the combo is doubles/tripled just before clearing the screen of any bricks
+ - shunt : changed the math keep 25% of combo at level 1,50% at level 2,63% at level 3,70% at level 4..
+ - soft reset : same math as shunt
+ - smaller puck : now the puck can get as small as a ball
+ - Unbounded : at level 2+, the top of the level is gone too
+ - concave_puck : ball bounces straighter and straighter, to the point where you can't move it without another perk
+ - shocks lvl 2+ make bigger explosions
+ - trampoline: nerfed a little bit, now all sides and top hit reduce combo
+
+- Quality of life
+ - Updated discord invite link that had expired
+ - Full screen is now a persistent option, when it's on the game will switch to full screen before starting
+ - Added an option to always get colored coins
+ - Made the "combo lost" text last 500ms instead of the pointless 150ms
+ - Added in-game help and credits, which can be translated
+ - Balancing : you earn an extra perk when playing well, and a reroll when playing perfectly
+ - added a prominent "donate" link after 5h of playing, and setting to hide it permanently
+ - disabled auto-release to F-Droid, i'll use the web version as the testing ground first
+ - added a white border around all coins, to make dark ones visible on dark bg
+ - [jaceys] counters for coins lost, misses, and boundary bounces, as well as a timer.
+ - Unlocked list : split perk and levels, added tooltips
+
+## 29049575
+
+- added rerolls
+- Sacrifice : clear screen instead of doubling coins
+
+## 29048147
+
+- Ascetism : render coins with red border if there's a combo
+- Warn about unbounded
+- Red border dashes
+
+# Ideas and features
+
+## Easy perk ideas
+
+- chill : no perks gain, no level limit,+20 base combo
+- when the ball teleport, probability that it's duplicated instead
+- combo resets on teleport
+- combo resets when hitting puck without a teleport
+- teleport ball to puck as soon as it hits something (% chance)
+- allow dropping balls that are about to miss.
+- square coins : coins loose all horizontal momentum when hitting something.
+- ball turns following puck motion
+- "+1 coin for each ball within a small radius of the broken brick" ?
+- two for one : add a 2 for one upgrade combo to the choice lists
+- cash out : double last level's gains
+- snowball : Combo resets every 0.1s . +1 combo for each combo gained Since last reset.
+- Chain reaction : +lvl*lvl combo per brick broken by an explosion, combo resets after explosion is over
+- catching a coin changes the color of the balls
+- coins stained by balls
+- fast pause : pause delay divided by {{lvl}} (helps with teleport)
+- [colin] Capital - les vies non perdues à la fin du niveau rapportent un bonus de points
+- ban 3 random perks from pool, gain 2 upgrades
+- faster coins, double value
+- balls repulse coins
+- n% of coins missed respawn at the ball
+- +1 combo per brick broken after a wall bounce, reset otherwise
+- combo climbs by 1 every 2 second, unless no coin was caught, then it resets
+- [colin] golden corners - catch coins at the sides of the puck to double their value
+- [colin] varied diet - your combo grows by 2 when your ball changes color, but decreses by one when a brick is broken ?
+- [colin] trickle up - inverse of reach more or less
+- +lvl combo per bricks / resets after 5/lvl seconds without explosion ?
+- +lvl combo per bricks / resets after 5/lvl seconds without coin catch ?
+- +lvl combo per bricks / resets after 5/lvl seconds without ball color change ?
+- +lvl combo per bricks / resets after 5/lvl seconds without sides hit ?
+- + lvl x n combo when destroying a brick after bouncing on a side/top n times ?
+- make stats a clairvoyant thing
+- [colin]P ocket money — bricks absorb coins that touch them, which are released on brick destruction (with a bonus?)
+- [colin] turn ball gravity on after a top bar hit, and until bouncing on puck
+- fan : paddle motion creates upward draft that lifts coins and balls
+
+## Medium difficulty perks ideas
+- coins combine when they hit (into one coin with the sum of the values, but need a way to represent that)
+- balls collision split them into 4 smaller balls, lvl times (requires rework)
+- offer next level choice after upgrade pick
+- [colin] mirror puck - a mirrored puck at the top of the screen follows as you move the bottom puck. it helps with keeping combos up and preventing the ball from touching the ceiling. it could appear as a hollow puck so as to not draw too much attention from the main bottom puck.
+- [colin] Combos extrêmes: lvl2 pour tous les combos, qui fait que le combo rapporte double ou triple, mais si sur un niveau la condition n'est pas respectée alors le perk ne donne plus de combo bonus pour ce niveau.
+- [colin] Mytosis - les blocs bombe n'explosent pas mais relâchent une nouvelle balle à la place (clashes with "shocks" and "sapper")
+- [colin] Juggle - au début du niveau, chaque balle est lancée l'une après au lieu de toutes à la fois (needs some work)
+- SUPER HOT (time moves when puck moves)
+- bricks attract ball
+- bricks attract coins
+- wrap left / right
+- correction : pick one past upgrade to remove and replace by something else
+- +1 combo when ball goes downward, reset if upward
+- 2x speed after bouncing on puck
+- the more balls are close to a brick, the more combo is gained when breaking it. If only one ball, loose one point or reset
+- ball avoids brick of wrong color
+- puck slowly follows desired position, but +1 combo
+- knockback : hitting a brick pushes it (requires sturdy bricks)
+
+## Hard perk ideas
+- accelerometer controls coins and balls
+- [colin] side pucks - same as above but with two side pucks : hard to know where to put them
+- [colin] Perk: second puck in the middle of the screen
+- [colin] Sponge Ball : the ball stores coins it collides with, and releases them when bouncing on any border (left, right, top).
+
+
+## ideas to sort
+- wind : move coins based on puck movement not position
+- double coin value when they hit the sides
+- [colin]Brambles — coins that touch the walls and ceiling get stuck and are thrown back when the last brick is destroyed
+- [colin]Ball of Greed — the ball can collect coins (might be worth dividing into levels: lvl 1, can collect coins only after two bounces on bricks or walls. lvl 2, can collect after 1 bounce. lvl 3, can collect coins anytime)(or change the ball collection radius as the level grows)
+- [colin]Phantom ball — the ball phases through 2 bricks then becomes solid (lvl2: through 6 bricks, lvl3; through all bricks until it touches a wall)
+- [colin]Cryptomoney — coins that should be generated by bricks are instantly collected, but count for half their value
+- [colin]Relative time — ball speed depends on its position: if it's high up on thi screen it's fast, if it's lower it's slower
+
+- ball attracted by bricks of the color of the ball
+- level flips horizontally every time a ball bounces on puck
+- [colin] close quarters - balle attirée par tous les blocs/par un bloc aléatoire, actif à portée de bloc (+1bloc au lvlup)/proportionnel à une force (+puissance au lvlup)…
+- [colin] plusieurs perks qui déclenchent des effets quand une balle est perdue. par ex: +3 combo à chaque balle perdue, 5 blocs transformés en bombe, balle et coins ralentis, blocs régénérés…
+- [colin] faster style - augmente le combo en fonction de la vitesse de la balle
+- [colin] perk: roulette - gagne instantanément 2 perks aléatoires
+- other block types : bumper (speed up ball) [colin], metal (can't break) [nicolas]
+- flip perk
+
+## extra levels
+
+- Good games :
+ - FTL
+ - Nova drift
+ - Noita
+ - Enter the gungeon
+ - Zero Sivert
+ - Factorio
+ - Swarm
+ - Nuclear throne
+ - Brigador
+
+
+- letters and an associated word or name
+- famous characters and movies
+- famous places : eiffel tower, taj mahal, etc..
+- fruits
+- animals
+- countries flags and shapes
+
+
+## UX / gameplay
+
+- make menu and score button more "button like" when you just installed the game.
+- avoid showing a +1 and -1 at the same time when a combo increase is reset
+- explain to iOS users how to add the app to home screen to get fullscreen
+- delayed start on mobile to let users place the puck where they want
+- experiment with showing the combo somewhere else, maybe top center, maybe instead of score.
+- display a multiplicator if it's not 100%, have some perks add to it
+
+
+## Game engine features ideas
+- add a clickable button to allow sound to play in chrome android
+- save state in localstorage for easy resume of a game in progress
+- handle back bouton in menu
+- Offline mode web for iphone
+- controller support on web/mobile
+- leaderboard for not using each perk, like "best runs without hot start"
+
+
+## Maybe one day
+- https://weblate.org/fr/ quite annoying to have merge conflicts while pushing, i'll enable it later.
+- auto-detect device performance at first startup and adjust settings accordingly (hard to do in any sort of useful way)
+- [jaceys] Move the restart button out of the menu, so that it is more easily accessible (will allow user to choose starting perk instead)
+- colored coins only (coins should be of the color of the ball to count, otherwise what ? i'd rather avoid negative points)
+- coins avoid ball of different color (pointless)
+- [colin] wormhole - the puck sometimes don't bounce the ball back up but teleports it to the top of the screen as if it fell through from bottom to top. higher levels reduce the times it takes to reload that effect (not sure how that to word that in 1 setence)
+- [colin] Mental charge - the puck is divided into two smaller pucks, then 3 smaller ones at lvl 2 : what's the point ?
+- [colin] sturdy ball - does more damage to bricks, to conter sturdy bricks :that's pierce now
+- [colin] plot - plot the ball's trajectory as you position your puck : too hard when you add other perks
+- [colin] piggy bank - bricks absorb coins that fall onto it, and release them back as they are broken, with added value : equivalent to Asceticism
+- [colin] ball coins - coins share the same physics as coins and bounce on walls and bricks : really hard to balance with speeds and all
+- non brick-shaped bricks, tilted bricks,moving blocks : very difficult because of engine optimisations
+- 3 random perks immediately, or maybe "all level get twice as many upgrades, but they are applied randomly, and you aren't told which ones you have."
+- coins repulse coins, could get really laggy ?
+- russian roulette: 5/6 chances to get a free upgrade, 1/6 chance of game over. Not really fun
+- [colin] bigger ball - self-explanatory, or is it ? what's the point ? physics would break now if ball bigger than bricks
+- [colin] smaller ball - doable, but why
+- [colin] earthquake - when the puck hits any side of the screen with velocity, the screen shakes and a brick explodes/falls from the level. alternatively, any brick you catch with the puck gives you the coins at the current combo rate. each level lowers the amount of hits before a brick falls. Problem : no limit on how often you can slam the puck around
+- missile goes when you catch coin
+- missile goes when you break a brick
+- [colin] Batteries - lvl1: recharge les pouvoirs du puck quand la balle touche le haut de l'écran (1 fois par lancer, se recharge en touchant le puck). lvl2: également après voir détruit 6 blocs. lvl3: également quand elle touche les bords de l'écran : i'll probably just let the second puck replace this
+ - store much more details about run (level by level) as numbers only (instead of json that gets big false)
+- [colin] hitman - hit the marked brick for +5 combo. each level increases the combo you get for it.
+- [colin] sweet spot - place your puck directly below a moving spot at the top of the level to increase your combo
+- [colin] reward the player with more choices/perks for breaking a brick while having reached an increasing combo thresholds. 5 combo, then 10, then 20, then 40 etc… once a threshold is reached you aren't rewarded for that threshold again until you start a rew run
+- mobile option: relative movement of the touch would be amplified and added to the puck
+- mobile option: don't pause on mobile when lifting finger
+- translate fastlane presentation texts to french
+- convert captures to mp4 unsing ffmpeg wasm because reddit refuses webm files
+- disable zooming (for ios double tap)
+- Waterline under the puck, coins slow down a lot, reflections
+- webgl rendering: background gradient light map, shinier coins, quite hard
+- on mobile, add an element that feels like it can be "grabbed" and make it shine while writing "Push here to play"
+- hard mode : bricks take many hits, perks more rare, missing clears level score, missing coins deducts score..
+- architect mode :
+ - play 7 levels, each with a different build.
+ - Perk levels can only be used once, so if you take one for level 1, you won't have it to level 2-7.
+ - Your final score is your worst score times your best score
+ - You'll see the levels in advance
+- stats by lack of perk, like "best score without using hot start".
+- split screen multiplayer
+- Add color schemes into the game (ex : Catppuccin, Dracula, Terminal, etc)
+- final bosses (large vertical level that scrolls down faster and faster)
+- add loop run where user levels can't be used in further loops (boring)
+- add lab mode where you need to make three builds (complex, lots of clicking, not fun)
+
+# Credits
+
+I pulled the background patterns from https://pattern.monster/
+
+I wanted an APK to start in fullscreen and be able to list it on fdroid and the play store. I started with an empty view and went to work trimming it down, with the help of that tutorial : https://github.com/fractalwrench/ApkGolf/blob/master/blog/BLOG_POST.md
+
+Colin (obigre) brought a lot of fantastic ideas to the game, here's his website (in French) : https://colin-crapahute.bearblog.dev/
+
+# How to install
+
+Breakout 71 can be installed and work offline in many ways:
+
+- Download an index.html file from [itch.io](https://renanlecaro.itch.io/breakout71) to play offline on your computer (latest version always)
+- Download the latest apk from [itch.io](https://renanlecaro.itch.io/breakout71) to play offline on your android phone (latest version always)
+- Add [the app](https://breakout.lecaro.me/) to your home screen on android, and it should play even when offline thanks to the service workers (latest version always)
+- Install the latest version from the play store : https://play.google.com/store/apps/details?id=me.lecaro.breakout (updated from time to time)
+- Install the latest version from Fdroid : https://f-droid.org/packages/me.lecaro.breakout/ (updated very rarely because of the updates publication lag)
+- Download the index.html file or apk from my archive server : https://archive.lecaro.me/public-files/b71/ (any version including latests)
+
+# System requirements
+
+The game should perform well even on low-end devices. It's very lean and does not take much storage space (Roughly 0.1MB). The web version is supposed to work on iOS safari, Firefox ESR and chrome, on desktop and mobile.
+If the app stutters, turn on "fast mode" in the settings to render a simplified view that should be faster. You can adjust many aspects of the game there, go have a look !
+
\ No newline at end of file
diff --git a/Roadmap and todo.md b/Roadmap and todo.md
deleted file mode 100644
index be36346..0000000
--- a/Roadmap and todo.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# bugs
-- having Hot Start and Single puck hit streak perks in a run resets combo from start [29014379]
-
-# Game engine features
-
-- the onboarding feels weird, missing a tutorial
-- Players can't choose the initial perk
-- apk version soft locks at start.
-- shinier coins by applying glow to them ?
-- ask for permanent storage
-- It's a bit confusing at first to grasp that one upgrade is applied randomly at the start of the game
-- on mobile, add an element that feels like it can be "grabbed" and make it shine while writing "Push here to play"
-- add a clickable button to allow sound to play in chrome android
-- offline mode with service worker
-- add pwe manifest
-- see how to do fullscreen on ios, or at least explain to do aA/hide toolbars
-- experiment with showing the combo somewhere else, maybe top center, maybe instead of score.
-- more help somewhere accessible
-- limit GC by reusing coins and particles
-- convert captures to mp4 unsing ffmpeg wasm because reddit refuses webm files
-- few puck bounces = more choices / upgrades
-- disable zooming (for ios double tap)
-- particles when bouncing on sides / top
-- show total score on end screen (score added to total)
-- show stats on end screen compared to other runs
-- handle back bouton in menu
-- mouvement relatif du puck
-- balls should collide with each other
-- when game resumes near bottom, be unvulnerable for .5s ? , once per level
-- apply global curve / brightness to canvas when things blow, or just always to make neon effect better
-- manifest for PWA (android and apple)
-- lights shadows
-- Offline mode web for iphone
-- controller support on web/mobile
-- webgl rendering
-- enable export of gameplay capture in webview
-- endgame histograms could work as filters, when you hover a bar, all other histograms would show the stats of those runs only, without changing reference of categories
-- sound when ball changes color
-- option : don't pause on mobile when lifting finger
-- option : accelerated relative movements on mobile
-- maybe just have 10 background, and always use the same one for the nth level of each run ?
-- would be nice to have a leaderboard for not using each perk too. Like "best runs without hot start"
-- restart run on r
-- when missing, redo particle trail, but give speed to particle that matches ball direction
-
-# Perks ideas
-
-- second puck (symmeric to the first one)
-- keep combo between level, loose half your run score when missing any bricks
-- offer next level choice after upgrade pick
-- ban 3 random perks from pool, doesn't tell you which ones, gain 2 upgrades
-- 3 random perks immediately, or maybe "all level get twice as many upgrades, but they are applied randomly, and you aren't told which ones you have."
-- wrap left / right
-- pause and cheat again
-- wrap top / bottom : coins fall back from top of screen, ball flies to the top and comes back from the screen bottom ?
-- faster coins, double value
-- +1 upgrade per level but -2 choices
-- n% of the broken bricks respawn when the ball touches the puck
-- bricks break 50% of the time but drop 50% more coins
-- wind (puck positions adds force to coins and balls)
-- balls repulse coins
-- n% of coins missed respawn at the top
-- lightning : missing triggers and explosive lighting strike around ball path
-- coins repulse coins (could get really laggy)
-- balls repulse coins
-- balls attract coins
-- twice as many coins after a wall bounce, twice as little otherwise ?
-- fusion reactor (gather coins in one spot to triple their value)
-- missing makes you loose all score of level, but otherwise multiplier goes up after each breaking
-- soft reset, cut combo in half instead of zero
-- missile goes when you catch coin
-- missile goes when you break a brick
-- puck bounce +1 combo, hit nothing resets
-- multiple hits on the same brick (show remaining resistance as number)
-- bricks attract ball
-- replay last level (remove score, restores lives if any, and rebuild )
-- accelerometer controls coins and balls
-- bricks attract coins
-- breaking bricks stains neighbours
-- extra kick after bouncing on puck
-- transparent coins
-- coins of different colors repulse
-- bricks follow game of life pattern with one update every second
-- 2x coins when ball goes downward / upward, half that amount otherwise ?
-- new ball spawns when reaching combo X
-- missing with combo triggers explosive lightning strike
-- correction : pick one past upgrade to remove and replace by something else
-- puck bounce predictions rendered with particles or lines (requires big refactor)
-
-
-# extra levels
-
-- famous games
-- letters
-- fruits
-- animals
-- countries flags and shapes, with name as background
-
-# big features
-
-- use ts and a bundler to get fewer bugs and compatibility with old browsers / webviews
-- final bosses (large vertical level that scrolls down faster and faster)
-- split screen multiplayer
-- translation
-- Add color schemes into the game (ex : Catppuccin, Dracula, Terminal, etc)
-- add a toggle to switch between the “coin” design and colored bubbles
-- sandbox mode
-- hard mode : bricks take many hits, perks more rare, missing clears level score, missing coins deducts score..
-- stats by lack of perk, like "best score without using hot start".
-
-Instead of automatically unlocking things at the end of each run, add the coins to the user's account,
-and let them spend those coins on upgrades. The upgrades would then be explained. They could have a condition like
-"reach high score of 1000" or 'reach high score of 99999 without using "hot start"'.
-This requires recording a bit more info about each run.
-I could unlock the "pro stand" at $999 that just holds the play area higher.
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 7e62c68..082a474 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -1,9 +1,27 @@
+import java.util.Properties
+import java.io.FileInputStream
+
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
}
+
+val keystorePropertiesFile = rootProject.file("keystore.properties")
+val keystoreProperties = Properties()
+keystoreProperties.load(FileInputStream(keystorePropertiesFile))
+
+
android {
+ signingConfigs {
+ create("release") {
+ keyAlias = keystoreProperties["keyAlias"] as String
+ keyPassword = keystoreProperties["keyPassword"] as String
+ storeFile = file(keystoreProperties["storeFile"] as String)
+ storePassword = keystoreProperties["storePassword"] as String
+ }
+ }
+
namespace = "me.lecaro.breakout"
compileSdk = 34
@@ -11,8 +29,8 @@ android {
applicationId = "me.lecaro.breakout"
minSdk = 21
targetSdk = 34
- versionCode = 29020161
- versionName = "29020161"
+ versionCode = 29106448
+ versionName = "29106448"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
@@ -27,7 +45,7 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
- signingConfig = signingConfigs.getByName("debug")
+ signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {
@@ -49,22 +67,6 @@ android {
}
}
}
-
-//dependencies {
-//
-// implementation(libs.androidx.core.ktx)
-// implementation(libs.androidx.lifecycle.runtime.ktx)
-// implementation(libs.androidx.activity.compose)
-// implementation(platform(libs.androidx.compose.bom))
-// implementation(libs.androidx.ui)
-// implementation(libs.androidx.ui.graphics)
-// implementation(libs.androidx.ui.tooling.preview)
-// implementation(libs.androidx.material3)
-// testImplementation(libs.junit)
-// androidTestImplementation(libs.androidx.junit)
-// androidTestImplementation(libs.androidx.espresso.core)
-// androidTestImplementation(platform(libs.androidx.compose.bom))
-// androidTestImplementation(libs.androidx.ui.test.junit4)
-// debugImplementation(libs.androidx.ui.tooling)
-// debugImplementation(libs.androidx.ui.test.manifest)
-//}
\ No newline at end of file
+dependencies {
+ implementation(libs.androidx.core)
+}
diff --git a/app/release/app-release.aab b/app/release/app-release.aab
deleted file mode 100644
index 49c7dc1..0000000
Binary files a/app/release/app-release.aab and /dev/null differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2700098..7e787ff 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,8 +1,8 @@
- Breakout 71 is published - by Renan LE CARO, a French citizen and programmer. You can contact me at - this adress : breakout71@lecaro.me -
-- If you access breakout.lecaro.me though a web browser, your IP address - will be logged on my server to prevent abuses. - My server is hosted by Hetzner - Online GmbH in germany. -
-- If you install the app through google play or f-droid, no information will - be collected at all by me. -
- - diff --git a/app/src/main/java/me/lecaro/breakout/MainActivity.kt b/app/src/main/java/me/lecaro/breakout/MainActivity.kt index b66b748..1d9832e 100644 --- a/app/src/main/java/me/lecaro/breakout/MainActivity.kt +++ b/app/src/main/java/me/lecaro/breakout/MainActivity.kt @@ -1,35 +1,183 @@ package me.lecaro.breakout + +import android.content.ContentValues +import android.content.Intent +import android.net.Uri +import android.os.Build import android.os.Bundle +import android.os.Environment +import android.provider.MediaStore import android.util.Log import android.view.Window import android.view.WindowManager import android.webkit.ConsoleMessage +import android.webkit.DownloadListener +import android.webkit.ValueCallback import android.webkit.WebChromeClient import android.webkit.WebView +import android.widget.Toast +import androidx.core.content.FileProvider +import java.io.File +import java.net.URLDecoder +import java.nio.charset.StandardCharsets +import java.text.SimpleDateFormat +import java.util.Date + +const val CHOOSE_FILE_REQUEST_CODE = 548459 class MainActivity : android.app.Activity() { + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + + super.onActivityResult(requestCode, resultCode, data) + when (requestCode) { + CHOOSE_FILE_REQUEST_CODE -> { + if (resultCode == RESULT_OK) { + filePathCallback?.onReceiveValue( + WebChromeClient.FileChooserParams.parseResult( + resultCode, data + ) + ) + filePathCallback = null + } + } + } + } + + var filePathCallback: ValueCallback${text}+ ` + ] + }); + // return + } + if (action === "rename") { + const name = prompt((0, _i18N.t)("editor.editing.rename_prompt"), level.name); + if (name) level.name = name; + } + if (action === "credit") { + const credit = prompt((0, _i18N.t)("editor.editing.credit_prompt"), level.credit || ""); + if (credit !== "null") level.credit = credit || ""; + } + if (action === "delete") { + rawList = rawList.filter((l, li)=>li !== nth); + (0, _settings.setSettingValue)("custom_levels", rawList); + openLevelEditorLevelsList(); + return; + } + } + level.color = (0, _pureFunctions.automaticBackgroundColor)(bricks); + (0, _settings.setSettingValue)("custom_levels", rawList); + editRawLevelList(nth, color); +} + +},{"./loadGameData":"l1B4x","./i18n/i18n":"eNPRm","./settings":"5blfu","./asyncAlert":"rSqLY","./levelIcon":"6rQoT","./data/palette.json":"ktRBU","./game":"edeGs","./game_utils":"cEeac","./pure_functions":"6pQh7","./toast":"nAuvo","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"63kYJ":[function(require,module,exports,__globalThis) { +var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); +parcelHelpers.defineInteropFlag(exports); +parcelHelpers.export(exports, "creativeMode", ()=>creativeMode); +parcelHelpers.export(exports, "openCreativeModePerksPicker", ()=>openCreativeModePerksPicker); +var _loadGameData = require("./loadGameData"); +var _i18N = require("./i18n/i18n"); +var _settings = require("./settings"); +var _game = require("./game"); +var _asyncAlert = require("./asyncAlert"); +var _gameUtils = require("./game_utils"); +var _gameOver = require("./gameOver"); +var _upgrades = require("./upgrades"); +var _levelIcon = require("./levelIcon"); +var _getLevelUnlockCondition = require("./get_level_unlock_condition"); +function creativeMode(gameState) { + return { + icon: (0, _loadGameData.icons)["icon:creative"], + text: (0, _i18N.t)("lab.menu_entry"), + help: (0, _settings.getTotalScore)() < (0, _game.creativeModeThreshold) && (0, _i18N.t)("lab.unlocks_at", { + score: (0, _game.creativeModeThreshold) + }) || (0, _i18N.t)("lab.help"), + disabled: (0, _settings.getTotalScore)() < (0, _game.creativeModeThreshold), + async value () { + openCreativeModePerksPicker(); + } + }; +} +async function openCreativeModePerksPicker() { + let creativeModePerks = (0, _settings.getSettingValue)("creativeModePerks", {}); + const customLevels = (0, _settings.getSettingValue)("custom_levels", []).map((0, _loadGameData.transformRawLevel)); + while(true){ + const levelOptions = [ + ...(0, _loadGameData.allLevels).map((l, li)=>{ + const problem = (0, _getLevelUnlockCondition.reasonLevelIsLocked)(li, l.name, (0, _gameOver.getHistory)(), true)?.text || ""; + return { + icon: (0, _loadGameData.icons)[l.name], + text: l.name, + value: l, + disabled: !!problem, + tooltip: problem || (0, _gameUtils.describeLevel)(l), + className: "" + }; + }), + ...customLevels.map((l)=>({ + icon: (0, _levelIcon.levelIconHTML)(l.bricks, l.size), + text: l.name, + value: l, + disabled: !l.bricks.filter((b)=>b !== "_").length, + tooltip: (0, _gameUtils.describeLevel)(l), + className: "" + })) + ]; + const selectedLeveOption = levelOptions.find((l)=>l.text === (0, _settings.getSettingValue)("creativeModeLevel", "")) || levelOptions[0]; + selectedLeveOption.className = "highlight"; + const choice = await (0, _asyncAlert.asyncAlert)({ + title: (0, _i18N.t)("lab.menu_entry"), + className: "actionsAsGrid", + content: [ + { + icon: (0, _loadGameData.icons)["icon:reset"], + value: "reset", + text: (0, _i18N.t)("lab.reset"), + disabled: !(0, _gameUtils.sumOfValues)(creativeModePerks) + }, + { + icon: (0, _loadGameData.icons)["icon:new_run"], + value: "play", + text: (0, _i18N.t)("lab.play"), + disabled: !(0, _gameUtils.sumOfValues)(creativeModePerks) + }, + (0, _i18N.t)("lab.instructions"), + ...(0, _loadGameData.upgrades).filter((u)=>!(0, _upgrades.noCreative).includes(u.id)).map((u)=>({ + icon: (0, _loadGameData.icons)["icon:" + u.id], + text: u.name, + help: (0, _gameUtils.levelAndMaxBadge)(creativeModePerks[u.id] || 0, u.max + (creativeModePerks.limitless || 0)), + value: u, + className: " upgrade " + (creativeModePerks[u.id] ? " highlight" : " not-highlighed") + })), + (0, _i18N.t)("lab.select_level"), + ...levelOptions + ] + }); + if (!choice) return; + if (choice === "reset") { + (0, _loadGameData.upgrades).forEach((u)=>{ + creativeModePerks[u.id] = 0; + }); + (0, _settings.setSettingValue)("creativeModePerks", creativeModePerks); + (0, _settings.setSettingValue)("creativeModeLevel", ""); + } else if (choice === "play" || "bricks" in choice && choice.name == (0, _settings.getSettingValue)("creativeModeLevel", "")) { + if (await (0, _game.confirmRestart)((0, _game.gameState))) { + (0, _game.restart)({ + perks: creativeModePerks, + level: selectedLeveOption.value, + isCreativeRun: true + }); + return; + } + } else if ("bricks" in choice) (0, _settings.setSettingValue)("creativeModeLevel", choice.name); + else if (choice) { + creativeModePerks[choice.id] = ((creativeModePerks[choice.id] || 0) + 1) % (choice.max + 1 + (creativeModePerks.limitless || 0)); + (0, _settings.setSettingValue)("creativeModePerks", creativeModePerks); + } + } +} + +},{"./loadGameData":"l1B4x","./i18n/i18n":"eNPRm","./settings":"5blfu","./game":"edeGs","./asyncAlert":"rSqLY","./game_utils":"cEeac","./gameOver":"caCAf","./upgrades":"1u3Dx","./levelIcon":"6rQoT","./get_level_unlock_condition":"a0fq0","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"a0fq0":[function(require,module,exports,__globalThis) { +var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); +parcelHelpers.defineInteropFlag(exports); +parcelHelpers.export(exports, "getLevelUnlockCondition", ()=>getLevelUnlockCondition); +parcelHelpers.export(exports, "getBestScoreMatching", ()=>getBestScoreMatching); +parcelHelpers.export(exports, "isLevelLocked", ()=>isLevelLocked); +parcelHelpers.export(exports, "reasonLevelIsLocked", ()=>reasonLevelIsLocked); +parcelHelpers.export(exports, "upgradeName", ()=>upgradeName); +var _loadGameData = require("./loadGameData"); +var _getLevelBackground = require("./getLevelBackground"); +var _i18N = require("./i18n/i18n"); +var _unlockConditionsJson = require("./data/unlockConditions.json"); +var _unlockConditionsJsonDefault = parcelHelpers.interopDefault(_unlockConditionsJson); +const hardCodedCondition = (0, _unlockConditionsJsonDefault.default); +let excluded; +function isExcluded(id) { + if (!excluded) { + excluded = new Set([ + "extra_levels", + "one_more_choice", + "shunt", + "slow_down" + ]); + // Avoid excluding a perk that's needed for the required one + (0, _loadGameData.upgrades).forEach((u)=>{ + if (u.requires) excluded.add(u.requires); + }); + } + return excluded.has(id); +} +function getLevelUnlockCondition(levelIndex, levelName) { + if (hardCodedCondition[levelName]) return hardCodedCondition[levelName]; + const result = { + required: [], + forbidden: [], + minScore: Math.max(-1000 + 100 * levelIndex, 0) + }; + if (levelIndex > 20) { + const possibletargets = [ + ...(0, _loadGameData.upgrades) + ].slice(0, Math.floor(levelIndex / 2)).filter((u)=>!isExcluded(u.id)).sort((a, b)=>(0, _getLevelBackground.hashCode)(levelIndex + a.id) - (0, _getLevelBackground.hashCode)(levelIndex + b.id)).map((u)=>u.id); + const length = Math.min(3, Math.ceil(levelIndex / 30)); + result.required = possibletargets.slice(0, length); + result.forbidden = possibletargets.slice(length, length + length); + } + return result; +} +function getBestScoreMatching(history, required = [], forbidden = []) { + return Math.max(0, ...history.filter((r)=>!required.find((id)=>!r?.perks?.[id]) && !forbidden.find((id)=>r?.perks?.[id])).map((r)=>r.score)); +} +function isLevelLocked(levelIndex, levelName, history) { + const { required, forbidden, minScore } = getLevelUnlockCondition(levelIndex, levelName); + return getBestScoreMatching(history, required, forbidden) < minScore; +} +function reasonLevelIsLocked(levelIndex, levelName, history, mentionBestScore) { + const { required, forbidden, minScore } = getLevelUnlockCondition(levelIndex, levelName); + const reached = getBestScoreMatching(history, required, forbidden); + let reachedText = reached && mentionBestScore ? (0, _i18N.t)("unlocks.reached", { + reached + }) : ""; + if (reached >= minScore) return null; + else if (!required.length && !forbidden.length) return { + reached, + minScore, + text: (0, _i18N.t)("unlocks.minScore", { + minScore + }) + reachedText + }; + else return { + reached, + minScore, + text: (0, _i18N.t)("unlocks.minScoreWithPerks", { + minScore, + required: required.map((u)=>upgradeName(u)).join(", "), + forbidden: forbidden.map((u)=>upgradeName(u)).join(", ") + }) + reachedText + }; +} +function upgradeName(id) { + return (0, _loadGameData.upgrades).find((u)=>u.id == id).name; +} + +},{"./loadGameData":"l1B4x","./getLevelBackground":"7OIPf","./i18n/i18n":"eNPRm","./data/unlockConditions.json":"glZU2","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"glZU2":[function(require,module,exports,__globalThis) { +module.exports = JSON.parse('{"71 mini":{"minScore":0,"required":[],"forbidden":[]},"Butterfly":{"minScore":0,"required":[],"forbidden":[]},"Castle":{"minScore":0,"required":[],"forbidden":[]},"Creeper":{"minScore":0,"required":[],"forbidden":[]},"Stairs":{"minScore":0,"required":[],"forbidden":[]},"Dots":{"minScore":0,"required":[],"forbidden":[]},"Lines":{"minScore":0,"required":[],"forbidden":[]},"Heart":{"minScore":0,"required":[],"forbidden":[]},"Swiss":{"minScore":0,"required":[],"forbidden":[]},"Germany":{"minScore":0,"required":[],"forbidden":[]},"France":{"minScore":100,"required":[],"forbidden":[]},"Smiley":{"minScore":200,"required":[],"forbidden":[]},"Labyrinthe":{"minScore":300,"required":[],"forbidden":[]},"Temple":{"minScore":400,"required":[],"forbidden":[]},"Pacman":{"minScore":500,"required":[],"forbidden":[]},"Ship":{"minScore":600,"required":[],"forbidden":[]},"We come in peace":{"minScore":700,"required":[],"forbidden":[]},"Space mushroom":{"minScore":800,"required":[],"forbidden":[]},"Wololo":{"minScore":900,"required":[],"forbidden":[]},"Small heart":{"minScore":1000,"required":[],"forbidden":[]},"Eye":{"minScore":1100,"required":["streak_shots"],"forbidden":["base_combo"]},"Enderman":{"minScore":1200,"required":["streak_shots"],"forbidden":["viscosity"]},"Mushroom":{"minScore":1300,"required":["streak_shots"],"forbidden":["base_combo"]},"Tulip":{"minScore":1400,"required":["viscosity"],"forbidden":["left_is_lava"]},"Chain":{"minScore":1500,"required":["left_is_lava"],"forbidden":["right_is_lava"]},"Marion":{"minScore":1600,"required":["viscosity"],"forbidden":["left_is_lava"]},"Renan":{"minScore":1700,"required":["viscosity"],"forbidden":["skip_last"]},"Violet Pairs":{"minScore":1800,"required":["skip_last"],"forbidden":["base_combo"]},"Red Cups":{"minScore":1900,"required":["skip_last"],"forbidden":["viscosity"]},"Cactus":{"minScore":2000,"required":["right_is_lava"],"forbidden":["skip_last"]},"Sunny Face":{"minScore":2100,"required":["streak_shots","base_combo"],"forbidden":["smaller_puck","skip_last"]},"Mountain":{"minScore":2200,"required":["smaller_puck","streak_shots"],"forbidden":["left_is_lava","skip_last"]},"Dollar":{"minScore":2300,"required":["pierce","smaller_puck"],"forbidden":["left_is_lava","base_combo"]},"Waves":{"minScore":2400,"required":["left_is_lava","smaller_puck"],"forbidden":["picky_eater","pierce"]},"Box":{"minScore":2500,"required":["left_is_lava","picky_eater"],"forbidden":["smaller_puck","base_combo"]},"Rose":{"minScore":2600,"required":["compound_interest","picky_eater"],"forbidden":["left_is_lava","base_combo"]},"Time":{"minScore":2700,"required":["picky_eater","right_is_lava"],"forbidden":["pierce","left_is_lava"]},"Watermelon":{"minScore":2800,"required":["hot_start","base_combo"],"forbidden":["pierce","right_is_lava"]},"Worms":{"minScore":2900,"required":["picky_eater","hot_start"],"forbidden":["right_is_lava","pierce"]},"Ocean Sunrise":{"minScore":3000,"required":["smaller_puck","hot_start"],"forbidden":["streak_shots","telekinesis"]},"Crosses":{"minScore":3100,"required":["pierce","sapper"],"forbidden":["smaller_puck","compound_interest"]},"Negative space":{"minScore":3200,"required":["left_is_lava","smaller_puck"],"forbidden":["right_is_lava","hot_start"]},"UK":{"minScore":3300,"required":["right_is_lava","left_is_lava"],"forbidden":["base_combo","smaller_puck"]},"Greece":{"minScore":3400,"required":["left_is_lava","right_is_lava"],"forbidden":["telekinesis","hot_start"]},"Russia":{"minScore":3500,"required":["compound_interest","bigger_explosions"],"forbidden":["sapper","pierce"]},"Ukraine":{"minScore":3600,"required":["pierce","sapper"],"forbidden":["base_combo","bigger_explosions"]},"Poland":{"minScore":3700,"required":["viscosity","picky_eater"],"forbidden":["skip_last","pierce"]},"Yellow 71":{"minScore":3800,"required":["base_combo","viscosity"],"forbidden":["picky_eater","skip_last"]},"71 on white":{"minScore":3900,"required":["viscosity","picky_eater"],"forbidden":["compound_interest","skip_last"]},"Blue 71":{"minScore":4000,"required":["compound_interest","pierce_color"],"forbidden":["left_is_lava","viscosity"]},"Seventy one":{"minScore":4100,"required":["viscosity","base_combo"],"forbidden":["left_is_lava","pierce_color"]},"B71":{"minScore":4200,"required":["skip_last","viscosity"],"forbidden":["telekinesis","left_is_lava"]},"Pig":{"minScore":4300,"required":["skip_last","viscosity"],"forbidden":["ball_repulse_ball","telekinesis"]},"Big Pig":{"minScore":4400,"required":["pierce","sapper"],"forbidden":["skip_last","compound_interest"]},"Donkey Kong":{"minScore":4500,"required":["ball_attract_ball","right_is_lava"],"forbidden":["bigger_explosions","skip_last"]},"Banana":{"minScore":4600,"required":["right_is_lava","soft_reset"],"forbidden":["base_combo","skip_last"]},"Fox":{"minScore":4700,"required":["ball_repulse_ball","puck_repulse_ball"],"forbidden":["right_is_lava","skip_last"]},"Wiki":{"minScore":4800,"required":["base_combo","sapper"],"forbidden":["compound_interest","pierce"]},"Baby Dog":{"minScore":4900,"required":["bigger_explosions","pierce"],"forbidden":["sapper","compound_interest"]},"dog 21":{"minScore":5000,"required":["ball_attract_ball","respawn"],"forbidden":["telekinesis","right_is_lava"]},"A":{"minScore":5100,"required":["telekinesis","base_combo","sturdy_bricks"],"forbidden":["hot_start","top_is_lava","bigger_puck"]},"B":{"minScore":5200,"required":["pierce","hot_start","telekinesis"],"forbidden":["sapper","ball_repulse_ball","puck_repulse_ball"]},"C":{"minScore":5300,"required":["hot_start","telekinesis","compound_interest"],"forbidden":["top_is_lava","bigger_puck","bigger_explosions"]},"D":{"minScore":5400,"required":["hot_start","bigger_explosions","ball_attract_ball"],"forbidden":["telekinesis","soft_reset","compound_interest"]},"e":{"minScore":5500,"required":["respawn","hot_start","telekinesis"],"forbidden":["ball_attract_ball","top_is_lava","bigger_puck"]},"Elephant":{"minScore":5600,"required":["ball_repulse_ball","puck_repulse_ball","soft_reset"],"forbidden":["base_combo","sapper","telekinesis"]},"Orca":{"minScore":5700,"required":["pierce","sapper","respawn"],"forbidden":["concave_puck","telekinesis","compound_interest"]},"Shark":{"minScore":5800,"required":["bigger_explosions","compound_interest","base_combo"],"forbidden":["right_is_lava","concave_puck","ball_attract_ball"]},"Bird":{"minScore":5900,"required":["right_is_lava","concave_puck","sturdy_bricks"],"forbidden":["ball_attract_ball","streak_shots","soft_reset"]},"Tux":{"minScore":6000,"required":["pierce","coin_magnet","bigger_puck"],"forbidden":["sapper","top_is_lava","helium"]},"Armenia":{"minScore":6100,"required":["top_is_lava","respawn","bigger_puck"],"forbidden":["base_combo","coin_magnet","ball_repulse_ball"]},"Austria":{"minScore":6200,"required":["top_is_lava","telekinesis","bigger_puck"],"forbidden":["coin_magnet","viscosity","unbounded"]},"Benin":{"minScore":6300,"required":["telekinesis","right_is_lava","bigger_explosions"],"forbidden":["viscosity","top_is_lava","unbounded"]},"Botswana":{"minScore":6400,"required":["viscosity","telekinesis","unbounded"],"forbidden":["sturdy_bricks","soft_reset","right_is_lava"]},"Bulgaria":{"minScore":6500,"required":["helium","puck_repulse_ball","unbounded"],"forbidden":["ball_repulse_ball","viscosity","pierce"]},"Canada":{"minScore":6600,"required":["skip_last","respawn","base_combo"],"forbidden":["asceticism","unbounded","telekinesis"]},"Chad":{"minScore":6700,"required":["compound_interest","bigger_explosions","skip_last"],"forbidden":["concave_puck","streak_shots","telekinesis"]},"China":{"minScore":6800,"required":["nbricks","concave_puck","streak_shots"],"forbidden":["ball_attract_ball","skip_last","base_combo"]},"Colombia":{"minScore":6900,"required":["streak_shots","smaller_puck","concave_puck"],"forbidden":["puck_repulse_ball","ball_repulse_ball","sapper"]},"Republic of the Congo":{"minScore":7000,"required":["ball_repulse_ball","puck_repulse_ball","coin_magnet"],"forbidden":["bigger_puck","top_is_lava","skip_last"]},"C\xf4te d\'Ivoire":{"minScore":7100,"required":["coin_magnet","bigger_puck","top_is_lava"],"forbidden":["base_combo","etherealcoins","telekinesis"]},"Denmark":{"minScore":7200,"required":["bigger_explosions","coin_magnet","etherealcoins"],"forbidden":["respawn","bigger_puck","top_is_lava"]},"El Salvador":{"minScore":7300,"required":["bigger_puck","top_is_lava","helium"],"forbidden":["pierce","coin_magnet","sapper"]},"Egypt":{"minScore":7400,"required":["zen","top_is_lava","soft_reset"],"forbidden":["bigger_puck","telekinesis","puck_repulse_ball"]},"Estonia":{"minScore":7500,"required":["zen","telekinesis","hot_start"],"forbidden":["top_is_lava","bigger_puck","concave_puck"]},"Finland":{"minScore":7600,"required":["concave_puck","hot_start","telekinesis"],"forbidden":["zen","compound_interest","base_combo"]},"Gabon":{"minScore":7700,"required":["respawn","ball_attract_ball","zen"],"forbidden":["streak_shots","sturdy_bricks","hot_start"]},"Georgia":{"minScore":7800,"required":["helium","zen","smaller_puck"],"forbidden":["pierce","telekinesis","sapper"]},"Guinea":{"minScore":7900,"required":["zen","nbricks","smaller_puck"],"forbidden":["pierce_color","left_is_lava","ball_repulse_ball"]},"Indonesia":{"minScore":8000,"required":["trampoline","zen","right_is_lava"],"forbidden":["nbricks","coin_magnet","hot_start"]},"Pingwin":{"minScore":8100,"required":["zen","compound_interest","pierce"],"forbidden":["right_is_lava","sturdy_bricks","helium"]},"Dog 8":{"minScore":8200,"required":["zen","ball_attract_ball","coin_magnet"],"forbidden":["sacrifice","sturdy_bricks","bigger_puck"]},"Sunglasses":{"minScore":8300,"required":["zen","sacrifice","coin_magnet"],"forbidden":["respawn","bigger_puck","top_is_lava"]},"Balloon":{"minScore":8400,"required":["soft_reset","coin_magnet","zen"],"forbidden":["concave_puck","sacrifice","bigger_puck"]},"Opening":{"minScore":8500,"required":["streak_shots","bigger_puck","top_is_lava"],"forbidden":["zen","etherealcoins","coin_magnet"]},"Stripes":{"minScore":8600,"required":["helium","base_combo","zen"],"forbidden":["top_is_lava","ball_attract_ball","bigger_puck"]},"You are here":{"minScore":8700,"required":["zen","forgiving","telekinesis"],"forbidden":["smaller_puck","viscosity","top_is_lava"]},"Gear":{"minScore":8800,"required":["pierce_color","telekinesis","left_is_lava"],"forbidden":["unbounded","respawn","zen"]},"Play":{"minScore":8900,"required":["zen","right_is_lava","skip_last"],"forbidden":["ball_attracts_coins","telekinesis","unbounded"]},"City":{"minScore":9000,"required":["passive_income","asceticism","soft_reset"],"forbidden":["hot_start","ball_repulse_ball","base_combo"]},"Wiggle":{"minScore":9100,"required":["right_is_lava","trampoline","ball_attracts_coins"],"forbidden":["sturdy_bricks","hot_start","compound_interest"]},"Graph":{"minScore":9200,"required":["hot_start","shocks","sapper"],"forbidden":["pierce","ball_attract_ball","ball_attracts_coins"]},"Lightbulb":{"minScore":9300,"required":["hot_start","passive_income","helium"],"forbidden":["trampoline","ball_attracts_coins","pierce"]},"Note":{"minScore":9400,"required":["ball_repulse_ball","puck_repulse_ball","nbricks"],"forbidden":["hot_start","respawn","etherealcoins"]},"Rocket":{"minScore":9500,"required":["etherealcoins","soft_reset","asceticism"],"forbidden":["coin_magnet","hot_start","bigger_puck"]},"Abstract":{"minScore":9600,"required":["bigger_explosions","compound_interest","etherealcoins"],"forbidden":["coin_magnet","passive_income","nbricks"]},"Fingerprint":{"minScore":9700,"required":["pierce","sapper","shocks"],"forbidden":["base_combo","implosions","helium"]},"Leaf":{"minScore":9800,"required":["concave_puck","sacrifice","puck_repulse_ball"],"forbidden":["coin_magnet","trampoline","ball_repulse_ball"]},"Abstract 2":{"minScore":9900,"required":["coin_magnet","streak_shots","sacrifice"],"forbidden":["bigger_puck","top_is_lava","right_is_lava"]},"Abstract 3":{"minScore":10000,"required":["sacrifice","nbricks","etherealcoins"],"forbidden":["shocks","sapper","asceticism"]},"Abstract 4":{"minScore":10100,"required":["trampoline","bigger_explosions","sacrifice"],"forbidden":["ball_attracts_coins","ghost_coins","ball_attract_ball"]},"Abstract 5":{"minScore":10200,"required":["ball_attracts_coins","implosions","forgiving"],"forbidden":["viscosity","base_combo","unbounded"]},"Abstract 6":{"minScore":10300,"required":["puck_repulse_ball","ball_repulse_ball","forgiving"],"forbidden":["viscosity","unbounded","passive_income"]},"Hemiola":{"minScore":10400,"required":["limitless","unbounded","viscosity"],"forbidden":["right_is_lava","forgiving","sturdy_bricks"]},"Obigre":{"minScore":10500,"required":["sapper","shocks","soft_reset"],"forbidden":["bigger_explosions","pierce","skip_last"]},"Noodlemire":{"minScore":10600,"required":["skip_last","concave_puck","passive_income"],"forbidden":["ball_attract_ball","side_flip","side_kick"]},"Bearded axe":{"minScore":10700,"required":["base_combo","streak_shots","side_flip"],"forbidden":["side_kick","implosions","concave_puck"]},"Lebanon":{"minScore":10800,"required":["side_kick","side_flip","etherealcoins"],"forbidden":["smaller_puck","streak_shots","trampoline"]},"Spain":{"minScore":10900,"required":["smaller_puck","passive_income","compound_interest"],"forbidden":["fountain_toss","side_kick","side_flip"]},"Uzbekistan":{"minScore":11000,"required":["picky_eater","ghost_coins","bigger_explosions"],"forbidden":["base_combo","clairvoyant","implosions"]},"Pakistan":{"minScore":11100,"required":["nbricks","ghost_coins","trampoline"],"forbidden":["picky_eater","clairvoyant","corner_shot"]},"Korea":{"minScore":11200,"required":["puck_repulse_ball","ball_attracts_coins","ball_repulse_ball"],"forbidden":["ghost_coins","picky_eater","etherealcoins"]},"Chile":{"minScore":11300,"required":["shocks","sapper","pierce"],"forbidden":["etherealcoins","ball_attracts_coins","ghost_coins"]},"T\xfcrkiye":{"minScore":11400,"required":["compound_interest","fountain_toss","concave_puck"],"forbidden":["bigger_explosions","superhot","respawn"]},"Taj Mahal":{"minScore":11500,"required":["asceticism","soft_reset","streak_shots"],"forbidden":["concave_puck","ball_attract_ball","hot_start"]},"Abstract 7":{"minScore":11600,"required":["hot_start","nbricks","streak_shots"],"forbidden":["trampoline","smaller_puck","superhot"]},"Abstract 9":{"minScore":11700,"required":["implosions","smaller_puck","right_is_lava"],"forbidden":["base_combo","sturdy_bricks","hot_start"]},"Crosshair":{"minScore":11800,"required":["pierce","pierce_color","left_is_lava"],"forbidden":["sapper","transparency","shocks"]},"Abstract 10":{"minScore":11900,"required":["transparency","ball_attract_ball","left_is_lava"],"forbidden":["pierce_color","rainbow","passive_income"]},"Face":{"minScore":12000,"required":["rainbow","corner_shot","bricks_attract_coins"],"forbidden":["base_combo","clairvoyant","respawn"]},"Eiffel tower":{"minScore":12100,"required":["shocks","sapper","clairvoyant"],"forbidden":["passive_income","picky_eater","pierce"]},"Abstract 11":{"minScore":12200,"required":["picky_eater","nbricks","addiction"],"forbidden":["minefield","sturdy_bricks","ghost_coins"]},"Abstract 12":{"minScore":12300,"required":["ghost_coins","sacrifice","ball_attracts_coins"],"forbidden":["concave_puck","picky_eater","compound_interest"]},"Abstract 13":{"minScore":12400,"required":["ball_attract_ball","streak_shots","ghost_coins"],"forbidden":["passive_income","sacrifice","picky_eater"]},"Abstract 14":{"minScore":12500,"required":["smaller_puck","asceticism","rainbow"],"forbidden":["bricks_attract_ball","soft_reset","respawn"]},"S":{"minScore":12600,"required":["pierce","sapper","shocks"],"forbidden":["etherealcoins","trampoline","pierce_color"]},"Abstract 15":{"minScore":12700,"required":["forgiving","viscosity"],"forbidden":["fountain_toss","transparency","left_is_lava"]},"Mario!":{"minScore":12800,"required":["unbounded","limitless","viscosity"],"forbidden":["forgiving","skip_last","ball_attract_ball"]},"Minesweeper":{"minScore":12900,"required":["ottawa_treaty","skip_last","unbounded"],"forbidden":["limitless","viscosity","forgiving"]},"Target":{"minScore":13000,"required":["skip_last","implosions","base_combo"],"forbidden":["etherealcoins","reach","three_cushion"]},"The Boys":{"minScore":13100,"required":["concave_puck","respawn","rainbow"],"forbidden":["reach","corner_shot","skip_last"]},"A Very Dangerous High-Five":{"minScore":13200,"required":["side_kick","rainbow","corner_shot"],"forbidden":["streak_shots","reach","clairvoyant"]},"Blinky":{"required":["clairvoyant","reach","double_or_nothing"],"forbidden":["nbricks","corner_shot","smaller_puck"],"minScore":13300},"Fish":{"required":["reach","pierce","picky_eater"],"forbidden":["sapper","shocks","ghost_coins"],"minScore":13400},"Spider":{"required":["transparency","ghost_coins","left_is_lava"],"forbidden":["pierce_color","reach","sticky_coins"],"minScore":13500},"Gliders":{"required":["trampoline","superhot","bricks_attract_ball"],"forbidden":["reach","rainbow","ghost_coins"],"minScore":13600},"Lone island":{"required":["reach","passive_income","happy_family"],"forbidden":["bigger_explosions","wrap_right","ghost_coins"],"minScore":13700},"Spacewyrm Jon":{"required":["nbricks","reach","three_cushion"],"forbidden":["happy_family","metamorphosis","hot_start"],"minScore":13800},"Taijitu":{"required":["hot_start","puck_repulse_ball","ball_repulse_ball"],"forbidden":["helium","pierce","etherealcoins"],"minScore":13900},"Egg pan":{"required":["hot_start","streak_shots","implosions"],"forbidden":["concave_puck","bricks_attract_coins","base_combo"],"minScore":14000},"Inception":{"required":["hot_start","wrap_left","smaller_puck"],"forbidden":["streak_shots","superhot","bricks_attract_coins"],"minScore":14100},"Chess":{"required":["respawn","wrap_left","sapper"],"forbidden":["shocks","metamorphosis","pierce"],"minScore":14200},"italy":{"required":["sticky_coins","pierce_color","left_is_lava"],"forbidden":["transparency","etherealcoins","three_cushion"],"minScore":14300},"Nuclear Throne":{"required":[],"forbidden":[],"minScore":0},"utc":{"required":["ball_attracts_coins","corner_shot","ball_repulse_ball"],"forbidden":["puck_repulse_ball","clairvoyant","nbricks"],"minScore":14400},"Bzh":{"required":["clairvoyant","addiction","corner_shot"],"forbidden":["minefield","base_combo","picky_eater"],"minScore":14500},"FTL":{"required":["bigger_explosions","minefield","happy_family"],"forbidden":["picky_eater","trampoline","clairvoyant"],"minScore":14600},"Nova drift":{"required":["rainbow","ghost_coins","sacrifice"],"forbidden":["picky_eater","pierce","wrap_right"],"minScore":14700},"Heat Signature":{"required":["extra_life","ghost_coins","sturdy_bricks"],"forbidden":["picky_eater","puck_repulse_ball","sacrifice"],"minScore":14800},"Noita":{"required":["nbricks","ghost_coins","golden_goose"],"forbidden":["forgiving","picky_eater","viscosity"],"minScore":14900},"Enter the gungeon":{"required":["shocks","sapper","smaller_puck"],"forbidden":["pierce","implosions","wrap_right"],"minScore":15000},"ZERO Sievert":{"required":["ottawa_treaty","superhot","forgiving"],"forbidden":["sticky_coins","pierce_color","viscosity"],"minScore":15100},"Factorio":{"required":["limitless","unbounded","viscosity"],"forbidden":["passive_income","right_is_lava","forgiving"],"minScore":15200},"Brigador":{"required":["puck_repulse_ball","respawn","soft_reset"],"forbidden":["ball_repulse_ball","skip_last","unbounded"],"minScore":15300},"Teleglitch":{"required":["happy_family","skip_last","ball_attracts_coins"],"forbidden":["side_flip","side_kick","corner_shot"],"minScore":15400}}'); + +},{}],"2fQt0":[function(require,module,exports,__globalThis) { +var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); +parcelHelpers.defineInteropFlag(exports); +parcelHelpers.export(exports, "openUpgradesPicker", ()=>openUpgradesPicker); +parcelHelpers.export(exports, "dontOfferTooSoon", ()=>dontOfferTooSoon); +parcelHelpers.export(exports, "applySettingsChangeReco", ()=>applySettingsChangeReco); +parcelHelpers.export(exports, "settingsChangeRecommendations", ()=>settingsChangeRecommendations); +var _pureFunctions = require("./pure_functions"); +var _i18N = require("./i18n/i18n"); +var _loadGameData = require("./loadGameData"); +var _asyncAlert = require("./asyncAlert"); +var _gameUtils = require("./game_utils"); +var _openScorePanel = require("./openScorePanel"); +var _options = require("./options"); +var _fps = require("./fps"); +var _settings = require("./settings"); +var _toast = require("./toast"); +async function openUpgradesPicker(gameState) { + const catchRate = gameState.levelCoughtCoins / (gameState.levelSpawnedCoins || 1); + let medals = []; + let upgradePoints = 1; + let extraChoices = 0; + let hasMedals = 0; + function challengeResult(name, description, medal) { + let choices = 0, up = 0; + if (medal === "gold") { + choices += (0, _pureFunctions.choicePerGold); + up += (0, _pureFunctions.upPerGold); + } else if (medal === "silver") { + choices += (0, _pureFunctions.choicePerSilver); + up += (0, _pureFunctions.upPerSilver); + } + if (medal !== "no") hasMedals++; + extraChoices += choices; + upgradePoints += up; + medals.push(`
+ ${name}
+ ${up || choices ? (0, _i18N.t)("level_up.challenges.gain", {
+ up,
+ choices
+ }) : (0, _i18N.t)("level_up.challenges.no_gain")}
+
+
${(0, _i18N.t)("score_panel.close_to_unlock")}
++ ${title} + ${firstUnlockable.reason?.text} +
+
+ ${u.name}
+ ${u.help(1)}
+
+ ${l.name} +
+ ${(0, _pureFunctions.miniMarkDown)(l.credit || "")} +