mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-21 20:46:14 -04:00
Extracted english translations
This commit is contained in:
parent
7999777f69
commit
7555ed0ff1
14 changed files with 10224 additions and 2910 deletions
11
Readme.md
11
Readme.md
|
@ -20,9 +20,13 @@ 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).
|
||||
|
||||
# bugs
|
||||
# Next
|
||||
|
||||
|
||||
- separate particles by type
|
||||
- reuse coins and particles
|
||||
- sturdy bricks map of remaining hits
|
||||
|
||||
- apk version soft locks at start ?
|
||||
|
||||
# UX
|
||||
- the onboarding feels weird, missing a tutorial
|
||||
|
@ -55,9 +59,10 @@ There's also an easy mode for kids (slower ball).
|
|||
- restart run on r
|
||||
- when missing, redo particle trail, but give speed to particle that matches ball direction
|
||||
|
||||
|
||||
# graphics
|
||||
- apply global curve / brightness to canvas when things blow, or just always to make neon effect better
|
||||
- lights shadows
|
||||
- lights shadows with background gradient light map ?
|
||||
- webgl rendering
|
||||
- shinier coins by applying glow to them
|
||||
- different visual effects on ball to represent which perks it's imbued with (pierce, sapper…). remove visual while it's not affected (can't pierce/sap anymore until touching the puck).
|
||||
|
|
2
dist/index.c0fd3053.js.map
vendored
2
dist/index.c0fd3053.js.map
vendored
File diff suppressed because one or more lines are too long
3584
dist/index.html
vendored
3584
dist/index.html
vendored
File diff suppressed because one or more lines are too long
33
dist/sw-b71.js
vendored
33
dist/sw-b71.js
vendored
|
@ -1,2 +1,33 @@
|
|||
function e(e,t,n,r,a,i,c){try{var o=e[i](c),u=o.value}catch(e){n(e);return}o.done?t(u):Promise.resolve(u).then(r,a)}function t(t){return function(){var n=this,r=arguments;return new Promise(function(a,i){var c=t.apply(n,r);function o(t){e(c,a,i,o,u,"next",t)}function u(t){e(c,a,i,o,u,"throw",t)}o(void 0)})}}function n(e,t){var n,r,a,i,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(i){return function(o){return function(i){if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(a=(a=c.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){c.label=i[1];break}if(6===i[0]&&c.label<a[1]){c.label=a[1],a=i;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(i);break}a[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,o])}}}var r="breakout-71-".concat("29033878"),a=["/"];self.addEventListener("install",function(e){e.waitUntil(t(function(){return n(this,function(e){switch(e.label){case 0:return[4,caches.open(r)];case 1:return e.sent().addAll(a),[2]}})})())}),self.addEventListener("activate",function(e){e.waitUntil(t(function(){return n(this,function(e){switch(e.label){case 0:return[4,caches.keys()];case 1:return[4,Promise.all(e.sent().map(function(e){if(e!==r)return caches.delete(e)}))];case 2:return e.sent(),[4,clients.claim()];case 3:return e.sent(),[2]}})})())}),self.addEventListener("fetch",function(e){if("navigate"===e.request.mode&&e.request.url.endsWith("/index.html?isPWA=true")){e.respondWith(caches.match("/"));return}});
|
||||
// The version of the cache.
|
||||
const VERSION = "29033878";
|
||||
// The name of the cache
|
||||
const CACHE_NAME = `breakout-71-${VERSION}`;
|
||||
// The static resources that the app needs to function.
|
||||
const APP_STATIC_RESOURCES = [
|
||||
"/"
|
||||
];
|
||||
// On install, cache the static resources
|
||||
self.addEventListener("install", (event)=>{
|
||||
event.waitUntil((async ()=>{
|
||||
const cache = await caches.open(CACHE_NAME);
|
||||
cache.addAll(APP_STATIC_RESOURCES);
|
||||
})());
|
||||
});
|
||||
// delete old caches on activate
|
||||
self.addEventListener("activate", (event)=>{
|
||||
event.waitUntil((async ()=>{
|
||||
const names = await caches.keys();
|
||||
await Promise.all(names.map((name)=>{
|
||||
if (name !== CACHE_NAME) return caches.delete(name);
|
||||
}));
|
||||
await clients.claim();
|
||||
})());
|
||||
});
|
||||
self.addEventListener("fetch", (event)=>{
|
||||
if (event.request.mode === "navigate" && event.request.url.endsWith("/index.html?isPWA=true")) {
|
||||
event.respondWith(caches.match("/"));
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=sw-b71.js.map
|
||||
|
|
2
dist/sw-b71.js.map
vendored
2
dist/sw-b71.js.map
vendored
File diff suppressed because one or more lines are too long
5391
src/game.ts
5391
src/game.ts
File diff suppressed because it is too large
Load diff
3283
src/i18n/b71.babel
Normal file
3283
src/i18n/b71.babel
Normal file
File diff suppressed because it is too large
Load diff
202
src/i18n/en.json
Normal file
202
src/i18n/en.json
Normal file
|
@ -0,0 +1,202 @@
|
|||
{
|
||||
"appName": "Breakout 71",
|
||||
"gameOver.cumulative_total": "Your total cumulative score went from {{startTs}} to {{endTs}}.",
|
||||
"gameOver.lost.summary": "You dropped the ball after catching {{score}} coins.",
|
||||
"gameOver.lost.title": "Game Over",
|
||||
"gameOver.next_unlock": "Score {{points}} more points to reach the next unlock",
|
||||
"gameOver.restart": "Start a new run",
|
||||
"gameOver.stats.balls_lost": "Balls lost",
|
||||
"gameOver.stats.bricks_broken": "Bricks broken",
|
||||
"gameOver.stats.bricks_per_minute": "Bricks broken per minute",
|
||||
"gameOver.stats.catch_rate": "Catch rate",
|
||||
"gameOver.stats.combo_avg": "Average combo",
|
||||
"gameOver.stats.combo_max": "Max combo",
|
||||
"gameOver.stats.duration_per_level": "Duration per level",
|
||||
"gameOver.stats.hit_rate": "Hit rate",
|
||||
"gameOver.stats.intro": "Find below your run statistics compared to your {{count}} best runs.",
|
||||
"gameOver.stats.level_reached": "Level reached",
|
||||
"gameOver.stats.total_score": "Total score",
|
||||
"gameOver.stats.upgrades_applied": "Upgrades applied",
|
||||
"gameOver.test_run": "This test run and its score are not being recorded",
|
||||
"gameOver.unlocked_count": "You unlocked {{count}} item(s) :",
|
||||
"gameOver.win.summary": "You cleared all levels for this run, catching {{score}} coins in total.",
|
||||
"gameOver.win.title": "Run finished",
|
||||
"level_up.after_buttons": "You just finished level {{level}}/{{max}} and picked those upgrades so far :",
|
||||
"level_up.before_buttons": "You caught {{score}} coins {{catchGain}} out of {{levelSpawnedCoins}} in {{time}} seconds ${timeGain}.\n\nYou missed {{levelMisses}} times {{missesGain}}.\n\n{{compliment}}",
|
||||
"level_up.compliment_advice": "Try to catch all coins, never miss the bricks or clear the level under 30s to gain additional choices and upgrades.",
|
||||
"level_up.compliment_good": "Well done !",
|
||||
"level_up.compliment_perfect": "Impressive, keep it up !",
|
||||
"level_up.pick_upgrade_title": "Pick an upgrade",
|
||||
"level_up.plus_one_choice": "(+1 choice)",
|
||||
"level_up.plus_one_upgrade": "(+1 upgrade and choice)",
|
||||
"level_up.unlocked_level": " (Level)",
|
||||
"level_up.unlocked_perk": " (Perk)",
|
||||
"level_up.upgrade_perk_to_level": " lvl {{level}}",
|
||||
"main_menu.basic": "Basic graphics",
|
||||
"main_menu.basic_help": "Fewer particles and flashes, better performance.",
|
||||
"main_menu.footer_html": " <p> <span>Made in France by <a href=\"https://lecaro.me\">Renan LE CARO</a>.</span> \n <a href=\"https://breakout.lecaro.me/privacy.html\" target=\"_blank\">Privacy Policy</a>\n <a href=\"https://f-droid.org/en/packages/me.lecaro.breakout/\" target=\"_blank\">F-Droid</a>\n <a href=\"https://play.google.com/store/apps/details?id=me.lecaro.breakout\" target=\"_blank\">Google Play</a>\n <a href=\"https://renanlecaro.itch.io/breakout71\" target=\"_blank\">itch.io</a> \n <a href=\"https://gitlab.com/lecarore/breakout71\" target=\"_blank\">Gitlab</a>\n <a href=\"https://breakout.lecaro.me/\" target=\"_blank\">Web version</a>\n <a href=\"https://news.ycombinator.com/item?id=43183131\" target=\"_blank\">HackerNews</a>\n <span>v.{{appVersion}}</span></p>",
|
||||
"main_menu.fullscreen": "Fullscreen",
|
||||
"main_menu.fullscreen_exit": "Exit Fullscreen",
|
||||
"main_menu.fullscreen_exit_help": "Might not work on some machines",
|
||||
"main_menu.fullscreen_help": "Might not work on some machines",
|
||||
"main_menu.kid": "Kids mode",
|
||||
"main_menu.kid_help": "Start future runs with \"slower ball\".",
|
||||
"main_menu.mobile": "Mobile mode",
|
||||
"main_menu.mobile_help": "Leaves space for your thumb under the puck.",
|
||||
"main_menu.pointer_lock": "Mouse pointer lock",
|
||||
"main_menu.pointer_lock_help": "Locks and hides the mouse cursor.",
|
||||
"main_menu.record": "Record gameplay videos",
|
||||
"main_menu.record_download": "Download video ({{size}} MB)",
|
||||
"main_menu.record_help": "Get a video of each level.",
|
||||
"main_menu.reset": "Reset Game",
|
||||
"main_menu.reset_cancel": "No",
|
||||
"main_menu.reset_confirm": "Yes",
|
||||
"main_menu.reset_help": "Erase high score and statistics",
|
||||
"main_menu.reset_instruction": "You will loose all progress you made in the game, are you sure ?",
|
||||
"main_menu.resume": "Resume",
|
||||
"main_menu.resume_help": "Return to your run",
|
||||
"main_menu.sounds": "Game sounds",
|
||||
"main_menu.sounds_help": "Can slow down some phones.",
|
||||
"main_menu.title": "Breakout 71",
|
||||
"main_menu.unlocks": "Starting perk",
|
||||
"main_menu.unlocks_help": "Try perks and levels you unlocked",
|
||||
"play.close_modale_window_tooltip": "close ",
|
||||
"play.confirm_restart": "You pressed [R], restart game now ? ",
|
||||
"play.confirm_restart_no": "No",
|
||||
"play.confirm_restart_yes": "Yes",
|
||||
"play.current_lvl": "L{{level}}/{{max}}",
|
||||
"play.menu_label": "menu",
|
||||
"play.missed_ball": "miss",
|
||||
"play.mobile_press_to_play": "Press and hold here to play",
|
||||
"sandbox.help": "Test any perk combination",
|
||||
"sandbox.instructions": "Select perks below and press \"start run\" to try them out in a test run. Scores and stats are not recorded.",
|
||||
"sandbox.start": "Start test run",
|
||||
"sandbox.title": "Sandbox mode",
|
||||
"sandbox.unlocks_at": "Unlocks at total score ${{score}}",
|
||||
"score_panel.restart": "Restart",
|
||||
"score_panel.restart_help": "Start a brand new run",
|
||||
"score_panel.resume": "Resume",
|
||||
"score_panel.resume_help": "Return to your run",
|
||||
"score_panel.test_run": "This is a test run, score is not recorded permanently",
|
||||
"score_panel.title": "{{score}} points at level {{level}}/{{max}} ",
|
||||
"score_panel.upgrades_picked": "Upgrades picked so far : ",
|
||||
"tagLine": "Break bricks, catch coins, upgrade, repeat.",
|
||||
"unlocks.greyed_out_help": "The greyed out ones can be unlocked by increasing your total score. The total score increases every time you score in game.",
|
||||
"unlocks.intro": "Your total score is {{ts}}. Below are all the upgrades and levels the games has to offer.",
|
||||
"unlocks.level_description": "A {{size}}x{{size}} level with {{bricks}} bricks",
|
||||
"unlocks.restart_cancel": "Cancel",
|
||||
"unlocks.restart_confirm": "Restart game to test item",
|
||||
"unlocks.restart_text": "You're about to start a new run with the selected unlocked item, is that really what you wanted ?",
|
||||
"unlocks.restart_title": "Restart run to try this item?",
|
||||
"unlocks.title": "You unlocked {{percentUnlock}}% of the game.",
|
||||
"unlocks.unlocks_at": "Unlocks at total score {{threshold}}.",
|
||||
"upgrades.ball_attract_ball.fullHelp": "Balls that are more than half a screen width away will start attracting each other. The attraction force is stronger when they are furthest away from each other.\n Rainbow particles will fly to symbolize the attraction force. This perk is only offered if you have more than one ball already.",
|
||||
"upgrades.ball_attract_ball.help": "Balls attract balls",
|
||||
"upgrades.ball_attract_ball.help_plural": "Stronger attraction force",
|
||||
"upgrades.ball_attract_ball.name": "Gravity",
|
||||
"upgrades.ball_repulse_ball.fullHelp": "Balls that are less than half a screen width away will start repulsing each other. The repulsion force is stronger if they are close to each other.\n Particles will jet out to symbolize this force being applied. This perk is only offered if you have more than one ball already.",
|
||||
"upgrades.ball_repulse_ball.help": "Balls repulse balls",
|
||||
"upgrades.ball_repulse_ball.help_plural": "Stronger repulsion force",
|
||||
"upgrades.ball_repulse_ball.name": "Personal space",
|
||||
"upgrades.base_combo.fullHelp": "Your combo (number of coins per bricks) normally starts at 1 at the beginning of the level, and resets to one when you bounce around without hitting anything. \n With this perk, the combo starts 3 points higher, so you'll always get at least 4 coins per brick. Whenever your combo reset, it will go back to 4 and not 1. \n Your ball will glitter a bit to indicate that its combo is higher than one.",
|
||||
"upgrades.base_combo.help": "Every brick drops at least {{}} coins.",
|
||||
"upgrades.base_combo.name": "+3 base combo",
|
||||
"upgrades.bigger_explosions.fullHelp": "The default explosion clears a 3x3 square, with this it becomes a 5x5 square, and the blow on the coins is also significantly stronger. The screen will flash after each explosion (except in basic mode)",
|
||||
"upgrades.bigger_explosions.help": "Bigger explosions",
|
||||
"upgrades.bigger_explosions.name": "Kaboom",
|
||||
"upgrades.bigger_puck.fullHelp": "A bigger puck makes it easier to never miss the ball and to catch more coins, and also to precisely angle the bounces (the ball's angle only depends on where it hits the puck). \n However, a large puck is harder to use around the sides of the level, and will make it sometimes unavoidable to miss (not hit anything) which comes with downsides. ",
|
||||
"upgrades.bigger_puck.help": "Easily catch more coins.",
|
||||
"upgrades.bigger_puck.name": "Bigger puck",
|
||||
"upgrades.coin_magnet.fullHelp": "Directs the coins to the puck. The effect is stronger if the coin is close to it already. Catching 90% or 100% of coins bring special bonuses in the game. \n Another way to catch more coins is to hit bricks from the bottom. The ball's speed and direction impacts the spawned coin's velocity. ",
|
||||
"upgrades.coin_magnet.help": "Puck attracts coins",
|
||||
"upgrades.coin_magnet.help_plural": "Stronger effect on the coins",
|
||||
"upgrades.coin_magnet.name": "Coins magnet",
|
||||
"upgrades.compound_interest.fullHelp": "Your combo will grow by one every time you break a brick, spawning more and more coin with every brick you break. Be sure however to catch every one of those coins\n with your puck, as any lost coin will decrease your combo by one point. One your combo is above the minimum, the bottom of the play area will\n have a red line to remind you that coins should not go there. This perk combines with other combo perks, the combo will rise faster but reset more easily.",
|
||||
"upgrades.compound_interest.help": "+1 combo per brick broken, resets on coin lost",
|
||||
"upgrades.compound_interest.name": "Compound interest",
|
||||
"upgrades.extra_levels.fullHelp": "The default run can last a max of 7 levels, after which the game is over and whatever score you reached is your run score. \n Each level of this perk lets you go one level higher. The last levels are often the ones where you make the most score, so the difference can be dramatic.",
|
||||
"upgrades.extra_levels.help": "Play {{count}} levels instead of 7",
|
||||
"upgrades.extra_levels.name": "+1 level",
|
||||
"upgrades.extra_life.fullHelp": "Normally, you have one ball per run, and the run is over as soon as you drop it.\n This perk adds a white bar at the bottom of the screen that will save a ball once, and break in the process. \n You'll loose one level of that perk every time a ball bounces at the bottom of the screen.",
|
||||
"upgrades.extra_life.help": "The ball will bounce once on the bottom line before being lost.",
|
||||
"upgrades.extra_life.help_plural": "The ball will bounce on the bottom {{lvl}} times before being lost.",
|
||||
"upgrades.extra_life.name": "+1 life",
|
||||
"upgrades.hot_start.fullHelp": "At the start of every level, your combo will start at +15 points, but then every second it will be decreased by one. This means the first 15 seconds in a level will spawn\n many more coins than the following ones, and you should make sure that you clear the level quickly. The effect stacks with other combo related perks, so you might be able to raise \n the combo after the 15s timeout, but it will keep ticking down. Every time you take the perk again, the effect will be more dramatic.",
|
||||
"upgrades.hot_start.help": "Start at combo {{start}}, -{{lvl}} combo per second",
|
||||
"upgrades.hot_start.name": "Hot start",
|
||||
"upgrades.instant_upgrade.fullHelp": "Immediately pick two upgrades, so that you get one free one and one to repay the one used to get this perk. Every further menu to pick upgrades will have fewer options to choose from.",
|
||||
"upgrades.instant_upgrade.help": "-1 choice until run end.",
|
||||
"upgrades.instant_upgrade.help_plural": "Even fewer options",
|
||||
"upgrades.instant_upgrade.name": "+2 upgrades now",
|
||||
"upgrades.left_is_lava.fullHelp": "Whenever you break a brick, your combo will increase by one, so you'll get one more coin from all the next bricks you break.\n However, your combo will reset as soon as your ball hits the left side . \n As soon as your combo rises, the left side becomes red to remind you that you should avoid hitting them. \n The effect stacks with other combo perks, combo rises faster with more upgrades but will also reset if any\n of the reset conditions are met.",
|
||||
"upgrades.left_is_lava.help": "More coins if you don't touch the left side.",
|
||||
"upgrades.left_is_lava.name": "Avoid left side",
|
||||
"upgrades.metamorphosis.fullHelp": "With this perk, coins will be of the color of the brick they come from, and will color the first brick they touch in the same color. Coins spawn with the speed of the ball that broke them, which means you can aim a bit in the direction of the bricks you want to \"paint\".",
|
||||
"upgrades.metamorphosis.help": "Coins stain the bricks they touch",
|
||||
"upgrades.metamorphosis.name": "Metamorphosis",
|
||||
"upgrades.multiball.fullHelp": "As soon as you drop the ball in Breakout 71, you loose. With this perk, you get two balls, and so you can afford to lose one. \n The lost balls come back on the next level. Having more than one balls makes some further perks available, and of course clears the level faster.",
|
||||
"upgrades.multiball.help": "Start every levels with {{count}} balls.",
|
||||
"upgrades.multiball.name": "+1 ball",
|
||||
"upgrades.one_more_choice.fullHelp": "Every upgrade menu will have one more option. Doesn't increase the number of upgrades you can pick.",
|
||||
"upgrades.one_more_choice.help": "Further level ups will offer one more option in the list",
|
||||
"upgrades.one_more_choice.help_plural": "Even more options",
|
||||
"upgrades.one_more_choice.name": "+1 choice until run end",
|
||||
"upgrades.picky_eater.fullHelp": "Whenever you break a brick the same color as your ball, your combo increases by one. \n If it's a different color, the ball takes that new color, but the combo resets.\n The bricks with the right color will get a white border. \n Once you get a combo higher than your minimum, the bricks of the wrong color will get a red halo. \n If you have more than one ball, they all change color whenever one of them hits a brick.",
|
||||
"upgrades.picky_eater.help": "More coins if you break bricks color by color.",
|
||||
"upgrades.picky_eater.name": "Picky eater",
|
||||
"upgrades.pierce.fullHelp": "The ball normally bounces as soon as it touches something. With this perk, it will continue its trajectory for up to 3 bricks broken. \n After that, it will bounce on the 4th brick, and you'll need to touch the puck to reset the counter. This combines particularly well with Sapper. ",
|
||||
"upgrades.pierce.help": "Ball pierces {{count}} bricks after a puck bounce",
|
||||
"upgrades.pierce.name": "Piercing",
|
||||
"upgrades.pierce_color.fullHelp": "Whenever a ball hits a brick of the same color, it will just go through unimpeded. \n Once it reaches a brick of a different color, it will break it, take its color and bounce.",
|
||||
"upgrades.pierce_color.help": "Balls pierce bricks of their color",
|
||||
"upgrades.pierce_color.name": "Color pierce",
|
||||
"upgrades.puck_repulse_ball.fullHelp": "When a ball gets close to the puck, it will start slowing down, and even potentially bouncing without touching the puck.",
|
||||
"upgrades.puck_repulse_ball.help": "Puck repulses balls",
|
||||
"upgrades.puck_repulse_ball.help_plural": "Stronger repulsion force",
|
||||
"upgrades.puck_repulse_ball.name": "Soft landing",
|
||||
"upgrades.respawn.fullHelp": "After breaking two or more bricks, when the ball hits the puck, the first brick will be put back in place, provided that space is free and the brick wasn't a bomb.\n Some particle effect will let you know where bricks will appear. Levelling this up lets you respawn up to 4 bricks at a time, but there should always be at least one destroyed.",
|
||||
"upgrades.respawn.help": "The first brick hit of two+ will respawn",
|
||||
"upgrades.respawn.help_plural": "More bricks can respawn",
|
||||
"upgrades.respawn.name": "Respawn",
|
||||
"upgrades.right_is_lava.fullHelp": "Whenever you break a brick, your combo will increase by one, so you'll get one more coin from all the next bricks you break.\n However, your combo will reset as soon as your ball hits the right side . \n As soon as your combo rises, the right side becomes red to remind you that you should avoid hitting them. \n The effect stacks with other combo perks, combo rises faster with more upgrades but will also reset if any\n of the reset conditions are met.",
|
||||
"upgrades.right_is_lava.help": "More coins if you don't touch the right side.",
|
||||
"upgrades.right_is_lava.name": "Avoid right side",
|
||||
"upgrades.sapper.fullHelp": "Instead of just disappearing, the first brick you break will be replaced by a bomb brick. Bouncing the ball on the puck re-arms the effect. \"Piercing\" will instantly\n detonate the bomb that was just placed. Leveling-up this perk will allow you to place more bombs. Remember that bombs impact the velocity of nearby coins, so too many explosions\n could make it hard to catch the fruits of your hard work.",
|
||||
"upgrades.sapper.help": "The first brick broken becomes a bomb.",
|
||||
"upgrades.sapper.help_plural": "The first {{lvl}} bricks broken become bombs.",
|
||||
"upgrades.sapper.name": "Sapper",
|
||||
"upgrades.skip_last.fullHelp": "You need to break all bricks to go to the next level. However, it can be hard to get the last ones. \n Clearing a level early brings extra choices when upgrading. Never missing the bricks is also very beneficial. \n So if you find it difficult to break the last bricks, getting this perk a few time can help.",
|
||||
"upgrades.skip_last.help": "The last {{lvl}} brick(s) left will self-destruct.",
|
||||
"upgrades.skip_last.name": "Easy Cleanup",
|
||||
"upgrades.slow_down.fullHelp": "The ball starts relatively slow, but every level of your run it will start a bit faster, and it will also accelerate if you spend a lot of time in one level. This perk makes it\n more manageable. You can get it at the start every time by enabling kid mode in the menu.",
|
||||
"upgrades.slow_down.help": "Ball moves more slowly",
|
||||
"upgrades.slow_down.name": "Slower ball",
|
||||
"upgrades.smaller_puck.fullHelp": "This makes the puck smaller, which in theory makes some corner shots easier, but really just raises the difficulty. \n That's why you also get a nice bonus of +5 coins per brick for all bricks you'll break after picking this. ",
|
||||
"upgrades.smaller_puck.help": "Also gives +5 base combo",
|
||||
"upgrades.smaller_puck.help_plural": "Even smaller puck and higher base combo",
|
||||
"upgrades.smaller_puck.name": "Smaller puck",
|
||||
"upgrades.soft_reset.fullHelp": "The combo normally climbs every time you break a brick. This will sometimes cancel that climb, but also limit the impact of a combo reset.",
|
||||
"upgrades.soft_reset.help": "Combo grows slower but resets less",
|
||||
"upgrades.soft_reset.name": "Soft reset",
|
||||
"upgrades.streak_shots.fullHelp": "Every time you break a brick, your combo (number of coins per bricks) increases by one. However, as soon as the ball touches your puck, \n the combo is reset to its default value, and you'll just get one coin per brick. So you should try to hit many bricks in one go for more score. \n Once your combo rises above the base value, your puck will become red to remind you that it will destroy your combo to touch it with the ball.\n This can stack with other combo related perks, the combo will rise faster but reset more easily as any of the conditions is enough to reset it. ",
|
||||
"upgrades.streak_shots.help": "More coins if you break many bricks at once.",
|
||||
"upgrades.streak_shots.name": "Single puck hit streak",
|
||||
"upgrades.sturdy_bricks.fullHelp": "With level one of this perk, the ball has a 20% chance to bounce harmlessly on bricks, \n but generates 10% more coins when it does break one. \n This +10% is not shown in the combo number. At level 4 the ball has 80% chance of bouncing and brings 40% more coins.",
|
||||
"upgrades.sturdy_bricks.help": "Bricks sometimes resist hits but drop more coins.",
|
||||
"upgrades.sturdy_bricks.help_plural": "Bricks resist more and drop more coins",
|
||||
"upgrades.sturdy_bricks.name": "Sturdy bricks",
|
||||
"upgrades.telekinesis.fullHelp": "Right after the ball hits your puck, you'll be able to direct it left and right by moving your puck. \n The effect stops when the ball hits a brick and resets the next time it touches the puck. It also does nothing when the ball is going downward after bouncing at the top.",
|
||||
"upgrades.telekinesis.help": "Control the ball's trajectory",
|
||||
"upgrades.telekinesis.help_plural": "Stronger effect on the ball",
|
||||
"upgrades.telekinesis.name": "Puck controls ball",
|
||||
"upgrades.top_is_lava.fullHelp": "Whenever you break a brick, your combo will increase by one. However, your combo will reset as soon as your ball hit the top of the screen. \n When your combo is above the minimum, a red bar will appear at the top to remind you that you should avoid hitting it. \n The effect stacks with other combo perks.",
|
||||
"upgrades.top_is_lava.help": "More coins if you don't touch the top.",
|
||||
"upgrades.top_is_lava.name": "Sky is the limit",
|
||||
"upgrades.viscosity.fullHelp": "Coins normally accelerate with gravity and explosions to pretty high speeds. This perk constantly makes them slow down, as if they were in some sort of viscous liquid. \n This makes catching them easier, and combines nicely with perks that influence the coin's movement.",
|
||||
"upgrades.viscosity.help": "Slower coin fall",
|
||||
"upgrades.viscosity.name": "Viscosity",
|
||||
"upgrades.wind.fullHelp": "The wind depends on where your puck is, if it's in the center of the screen nothing happens, if it's on the left it will blow leftwise, if it's on the right of the screen\n then it will blow rightwise. The wind affects both the balls and coins.",
|
||||
"upgrades.wind.help": "Puck position creates wind",
|
||||
"upgrades.wind.help_plural": "Stronger wind force",
|
||||
"upgrades.wind.name": "Wind"
|
||||
}
|
202
src/i18n/fr.json
Normal file
202
src/i18n/fr.json
Normal file
|
@ -0,0 +1,202 @@
|
|||
{
|
||||
"appName": "Breakout 71",
|
||||
"gameOver.cumulative_total": "",
|
||||
"gameOver.lost.summary": "",
|
||||
"gameOver.lost.title": "",
|
||||
"gameOver.next_unlock": "",
|
||||
"gameOver.restart": "",
|
||||
"gameOver.stats.balls_lost": "",
|
||||
"gameOver.stats.bricks_broken": "",
|
||||
"gameOver.stats.bricks_per_minute": "",
|
||||
"gameOver.stats.catch_rate": "",
|
||||
"gameOver.stats.combo_avg": "",
|
||||
"gameOver.stats.combo_max": "",
|
||||
"gameOver.stats.duration_per_level": "",
|
||||
"gameOver.stats.hit_rate": "",
|
||||
"gameOver.stats.intro": "",
|
||||
"gameOver.stats.level_reached": "",
|
||||
"gameOver.stats.total_score": "",
|
||||
"gameOver.stats.upgrades_applied": "",
|
||||
"gameOver.test_run": "",
|
||||
"gameOver.unlocked_count": "",
|
||||
"gameOver.win.summary": "",
|
||||
"gameOver.win.title": "",
|
||||
"level_up.after_buttons": "",
|
||||
"level_up.before_buttons": "",
|
||||
"level_up.compliment_advice": "",
|
||||
"level_up.compliment_good": "",
|
||||
"level_up.compliment_perfect": "",
|
||||
"level_up.pick_upgrade_title": "",
|
||||
"level_up.plus_one_choice": "",
|
||||
"level_up.plus_one_upgrade": "",
|
||||
"level_up.unlocked_level": "",
|
||||
"level_up.unlocked_perk": "",
|
||||
"level_up.upgrade_perk_to_level": "",
|
||||
"main_menu.basic": "",
|
||||
"main_menu.basic_help": "",
|
||||
"main_menu.footer_html": "",
|
||||
"main_menu.fullscreen": "",
|
||||
"main_menu.fullscreen_exit": "",
|
||||
"main_menu.fullscreen_exit_help": "",
|
||||
"main_menu.fullscreen_help": "",
|
||||
"main_menu.kid": "",
|
||||
"main_menu.kid_help": "",
|
||||
"main_menu.mobile": "",
|
||||
"main_menu.mobile_help": "",
|
||||
"main_menu.pointer_lock": "",
|
||||
"main_menu.pointer_lock_help": "",
|
||||
"main_menu.record": "",
|
||||
"main_menu.record_download": "",
|
||||
"main_menu.record_help": "",
|
||||
"main_menu.reset": "",
|
||||
"main_menu.reset_cancel": "",
|
||||
"main_menu.reset_confirm": "",
|
||||
"main_menu.reset_help": "",
|
||||
"main_menu.reset_instruction": "",
|
||||
"main_menu.resume": "",
|
||||
"main_menu.resume_help": "",
|
||||
"main_menu.sounds": "",
|
||||
"main_menu.sounds_help": "",
|
||||
"main_menu.title": "",
|
||||
"main_menu.unlocks": "",
|
||||
"main_menu.unlocks_help": "",
|
||||
"play.close_modale_window_tooltip": "",
|
||||
"play.confirm_restart": "",
|
||||
"play.confirm_restart_no": "",
|
||||
"play.confirm_restart_yes": "",
|
||||
"play.current_lvl": "",
|
||||
"play.menu_label": "",
|
||||
"play.missed_ball": "",
|
||||
"play.mobile_press_to_play": "",
|
||||
"sandbox.help": "",
|
||||
"sandbox.instructions": "",
|
||||
"sandbox.start": "",
|
||||
"sandbox.title": "",
|
||||
"sandbox.unlocks_at": "",
|
||||
"score_panel.restart": "",
|
||||
"score_panel.restart_help": "",
|
||||
"score_panel.resume": "",
|
||||
"score_panel.resume_help": "",
|
||||
"score_panel.test_run": "",
|
||||
"score_panel.title": "",
|
||||
"score_panel.upgrades_picked": "",
|
||||
"tagLine": "Cassez les briques, attrapez les pièces d'or et sélectionnez des améliorations.",
|
||||
"unlocks.greyed_out_help": "",
|
||||
"unlocks.intro": "",
|
||||
"unlocks.level_description": "",
|
||||
"unlocks.restart_cancel": "",
|
||||
"unlocks.restart_confirm": "",
|
||||
"unlocks.restart_text": "",
|
||||
"unlocks.restart_title": "",
|
||||
"unlocks.title": "",
|
||||
"unlocks.unlocks_at": "",
|
||||
"upgrades.ball_attract_ball.fullHelp": "",
|
||||
"upgrades.ball_attract_ball.help": "",
|
||||
"upgrades.ball_attract_ball.help_plural": "",
|
||||
"upgrades.ball_attract_ball.name": "",
|
||||
"upgrades.ball_repulse_ball.fullHelp": "",
|
||||
"upgrades.ball_repulse_ball.help": "",
|
||||
"upgrades.ball_repulse_ball.help_plural": "",
|
||||
"upgrades.ball_repulse_ball.name": "",
|
||||
"upgrades.base_combo.fullHelp": "",
|
||||
"upgrades.base_combo.help": "",
|
||||
"upgrades.base_combo.name": "",
|
||||
"upgrades.bigger_explosions.fullHelp": "",
|
||||
"upgrades.bigger_explosions.help": "",
|
||||
"upgrades.bigger_explosions.name": "",
|
||||
"upgrades.bigger_puck.fullHelp": "",
|
||||
"upgrades.bigger_puck.help": "",
|
||||
"upgrades.bigger_puck.name": "",
|
||||
"upgrades.coin_magnet.fullHelp": "",
|
||||
"upgrades.coin_magnet.help": "",
|
||||
"upgrades.coin_magnet.help_plural": "",
|
||||
"upgrades.coin_magnet.name": "",
|
||||
"upgrades.compound_interest.fullHelp": "",
|
||||
"upgrades.compound_interest.help": "",
|
||||
"upgrades.compound_interest.name": "",
|
||||
"upgrades.extra_levels.fullHelp": "",
|
||||
"upgrades.extra_levels.help": "",
|
||||
"upgrades.extra_levels.name": "",
|
||||
"upgrades.extra_life.fullHelp": "",
|
||||
"upgrades.extra_life.help": "",
|
||||
"upgrades.extra_life.help_plural": "",
|
||||
"upgrades.extra_life.name": "",
|
||||
"upgrades.hot_start.fullHelp": "",
|
||||
"upgrades.hot_start.help": "",
|
||||
"upgrades.hot_start.name": "",
|
||||
"upgrades.instant_upgrade.fullHelp": "",
|
||||
"upgrades.instant_upgrade.help": "",
|
||||
"upgrades.instant_upgrade.help_plural": "",
|
||||
"upgrades.instant_upgrade.name": "",
|
||||
"upgrades.left_is_lava.fullHelp": "",
|
||||
"upgrades.left_is_lava.help": "",
|
||||
"upgrades.left_is_lava.name": "",
|
||||
"upgrades.metamorphosis.fullHelp": "",
|
||||
"upgrades.metamorphosis.help": "",
|
||||
"upgrades.metamorphosis.name": "",
|
||||
"upgrades.multiball.fullHelp": "",
|
||||
"upgrades.multiball.help": "",
|
||||
"upgrades.multiball.name": "",
|
||||
"upgrades.one_more_choice.fullHelp": "",
|
||||
"upgrades.one_more_choice.help": "",
|
||||
"upgrades.one_more_choice.help_plural": "",
|
||||
"upgrades.one_more_choice.name": "",
|
||||
"upgrades.picky_eater.fullHelp": "",
|
||||
"upgrades.picky_eater.help": "",
|
||||
"upgrades.picky_eater.name": "",
|
||||
"upgrades.pierce.fullHelp": "",
|
||||
"upgrades.pierce.help": "",
|
||||
"upgrades.pierce.name": "",
|
||||
"upgrades.pierce_color.fullHelp": "",
|
||||
"upgrades.pierce_color.help": "",
|
||||
"upgrades.pierce_color.name": "",
|
||||
"upgrades.puck_repulse_ball.fullHelp": "",
|
||||
"upgrades.puck_repulse_ball.help": "",
|
||||
"upgrades.puck_repulse_ball.help_plural": "",
|
||||
"upgrades.puck_repulse_ball.name": "",
|
||||
"upgrades.respawn.fullHelp": "",
|
||||
"upgrades.respawn.help": "",
|
||||
"upgrades.respawn.help_plural": "",
|
||||
"upgrades.respawn.name": "",
|
||||
"upgrades.right_is_lava.fullHelp": "",
|
||||
"upgrades.right_is_lava.help": "",
|
||||
"upgrades.right_is_lava.name": "",
|
||||
"upgrades.sapper.fullHelp": "",
|
||||
"upgrades.sapper.help": "",
|
||||
"upgrades.sapper.help_plural": "",
|
||||
"upgrades.sapper.name": "",
|
||||
"upgrades.skip_last.fullHelp": "",
|
||||
"upgrades.skip_last.help": "",
|
||||
"upgrades.skip_last.name": "",
|
||||
"upgrades.slow_down.fullHelp": "",
|
||||
"upgrades.slow_down.help": "",
|
||||
"upgrades.slow_down.name": "",
|
||||
"upgrades.smaller_puck.fullHelp": "",
|
||||
"upgrades.smaller_puck.help": "",
|
||||
"upgrades.smaller_puck.help_plural": "",
|
||||
"upgrades.smaller_puck.name": "",
|
||||
"upgrades.soft_reset.fullHelp": "",
|
||||
"upgrades.soft_reset.help": "",
|
||||
"upgrades.soft_reset.name": "",
|
||||
"upgrades.streak_shots.fullHelp": "",
|
||||
"upgrades.streak_shots.help": "",
|
||||
"upgrades.streak_shots.name": "",
|
||||
"upgrades.sturdy_bricks.fullHelp": "",
|
||||
"upgrades.sturdy_bricks.help": "",
|
||||
"upgrades.sturdy_bricks.help_plural": "",
|
||||
"upgrades.sturdy_bricks.name": "",
|
||||
"upgrades.telekinesis.fullHelp": "",
|
||||
"upgrades.telekinesis.help": "",
|
||||
"upgrades.telekinesis.help_plural": "",
|
||||
"upgrades.telekinesis.name": "",
|
||||
"upgrades.top_is_lava.fullHelp": "",
|
||||
"upgrades.top_is_lava.help": "",
|
||||
"upgrades.top_is_lava.name": "",
|
||||
"upgrades.viscosity.fullHelp": "",
|
||||
"upgrades.viscosity.help": "",
|
||||
"upgrades.viscosity.name": "",
|
||||
"upgrades.wind.fullHelp": "",
|
||||
"upgrades.wind.help": "",
|
||||
"upgrades.wind.help_plural": "",
|
||||
"upgrades.wind.name": ""
|
||||
}
|
29
src/i18n/i18n.ts
Normal file
29
src/i18n/i18n.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import fr from './fr.json'
|
||||
import en from './en.json'
|
||||
import {getSettingValue} from "../settings";
|
||||
|
||||
type translationKeys = keyof typeof en
|
||||
type translation= { [key in translationKeys] : string }
|
||||
const languages:Record<string, translation>= {fr,en}
|
||||
|
||||
export function t(key: translationKeys, params: {[key:string]:any} = {}):string {
|
||||
const lang = getSettingValue('lang',getFirstBrowserLanguage())
|
||||
let template=languages[lang]?.[key] || languages.en[key]
|
||||
for(let key in params){
|
||||
template=template.split('{{'+key+'}}').join(`${params[key]}`)
|
||||
}
|
||||
return template
|
||||
}
|
||||
|
||||
function getFirstBrowserLanguage() {
|
||||
const preferred_languages = [
|
||||
...navigator.languages,
|
||||
navigator.language,
|
||||
'en'
|
||||
].filter(i => i)
|
||||
.map(i => i.slice(0, 2).toLowerCase())
|
||||
const supported = Object.keys(languages)
|
||||
|
||||
return preferred_languages.find(k=>supported.includes(k)) || 'en'
|
||||
|
||||
};
|
|
@ -1,17 +1,19 @@
|
|||
import { fitSize } from "./game";
|
||||
import {fitSize} from "./game";
|
||||
import {t} from "./i18n/i18n";
|
||||
import {getSettingValue, setSettingValue} from "./settings";
|
||||
|
||||
export const options = {
|
||||
sound: {
|
||||
default: true,
|
||||
name: `Game sounds`,
|
||||
help: `Can slow down some phones.`,
|
||||
name: t('main_menu.sounds'),
|
||||
help: t('main_menu.sounds_help'),
|
||||
afterChange: () => {},
|
||||
disabled: () => false,
|
||||
},
|
||||
"mobile-mode": {
|
||||
default: window.innerHeight > window.innerWidth,
|
||||
name: `Mobile mode`,
|
||||
help: `Leaves space for your thumb.`,
|
||||
name: t('main_menu.mobile'),
|
||||
help: t('main_menu.mobile_help'),
|
||||
afterChange() {
|
||||
fitSize();
|
||||
},
|
||||
|
@ -19,29 +21,30 @@ export const options = {
|
|||
},
|
||||
basic: {
|
||||
default: false,
|
||||
name: `Basic graphics`,
|
||||
help: `Better performance on older devices.`,
|
||||
name: t('main_menu.basic'),
|
||||
help: t('main_menu.basic_help'),
|
||||
afterChange: () => {},
|
||||
disabled: () => false,
|
||||
},
|
||||
pointerLock: {
|
||||
default: false,
|
||||
name: `Mouse pointer lock`,
|
||||
help: `Locks and hides the mouse cursor.`,
|
||||
name: t('main_menu.pointer_lock'),
|
||||
help: t('main_menu.pointer_lock_help'),
|
||||
afterChange: () => {},
|
||||
disabled: () => !document.body.requestPointerLock,
|
||||
},
|
||||
easy: {
|
||||
default: false,
|
||||
name: `Kids mode`,
|
||||
help: `Start future runs with "slower ball".`,
|
||||
name: t('main_menu.kid'),
|
||||
help: t('main_menu.kid_help'),
|
||||
afterChange: () => {},
|
||||
disabled: () => false,
|
||||
}, // Could not get the sharing to work without loading androidx and all the modern android things so for now i'll just disable sharing in the android app
|
||||
},
|
||||
// Could not get the sharing to work without loading androidx and all the modern android things so for now I'll just disable sharing in the android app
|
||||
record: {
|
||||
default: false,
|
||||
name: `Record gameplay videos`,
|
||||
help: `Get a video of each level.`,
|
||||
name: t('main_menu.record'),
|
||||
help: t('main_menu.record_help'),
|
||||
afterChange: () => {},
|
||||
disabled() {
|
||||
return window.location.search.includes("isInWebView=true");
|
||||
|
@ -57,3 +60,12 @@ export type OptionDef = {
|
|||
afterChange: () => void;
|
||||
};
|
||||
export type OptionId = keyof typeof options;
|
||||
|
||||
export function isOptionOn(key: OptionId) {
|
||||
return getSettingValue(key, options[key]?.default)
|
||||
}
|
||||
|
||||
export function toggleOption(key: OptionId) {
|
||||
setSettingValue(key, !isOptionOn(key))
|
||||
options[key].afterChange();
|
||||
}
|
|
@ -1,29 +1,25 @@
|
|||
import {t} from "./i18n/i18n";
|
||||
|
||||
export const rawUpgrades = [
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
giftable: false,
|
||||
id: "extra_life",
|
||||
name: "+1 life",
|
||||
max: 7,
|
||||
help: (lvl: number) =>
|
||||
`The ball will bounce on the bottom ${lvl} time${lvl > 1 ? "s" : ""} before being lost.`,
|
||||
fullHelp: `Normally, you have one ball per run, and the run is over as soon as you drop it.
|
||||
This perk adds a white bar at the bottom of the screen that will save a ball once, and break in the process.
|
||||
You'll loose one level of that perk every time a ball bounces at the bottom of the screen. `,
|
||||
name: t('upgrades.extra_life.name'),
|
||||
help: (lvl: number) => lvl === 1 ? t('upgrades.extra_life.help'): t('upgrades.extra_life.help_plural',{lvl}),
|
||||
fullHelp: t('upgrades.extra_life.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
id: "streak_shots",
|
||||
giftable: true,
|
||||
name: "Single puck hit streak",
|
||||
max: 1,
|
||||
help: (lvl: number) => `More coins if you break many bricks at once`,
|
||||
fullHelp: `Every time you break a brick, your combo (number of coins per bricks) increases by one. However, as soon as the ball touches your puck,
|
||||
the combo is reset to its default value, and you'll just get one coin per brick. So you should try to hit many bricks in one go for more score.
|
||||
Once your combo rises above the base value, your puck will become red to remind you that it will destroy your combo to touch it with the ball.
|
||||
This can stack with other combo related perks, the combo will rise faster but reset more easily as any of the conditions is enough to reset it. `,
|
||||
name: t('upgrades.streak_shots.name'),
|
||||
help: (lvl: number) => t('upgrades.streak_shots.help',{lvl}) ,
|
||||
fullHelp: t('upgrades.streak_shots.fullHelp'),
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -31,389 +27,329 @@ export const rawUpgrades = [
|
|||
threshold: 0,
|
||||
id: "base_combo",
|
||||
giftable: true,
|
||||
name: "+3 base combo",
|
||||
max: 7,
|
||||
help: (lvl: number) => `Every brick drops at least ${1 + lvl * 3} coins.`,
|
||||
fullHelp: `Your combo (number of coins per bricks) normally starts at 1 at the beginning of the level, and resets to one when you bounce around without hitting anything.
|
||||
With this perk, the combo starts 3 points higher, so you'll always get at least 4 coins per brick. Whenever your combo reset, it will go back to 4 and not 1.
|
||||
Your ball will glitter a bit to indicate that its combo is higher than one.`,
|
||||
name: t('upgrades.base_combo.name'),
|
||||
help: (lvl: number) => t('upgrades.base_combo.help',{coins:1 + lvl * 3}),
|
||||
fullHelp: t('upgrades.base_combo.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
giftable: false,
|
||||
id: "slow_down",
|
||||
name: "Slower ball",
|
||||
max: 2,
|
||||
help: (lvl: number) => `Ball moves ${lvl > 1 ? "even" : ""} more slowly.`,
|
||||
|
||||
fullHelp: `The ball starts relatively slow, but every level of your run it will start a bit faster, and it will also accelerate if you spend a lot of time in one level. This perk makes it
|
||||
more manageable. You can get it at the start every time by enabling kid mode in the menu.`,
|
||||
name: t('upgrades.slow_down.name'),
|
||||
help: () => t('upgrades.slow_down.help' ),
|
||||
fullHelp: t('upgrades.slow_down.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
giftable: false,
|
||||
id: "bigger_puck",
|
||||
name: "Bigger puck",
|
||||
max: 2,
|
||||
help: (lvl: number) => `Easily catch ${lvl > 1 ? "even" : ""} more coins.`,
|
||||
fullHelp: `A bigger puck makes it easier to never miss the ball and to catch more coins, and also to precisely angle the bounces (the ball's angle only depends on where it hits the puck).
|
||||
However, a large puck is harder to use around the sides of the level, and will make it sometimes unavoidable to miss (not hit anything) which comes with downsides. `,
|
||||
name: t('upgrades.bigger_puck.name'),
|
||||
help: () => t('upgrades.bigger_puck.help' ),
|
||||
fullHelp: t('upgrades.bigger_puck.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
giftable: false,
|
||||
id: "viscosity",
|
||||
name: "Viscosity",
|
||||
max: 3,
|
||||
help: (lvl: number) => `${lvl > 1 ? "Even slower" : "Slower"} coins fall.`,
|
||||
|
||||
fullHelp: `Coins normally accelerate with gravity and explosions to pretty high speeds. This perk constantly makes them slow down, as if they were in some sort of viscous liquid.
|
||||
This makes catching them easier, and combines nicely with perks that influence the coin's movement. `,
|
||||
name: t('upgrades.viscosity.name'),
|
||||
help: () => t('upgrades.viscosity.help' ),
|
||||
fullHelp: t('upgrades.viscosity.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
id: "left_is_lava",
|
||||
giftable: true,
|
||||
name: "Avoid left side",
|
||||
max: 1,
|
||||
help: (lvl: number) => `More coins if you don't touch the left side.`,
|
||||
|
||||
fullHelp: `Whenever you break a brick, your combo will increase by one, so you'll get one more coin from all the next bricks you break.
|
||||
However, your combo will reset as soon as your ball hits the left side .
|
||||
As soon as your combo rises, the left side becomes red to remind you that you should avoid hitting them.
|
||||
The effect stacks with other combo perks, combo rises faster with more upgrades but will also reset if any
|
||||
of the reset conditions are met.`,
|
||||
name: t('upgrades.left_is_lava.name'),
|
||||
help: () => t('upgrades.left_is_lava.help' ),
|
||||
fullHelp: t('upgrades.left_is_lava.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
id: "right_is_lava",
|
||||
giftable: true,
|
||||
name: "Avoid right side",
|
||||
max: 1,
|
||||
help: (lvl: number) => `More coins if you don't touch the right side.`,
|
||||
name: t('upgrades.right_is_lava.name'),
|
||||
help: () => t('upgrades.right_is_lava.help' ),
|
||||
fullHelp: t('upgrades.right_is_lava.fullHelp'),
|
||||
|
||||
fullHelp: `Whenever you break a brick, your combo will increase by one, so you'll get one more coin from all the next bricks you break.
|
||||
However, your combo will reset as soon as your ball hits the right side .
|
||||
As soon as your combo rises, the right side becomes red to remind you that you should avoid hitting them.
|
||||
The effect stacks with other combo perks, combo rises faster with more upgrades but will also reset if any
|
||||
of the reset conditions are met.`,
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
id: "top_is_lava",
|
||||
giftable: true,
|
||||
name: "Sky is the limit",
|
||||
max: 1,
|
||||
help: (lvl: number) => `More coins if you don't touch the top.`,
|
||||
fullHelp: `Whenever you break a brick, your combo will increase by one. However, your combo will reset as soon as your ball hit the top of the screen.
|
||||
When your combo is above the minimum, a red bar will appear at the top to remind you that you should avoid hitting it.
|
||||
The effect stacks with other combo perks.`,
|
||||
name: t('upgrades.top_is_lava.name'),
|
||||
help: () => t('upgrades.top_is_lava.help' ),
|
||||
fullHelp: t('upgrades.top_is_lava.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 0,
|
||||
giftable: false,
|
||||
id: "skip_last",
|
||||
name: "Easy Cleanup",
|
||||
max: 7,
|
||||
help: (lvl: number) =>
|
||||
`The last ${lvl > 1 ? lvl + " bricks" : "brick"} left will self-destruct.`,
|
||||
fullHelp: `You need to break all bricks to go to the next level. However, it can be hard to get the last ones.
|
||||
Clearing a level early brings extra choices when upgrading. Never missing the bricks is also very beneficial.
|
||||
So if you find it difficult to break the last bricks, getting this perk a few time can help.`,
|
||||
name: t('upgrades.skip_last.name'),
|
||||
help: (lvl: number) => t('upgrades.skip_last.help', {lvl} ),
|
||||
fullHelp: t('upgrades.skip_last.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 500,
|
||||
id: "telekinesis",
|
||||
giftable: true,
|
||||
name: "Puck controls ball",
|
||||
max: 2,
|
||||
help: (lvl: number) =>
|
||||
lvl == 1
|
||||
? `Control the ball's trajectory.`
|
||||
: `Stronger effect on the ball`,
|
||||
fullHelp: `Right after the ball hits your puck, you'll be able to direct it left and right by moving your puck.
|
||||
The effect stops when the ball hits a brick and resets the next time it touches the puck. It also does nothing when the ball is going downward after bouncing at the top. `,
|
||||
name: t('upgrades.telekinesis.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.telekinesis.help'): t('upgrades.telekinesis.help_plural'),
|
||||
fullHelp: t('upgrades.telekinesis.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 1000,
|
||||
giftable: false,
|
||||
id: "coin_magnet",
|
||||
name: "Coins magnet",
|
||||
max: 3,
|
||||
help: (lvl: number) =>
|
||||
lvl == 1 ? `Puck attracts coins.` : `Stronger effect on the coins`,
|
||||
|
||||
fullHelp: `Directs the coins to the puck. The effect is stronger if the coin is close to it already. Catching 90% or 100% of coins bring special bonuses in the game.
|
||||
Another way to catch more coins is to hit bricks from the bottom. The ball's speed and direction impacts the spawned coin's velocity. `,
|
||||
name: t('upgrades.coin_magnet.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.coin_magnet.help'): t('upgrades.coin_magnet.help_plural'),
|
||||
fullHelp: t('upgrades.coin_magnet.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 1500,
|
||||
id: "multiball",
|
||||
giftable: true,
|
||||
name: "+1 ball",
|
||||
max: 6,
|
||||
help: (lvl: number) => `Start every levels with ${lvl + 1} balls.`,
|
||||
fullHelp: `As soon as you drop the ball in Breakout 71, you loose. With this perk, you get two balls, and so you can afford to lose one.
|
||||
The lost balls come back on the next level. Having more than one balls makes some further perks available, and of course clears the level faster.`,
|
||||
name: t('upgrades.multiball.name'),
|
||||
help: (lvl: number) => t('upgrades.multiball.help',{count:lvl+1}) ,
|
||||
fullHelp: t('upgrades.multiball.fullHelp'),
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 2000,
|
||||
giftable: false,
|
||||
id: "smaller_puck",
|
||||
name: "Smaller puck",
|
||||
max: 2,
|
||||
help: (lvl: number) =>
|
||||
lvl == 1
|
||||
? `Also gives +5 base combo.`
|
||||
: `Even smaller puck and higher base combo`,
|
||||
fullHelp: `This makes the puck smaller, which in theory makes some corner shots easier, but really just raises the difficulty.
|
||||
That's why you also get a nice bonus of +5 coins per brick for all bricks you'll break after picking this. `,
|
||||
name: t('upgrades.smaller_puck.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.smaller_puck.help'): t('upgrades.smaller_puck.help_plural'),
|
||||
fullHelp: t('upgrades.smaller_puck.fullHelp'),
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 3000,
|
||||
id: "pierce",
|
||||
giftable: true,
|
||||
name: "Piercing",
|
||||
max: 3,
|
||||
help: (lvl: number) =>
|
||||
`Ball pierces ${3 * lvl} bricks after a puck bounce.`,
|
||||
fullHelp: `The ball normally bounces as soon as it touches something. With this perk, it will continue its trajectory for up to 3 bricks broken.
|
||||
After that, it will bounce on the 4th brick, and you'll need to touch the puck to reset the counter. This combines particularly well with Sapper. `,
|
||||
name: t('upgrades.pierce.name'),
|
||||
help: (lvl: number) => t('upgrades.pierce.help',{count:3 * lvl}) ,
|
||||
fullHelp: t('upgrades.pierce.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 4000,
|
||||
id: "picky_eater",
|
||||
giftable: true,
|
||||
name: "Picky eater",
|
||||
max: 1,
|
||||
help: (lvl: number) => `More coins if you break bricks color by color.`,
|
||||
name: t('upgrades.picky_eater.name'),
|
||||
help: (lvl: number) => t('upgrades.picky_eater.help') ,
|
||||
fullHelp: t('upgrades.picky_eater.fullHelp'),
|
||||
|
||||
fullHelp: `Whenever you break a brick the same color as your ball, your combo increases by one.
|
||||
If it's a different color, the ball takes that new color, but the combo resets.
|
||||
The bricks with the right color will get a white border.
|
||||
Once you get a combo higher than your minimum, the bricks of the wrong color will get a red halo.
|
||||
If you have more than one ball, they all change color whenever one of them hits a brick.
|
||||
|
||||
`,
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 5000,
|
||||
giftable: false,
|
||||
id: "metamorphosis",
|
||||
name: "Stain",
|
||||
max: 1,
|
||||
help: (lvl: number) => `Coins color the bricks they touch.`,
|
||||
name: t('upgrades.metamorphosis.name'),
|
||||
help: (lvl: number) => t('upgrades.metamorphosis.help'),
|
||||
fullHelp: t('upgrades.metamorphosis.fullHelp'),
|
||||
|
||||
|
||||
fullHelp: `With this perk, coins will be of the color of the brick they come from, and will color the first brick they touch in the same color. Coins spawn with the speed
|
||||
of the ball that broke them, which means you can aim a bit in the direction of the bricks you want to "paint".
|
||||
`,
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 6000,
|
||||
id: "compound_interest",
|
||||
giftable: true,
|
||||
name: "Compound interest",
|
||||
max: 1,
|
||||
help: () => `+1 combo per brick broken, resets on coin lost`,
|
||||
|
||||
fullHelp: `Your combo will grow by one every time you break a brick, spawning more and more coin with every brick you break. Be sure however to catch every one of those coins
|
||||
with your puck, as any lost coin will decrease your combo by one point. One your combo is above the minimum, the bottom of the play area will
|
||||
have a red line to remind you that coins should not go there. This perk combines with other combo perks, the combo will rise faster but reset more easily.
|
||||
`,
|
||||
name: t('upgrades.compound_interest.name'),
|
||||
help: (lvl: number) => t('upgrades.compound_interest.help') ,
|
||||
fullHelp: t('upgrades.compound_interest.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 7000,
|
||||
id: "hot_start",
|
||||
giftable: true,
|
||||
name: "Hot start",
|
||||
max: 3,
|
||||
help: (lvl: number) =>
|
||||
`Start at combo ${lvl * 15 + 1}, -${lvl} combo per second`,
|
||||
fullHelp: `At the start of every level, your combo will start at +15 points, but then every second it will be decreased by one. This means the first 15 seconds in a level will spawn
|
||||
many more coins than the following ones, and you should make sure that you clear the level quickly. The effect stacks with other combo related perks, so you might be able to raise
|
||||
the combo after the 15s timeout, but it will keep ticking down. Every time you take the perk again, the effect will be more dramatic.
|
||||
`,
|
||||
name: t('upgrades.hot_start.name'),
|
||||
help: (lvl: number) => t('upgrades.hot_start.help',{
|
||||
start:lvl * 15 + 1,
|
||||
lvl
|
||||
}),
|
||||
fullHelp: t('upgrades.hot_start.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 9000,
|
||||
id: "sapper",
|
||||
giftable: true,
|
||||
name: "Sapper",
|
||||
max: 7,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1
|
||||
? "The first brick broken becomes a bomb."
|
||||
: `The first ${lvl} bricks broken become bombs.`,
|
||||
fullHelp: `Instead of just disappearing, the first brick you break will be replaced by a bomb brick. Bouncing the ball on the puck re-arms the effect. "Piercing" will instantly
|
||||
detonate the bomb that was just placed. Leveling-up this perk will allow you to place more bombs. Remember that bombs impact the velocity of nearby coins, so too many explosions
|
||||
could make it hard to catch the fruits of your hard work.
|
||||
`,
|
||||
name: t('upgrades.sapper.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.sapper.help'): t('upgrades.sapper.help_plural',{lvl}),
|
||||
fullHelp: t('upgrades.sapper.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 11000,
|
||||
id: "bigger_explosions",
|
||||
name: "Kaboom",
|
||||
max: 1,
|
||||
giftable: false,
|
||||
|
||||
help: (lvl: number) => "Bigger explosions",
|
||||
|
||||
fullHelp: `The default explosion clears a 3x3 square, with this it becomes a 5x5 square, and the blowback on the coins is also significantly stronger. `,
|
||||
max: 1,
|
||||
name: t('upgrades.bigger_explosions.name'),
|
||||
help: (lvl: number) => t('upgrades.bigger_explosions.help'),
|
||||
fullHelp: t('upgrades.bigger_explosions.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 13000,
|
||||
giftable: false,
|
||||
id: "extra_levels",
|
||||
name: "+1 level",
|
||||
max: 3,
|
||||
help: (lvl: number) => `Play ${lvl + 7} levels instead of 7`,
|
||||
fullHelp: `The default run can last a max of 7 levels, after which the game is over and whatever score you reached is your run score.
|
||||
Each level of this perk lets you go one level higher. The last levels are often the ones where you make the most score, so the difference can be dramatic.`,
|
||||
name: t('upgrades.extra_levels.name'),
|
||||
help: (lvl: number) => t('upgrades.extra_levels.help',{count:lvl + 7}) ,
|
||||
fullHelp: t('upgrades.extra_levels.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 15000,
|
||||
giftable: false,
|
||||
id: "pierce_color",
|
||||
name: "Color pierce",
|
||||
max: 1,
|
||||
help: (lvl: number) => `Balls pierce bricks of their color.`,
|
||||
fullHelp: `Whenever a ball hits a brick of the same color, it will just go through unimpeded.
|
||||
Once it reaches a brick of a different color, it will break it, take its color and bounce.`,
|
||||
name: t('upgrades.pierce_color.name'),
|
||||
help: (lvl: number) => t('upgrades.pierce_color.help') ,
|
||||
fullHelp: t('upgrades.pierce_color.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 18000,
|
||||
giftable: false,
|
||||
id: "soft_reset",
|
||||
name: "Soft reset",
|
||||
max: 2,
|
||||
help: (lvl: number) =>
|
||||
`Combo grows ${lvl > 1 ? "even" : ""} slower but resets less.`,
|
||||
fullHelp: `The combo normally climbs every time you break a brick. This will sometimes cancel that climb, but also limit the impact of a combo reset.`,
|
||||
name: t('upgrades.soft_reset.name'),
|
||||
help: (lvl: number) => t('upgrades.soft_reset.help'),
|
||||
fullHelp: t('upgrades.soft_reset.fullHelp'),
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
requires: "multiball",
|
||||
threshold: 21000,
|
||||
giftable: false,
|
||||
id: "ball_repulse_ball",
|
||||
name: "Personal space",
|
||||
max: 3,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1 ? `Balls repulse balls.` : "Stronger repulsion force",
|
||||
name: t('upgrades.ball_repulse_ball.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.ball_repulse_ball.help'): t('upgrades.ball_repulse_ball.help_plural'),
|
||||
fullHelp: t('upgrades.ball_repulse_ball.fullHelp'),
|
||||
|
||||
|
||||
fullHelp: `Balls that are less than half a screen width away will start repulsing each other. The repulsion force is stronger if they are close to each other.
|
||||
Particles will jet out to symbolize this force being applied. This perk is only offered if you have more than one ball already.`,
|
||||
},
|
||||
{
|
||||
requires: "multiball",
|
||||
threshold: 25000,
|
||||
giftable: false,
|
||||
id: "ball_attract_ball",
|
||||
name: "Gravity",
|
||||
max: 3,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1 ? `Balls attract balls.` : "Stronger attraction force",
|
||||
|
||||
fullHelp: `Balls that are more than half a screen width away will start attracting each other. The attraction force is stronger when they are furthest away from each other.
|
||||
Rainbow particles will fly to symbolize the attraction force. This perk is only offered if you have more than one ball already.`,
|
||||
name: t('upgrades.ball_attract_ball.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.ball_attract_ball.help'): t('upgrades.ball_attract_ball.help_plural'),
|
||||
fullHelp: t('upgrades.ball_attract_ball.fullHelp'),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 30000,
|
||||
giftable: false,
|
||||
id: "puck_repulse_ball",
|
||||
name: "Soft landing",
|
||||
max: 2,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1 ? `Puck repulses balls.` : "Stronger repulsion force",
|
||||
fullHelp: `When a ball gets close to the puck, it will start slowing down, and even potentially bouncing without touching the puck.`,
|
||||
name: t('upgrades.puck_repulse_ball.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.puck_repulse_ball.help'): t('upgrades.puck_repulse_ball.help_plural'),
|
||||
fullHelp: t('upgrades.puck_repulse_ball.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 35000,
|
||||
giftable: false,
|
||||
id: "wind",
|
||||
name: "Wind",
|
||||
max: 3,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1 ? `Puck position creates wind.` : "Stronger wind force",
|
||||
fullHelp: `The wind depends on where your puck is, if it's in the center of the screen nothing happens, if it's on the left it will blow leftwise, if it's on the right of the screen
|
||||
then it will blow rightwise. The wind affects both the balls and coins.`,
|
||||
name: t('upgrades.wind.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.wind.help'): t('upgrades.wind.help_plural'),
|
||||
fullHelp: t('upgrades.wind.fullHelp'),
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 40000,
|
||||
giftable: false,
|
||||
id: "sturdy_bricks",
|
||||
name: "Sturdy bricks",
|
||||
max: 4,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1
|
||||
? `Bricks sometimes resist hits but drop more coins.`
|
||||
: "Bricks resist more and drop more coins",
|
||||
fullHelp: `With level one of this perk, the ball has a 20% chance to bounce harmlessly on bricks,
|
||||
but generates 10% more coins when it does break one.
|
||||
This +10% is not shown in the combo number. At level 4 the ball has 80% chance of bouncing and brings 40% more coins.`,
|
||||
name: t('upgrades.telekinesis.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.telekinesis.help'): t('upgrades.telekinesis.help_plural'),
|
||||
fullHelp: t('upgrades.telekinesis.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 45000,
|
||||
giftable: false,
|
||||
id: "respawn",
|
||||
name: "Respawn",
|
||||
max: 4,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1
|
||||
? `The first brick hit of two+ will respawn.`
|
||||
: "More bricks can respawn",
|
||||
fullHelp: `After breaking two or more bricks, when the ball hits the puck, the first brick will be put back in place, provided that space is free and the brick wasn't a bomb.
|
||||
Some particle effect will let you know where bricks will appear. Levelling this up lets you respawn up to 4 bricks at a time, but there should always be at least one destroyed.
|
||||
`,
|
||||
name: t('upgrades.respawn.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.respawn.help'): t('upgrades.respawn.help_plural'),
|
||||
fullHelp: t('upgrades.respawn.fullHelp'),
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 50000,
|
||||
giftable: false,
|
||||
id: "one_more_choice",
|
||||
name: "+1 choice until run end",
|
||||
max: 3,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1
|
||||
? `Further level ups will offer one more option in the list.`
|
||||
: "Even more options",
|
||||
fullHelp: `Every upgrade menu will have one more option.
|
||||
Doesn't increase the number of upgrades you can pick.
|
||||
`,
|
||||
name: t('upgrades.one_more_choice.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.one_more_choice.help'): t('upgrades.one_more_choice.help_plural'),
|
||||
fullHelp: t('upgrades.one_more_choice.fullHelp'),
|
||||
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
threshold: 55000,
|
||||
giftable: false,
|
||||
id: "instant_upgrade",
|
||||
name: "+2 upgrades now",
|
||||
max: 2,
|
||||
help: (lvl: number) =>
|
||||
lvl === 1 ? `-1 choice until run end.` : "Even fewer options",
|
||||
fullHelp: `Immediately pick two upgrades, so that you get one free one and one to repay the one used to get this perk. Every further menu to pick upgrades will have fewer options to choose from.`,
|
||||
name: t('upgrades.instant_upgrade.name'),
|
||||
help: (lvl: number) => lvl == 1 ? t('upgrades.instant_upgrade.help'): t('upgrades.instant_upgrade.help_plural'),
|
||||
fullHelp: t('upgrades.instant_upgrade.fullHelp'),
|
||||
|
||||
},
|
||||
] as const;
|
||||
|
|
25
src/settings.ts
Normal file
25
src/settings.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Settings
|
||||
|
||||
let cachedSettings: { [key: string]: unknown } = {};
|
||||
|
||||
export function getSettingValue<T>(key: string, defaultValue: T) {
|
||||
if (typeof cachedSettings[key] == "undefined") {
|
||||
try {
|
||||
const ls = localStorage.getItem("breakout-settings-enable-" + key);
|
||||
if (ls) cachedSettings[key] = JSON.parse(ls) as T;
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
return cachedSettings[key] as T ?? defaultValue;
|
||||
}
|
||||
|
||||
export function setSettingValue<T>(key: string, value: T) {
|
||||
cachedSettings[key] = value
|
||||
try {
|
||||
localStorage.setItem("breakout-settings-enable-" + key, JSON.stringify(value));
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,15 @@
|
|||
import { gameState, isSettingOn } from "./game";
|
||||
import { gameState } from "./game";
|
||||
|
||||
import {isOptionOn} from "./options";
|
||||
|
||||
export const sounds = {
|
||||
wallBeep: (pan: number) => {
|
||||
if (!isSettingOn("sound")) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
createSingleBounceSound(800, pixelsToPan(pan));
|
||||
},
|
||||
|
||||
comboIncreaseMaybe: (combo: number, x: number, volume: number) => {
|
||||
if (!isSettingOn("sound")) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
let delta = 0;
|
||||
if (!isNaN(lastComboPlayed)) {
|
||||
if (lastComboPlayed < combo) delta = 1;
|
||||
|
@ -18,24 +20,24 @@ export const sounds = {
|
|||
},
|
||||
|
||||
comboDecrease() {
|
||||
if (!isSettingOn("sound")) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
playShepard(-1, 0.5, 0.5);
|
||||
},
|
||||
coinBounce: (pan: number, volume: number) => {
|
||||
if (!isSettingOn("sound")) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
createSingleBounceSound(1200, pixelsToPan(pan), volume, 0.1, "triangle");
|
||||
},
|
||||
explode: (pan: number) => {
|
||||
if (!isSettingOn("sound")) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
createExplosionSound(pixelsToPan(pan));
|
||||
},
|
||||
lifeLost(pan: number) {
|
||||
if (!isSettingOn("sound")) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
createShatteredGlassSound(pixelsToPan(pan));
|
||||
},
|
||||
|
||||
coinCatch(pan: number) {
|
||||
if (!isSettingOn("sound")) return;
|
||||
if (!isOptionOn("sound")) return;
|
||||
createSingleBounceSound(900, pixelsToPan(pan), 0.8, 0.1, "triangle");
|
||||
},
|
||||
colorChange(pan: number, volume: number) {
|
||||
|
@ -50,7 +52,7 @@ let audioContext: AudioContext,
|
|||
|
||||
export function getAudioContext() {
|
||||
if (!audioContext) {
|
||||
if (!isSettingOn("sound")) return null;
|
||||
if (!isOptionOn("sound")) return null;
|
||||
audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
||||
audioRecordingTrack = audioContext.createMediaStreamDestination();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue