mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-21 20:46:14 -04:00
Added side kick, implosion, corner shot
This commit is contained in:
parent
f49da76667
commit
f3790b3334
10 changed files with 363 additions and 38 deletions
|
@ -72,13 +72,14 @@ There's also an easy mode for kids (slower ball).
|
|||
|
||||
# New perks ideas
|
||||
|
||||
- [colin] Side-kick - briser un bloc par le côté génère plus de coins que par le dessus ou le dessous.
|
||||
- [colin] Corner shot - the puck can go beyond the screen limits so as to make corner shots easier.
|
||||
- [colin] Mental charge - the puck is divided into two smaller pucks, then 3 smaller ones at lvl 2
|
||||
- [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
|
||||
- [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
|
||||
- [colin] Combos extrêmes: lvl2 pour tous les combos, qui fait que le combo rapporte doubl 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
|
||||
- [colin] Juggle - au début du niveau, chaque balle est lancée l'une après au lieu de toutes à la fois
|
||||
- [colin] Side-kick - briser un bloc par le côté génère plus de coins que par le dessus ou le dessous.
|
||||
- [colin] Capital - les vies non perdues à la fin du niveau rapportent un bonus de points
|
||||
- bricks are invisible, but ..
|
||||
- second puck (symmetric to the first one)
|
||||
|
|
80
dist/index.html
vendored
80
dist/index.html
vendored
File diff suppressed because one or more lines are too long
|
@ -996,5 +996,26 @@
|
|||
"bricks": "__y___y__y__y_y__y_y__t__y____ttt_____tWWWt___tWWgWWt_tttWWWttt__________________",
|
||||
"svg": null,
|
||||
"color": ""
|
||||
},
|
||||
{
|
||||
"name": "icon:side_kick",
|
||||
"size": 8,
|
||||
"bricks": "_WW__y_yWWWWy_y_WWWW_y_y_WW_y_y_r_r______r_r____r_r______r_r____",
|
||||
"svg": null,
|
||||
"color": ""
|
||||
},
|
||||
{
|
||||
"name": "icon:implosions",
|
||||
"size": 8,
|
||||
"bricks": "y______W__ryW_W__yr_WW____r_WWWy_WWW_rr___WW_rrryW_Wy___W_____y_",
|
||||
"svg": null,
|
||||
"color": ""
|
||||
},
|
||||
{
|
||||
"name": "icon:corner_shot",
|
||||
"size": 9,
|
||||
"bricks": "___W____y___W_y______W___y____W_y______W___y____W______W_W_WWW_WW_W_WWWWWW_W_WWWW",
|
||||
"svg": null,
|
||||
"color": ""
|
||||
}
|
||||
]
|
|
@ -992,6 +992,7 @@ restart(
|
|||
telekinesis: 2,
|
||||
yoyo: 2,
|
||||
metamorphosis: 1,
|
||||
implosions:1
|
||||
},
|
||||
}
|
||||
: {},
|
||||
|
|
|
@ -149,24 +149,16 @@ export function normalizeGameState(gameState: GameState) {
|
|||
(gameState.gameZoneWidth / 12) *
|
||||
(3 - gameState.perks.smaller_puck + gameState.perks.bigger_puck);
|
||||
|
||||
if (
|
||||
gameState.puckPosition <
|
||||
gameState.offsetXRoundedDown + gameState.puckWidth / 2
|
||||
) {
|
||||
gameState.puckPosition =
|
||||
gameState.offsetXRoundedDown + gameState.puckWidth / 2;
|
||||
}
|
||||
if (
|
||||
gameState.puckPosition >
|
||||
gameState.offsetXRoundedDown +
|
||||
let minX = gameState.perks.corner_shot && gameState.levelTime? gameState.offsetXRoundedDown - gameState.puckWidth / 2 : gameState.offsetXRoundedDown + gameState.puckWidth / 2
|
||||
|
||||
let maxX = gameState.perks.corner_shot && gameState.levelTime? gameState.offsetXRoundedDown +
|
||||
gameState.gameZoneWidthRoundedUp +
|
||||
gameState.puckWidth / 2 : gameState.offsetXRoundedDown +
|
||||
gameState.gameZoneWidthRoundedUp -
|
||||
gameState.puckWidth / 2
|
||||
) {
|
||||
gameState.puckPosition =
|
||||
gameState.offsetXRoundedDown +
|
||||
gameState.gameZoneWidthRoundedUp -
|
||||
gameState.puckWidth / 2;
|
||||
}
|
||||
|
||||
gameState.puckPosition = clamp(gameState.puckPosition,minX,maxX)
|
||||
|
||||
if (gameState.ballStickToPuck) {
|
||||
putBallsAtPuck(gameState);
|
||||
}
|
||||
|
@ -248,6 +240,33 @@ export function spawnExplosion(
|
|||
);
|
||||
}
|
||||
}
|
||||
export function spawnImplosion(
|
||||
gameState: GameState,
|
||||
count: number,
|
||||
x: number,
|
||||
y: number,
|
||||
color: string,
|
||||
) {
|
||||
if (!!isOptionOn("basic")) return;
|
||||
|
||||
if (liveCount(gameState.particles) > getCurrentMaxParticles()) {
|
||||
// Avoid freezing when lots of explosion happen at once
|
||||
count = 1;
|
||||
}
|
||||
for (let i = 0; i < count; i++) {
|
||||
const dx=((Math.random() - 0.5) * gameState.brickWidth) / 2
|
||||
const dy=((Math.random() - 0.5) * gameState.brickWidth) / 2
|
||||
makeParticle(
|
||||
gameState,
|
||||
x -dx*10 ,
|
||||
y -dy*10,
|
||||
dx,
|
||||
dy,
|
||||
color,
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function explosionAt(
|
||||
gameState: GameState,
|
||||
|
@ -275,17 +294,27 @@ export function explosionAt(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
const factor = gameState.perks.implosions ? -1:1
|
||||
// Blow nearby coins
|
||||
forEachLiveOne(gameState.coins, (c) => {
|
||||
const dx = c.x - x;
|
||||
const dy = c.y - y;
|
||||
const d2 = Math.max(gameState.brickWidth, Math.abs(dx) + Math.abs(dy));
|
||||
c.vx += ((dx / d2) * 10 * size) / c.weight;
|
||||
c.vy += ((dy / d2) * 10 * size) / c.weight;
|
||||
c.vx += ((dx / d2) * 10 * size) / c.weight * factor;
|
||||
c.vy += ((dy / d2) * 10 * size) / c.weight* factor;
|
||||
});
|
||||
gameState.lastExplosion = Date.now();
|
||||
|
||||
makeLight(gameState, x, y, "white", gameState.brickWidth * 2, 150);
|
||||
if(gameState.perks.implosions){
|
||||
spawnImplosion(
|
||||
gameState,
|
||||
7 * (1 + gameState.perks.bigger_explosions),
|
||||
x,
|
||||
y,
|
||||
"white")
|
||||
}else{
|
||||
|
||||
spawnExplosion(
|
||||
gameState,
|
||||
|
@ -294,6 +323,8 @@ export function explosionAt(
|
|||
y,
|
||||
"white",
|
||||
);
|
||||
}
|
||||
|
||||
gameState.runStatistics.bricks_broken++;
|
||||
|
||||
if (gameState.perks.zen) {
|
||||
|
@ -382,6 +413,14 @@ export function explodeBrick(
|
|||
gameState.perks.nbricks +
|
||||
gameState.perks.unbounded;
|
||||
|
||||
if(gameState.perks.side_kick) {
|
||||
if(Math.abs(ball.vx) > Math.abs(ball.vy)){
|
||||
gameState.combo += gameState.perks.side_kick
|
||||
}else {
|
||||
decreaseCombo(gameState, gameState.perks.side_kick, ball.x,ball.y)
|
||||
}
|
||||
}
|
||||
|
||||
if (gameState.perks.reach) {
|
||||
if (
|
||||
countBricksAbove(gameState, index) &&
|
||||
|
|
|
@ -2262,6 +2262,56 @@
|
|||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>corner_shot</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>fullHelp</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>help</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>name</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>etherealcoins</name>
|
||||
<children>
|
||||
|
@ -2627,6 +2677,56 @@
|
|||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>implosions</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>fullHelp</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>help</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>name</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>instant_upgrade</name>
|
||||
<children>
|
||||
|
@ -3572,6 +3672,71 @@
|
|||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>side_kick</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>fullHelp</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>help</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>help_plural</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>name</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>skip_last</name>
|
||||
<children>
|
||||
|
|
|
@ -141,6 +141,9 @@
|
|||
"upgrades.concave_puck.fullHelp": "Balls starts the level going straight up, and bounces with less angle.",
|
||||
"upgrades.concave_puck.help": " Helps with aiming straight up",
|
||||
"upgrades.concave_puck.name": "Concave puck",
|
||||
"upgrades.corner_shot.fullHelp": "Helps with aiming in the corners",
|
||||
"upgrades.corner_shot.help": "Lets your puck overlap with the borders of the screen",
|
||||
"upgrades.corner_shot.name": "Corner shot",
|
||||
"upgrades.etherealcoins.fullHelp": "You'll have to make sure that the coins fall down somehow",
|
||||
"upgrades.etherealcoins.help": "Coins are no longer affected by gravity",
|
||||
"upgrades.etherealcoins.name": "Coins, in Space",
|
||||
|
@ -163,6 +166,9 @@
|
|||
"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.\n\nThis 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. \n\nThe 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. \n\nEvery 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.implosions.fullHelp": "The explosion force is applied the other way. ",
|
||||
"upgrades.implosions.help": "Explosions suck coins in instead of blowing them out",
|
||||
"upgrades.implosions.name": "Implosions",
|
||||
"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.name": "+2 upgrades now",
|
||||
|
@ -220,6 +226,10 @@
|
|||
"upgrades.shunt.fullHelp": "If you also have hot start, the hot start is just added to the current combo",
|
||||
"upgrades.shunt.help": "Keep {{percent}}% of your combo between levels",
|
||||
"upgrades.shunt.name": "Shunt",
|
||||
"upgrades.side_kick.fullHelp": "When a brick get hit, the game checks the ball's velocity, and add +1 to the combo if its horizontal velocity is higher than its vertical velocity. The combo will decrease by one otherwise. The location of the impact on the brick is irrelevant. ",
|
||||
"upgrades.side_kick.help": "Bricks sometimes resist hits but drop more coins.",
|
||||
"upgrades.side_kick.help_plural": "+{{lvl}} combo per brick broken horizontally, -{{lvl}} otherwise",
|
||||
"upgrades.side_kick.name": "Side kick",
|
||||
"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\nClearing a level early brings extra choices when upgrading. Never missing the bricks is also very beneficial. \n\nSo if you find it difficult to break the last bricks, getting this perk a few time can help.",
|
||||
"upgrades.skip_last.help": "The last brick will explode.",
|
||||
"upgrades.skip_last.help_plural": "The last {{lvl}} bricks will explode.",
|
||||
|
|
|
@ -141,6 +141,9 @@
|
|||
"upgrades.concave_puck.fullHelp": " Les balles démarrent verticalement en début de niveau, et rebondi sur le palet de manière plus verticale et inversée.",
|
||||
"upgrades.concave_puck.help": "Aide à éviter les bords.",
|
||||
"upgrades.concave_puck.name": "Palet concave",
|
||||
"upgrades.corner_shot.fullHelp": "Aide à viser dans les coins",
|
||||
"upgrades.corner_shot.help": "Laisse votre palet sortir de la zone encadrée",
|
||||
"upgrades.corner_shot.name": "Tir en coin",
|
||||
"upgrades.etherealcoins.fullHelp": "Il faudrait vous assurer que les pièces tomberont bien quand même à un moment",
|
||||
"upgrades.etherealcoins.help": "Les pièces ne subissent plus la gravité",
|
||||
"upgrades.etherealcoins.name": "Monnaie spatiale ",
|
||||
|
@ -163,6 +166,9 @@
|
|||
"upgrades.hot_start.fullHelp": "Au début de chaque niveau, votre combo commencera à +15 points, mais à chaque seconde, il sera diminué d'un point. Cela signifie que les 15 premières secondes d'un niveau produiront beaucoup plus de pièces que les suivantes.\nVous devez vous assurer de terminer le niveau rapidement. L'effet se cumule avec d'autres avantages liés au combo, ce qui vous permet d'augmenter le combo après les 15 secondes, mais il continuera à diminuer chaque seconde. Chaque fois que vous reprenez la compétence, l'effet est encore plus prononcé.",
|
||||
"upgrades.hot_start.help": "Combo à {{start}}, -{{lvl}} combo par seconde",
|
||||
"upgrades.hot_start.name": "Démarrage à chaud",
|
||||
"upgrades.implosions.fullHelp": "La force d’explosion est appliquée dans l’autre sens.",
|
||||
"upgrades.implosions.help": "Les explosions aspirent les pièces au lieu de les faire exploser.",
|
||||
"upgrades.implosions.name": "Implosions",
|
||||
"upgrades.instant_upgrade.fullHelp": "Choisissez immédiatement deux améliorations, afin d'en obtenir une gratuite et une autre pour rembourser celle utilisée pour obtenir cet avantage. Chaque fois que vous choisirez des améliorations dans le menu suivant, vous aurez moins de choix.",
|
||||
"upgrades.instant_upgrade.help": "-1 choix jusqu'à la fin de la course.",
|
||||
"upgrades.instant_upgrade.name": "+2 améliorations maintenant",
|
||||
|
@ -220,6 +226,10 @@
|
|||
"upgrades.shunt.fullHelp": "Démarrage à chaud sera simplement ajouté au combo actuel",
|
||||
"upgrades.shunt.help": "Garer {{percent}}% du combo au changement de niveau ",
|
||||
"upgrades.shunt.name": "Shunt",
|
||||
"upgrades.side_kick.fullHelp": "Lorsqu'une brique est touchée, le jeu vérifie la vitesse de la balle et ajoute +1 au combo si sa vitesse horizontale est supérieure à sa vitesse verticale. Dans le cas contraire, le combo diminuera d'un point. L'emplacement de l'impact sur la brique n'a aucune importance.",
|
||||
"upgrades.side_kick.help": "Les briques résistent parfois aux coups mais font tomber plus de pièces.",
|
||||
"upgrades.side_kick.help_plural": "+{{lvl}} combo par brique cassé horizontalement, -{{lvl}} sinon",
|
||||
"upgrades.side_kick.name": "Un coté positif",
|
||||
"upgrades.skip_last.fullHelp": "Vous devez casser toutes les briques pour passer au niveau suivant. \n\nCependant, il peut être difficile d'obtenir les dernières briques.\n\nTerminer un niveau plus tôt permet d'obtenir des choix supplémentaires lors de la mise à niveau. \n\nNe jamais manquer de briques est également très avantageux.\n\nDonc, si vous avez du mal à casser les dernières briques, obtenir cet avantage plusieurs fois peut vous aider.",
|
||||
"upgrades.skip_last.help": "La dernière brique s'autodétruit.",
|
||||
"upgrades.skip_last.help_plural": "Les {{lvl}} dernières briques restantes s'autodétruiront",
|
||||
|
|
|
@ -301,7 +301,6 @@ export function render(gameState: GameState) {
|
|||
true,
|
||||
);
|
||||
} else {
|
||||
console.log({comboTextWidth,pw:gameState.puckWidth,combo:gameState.combo, comboText})
|
||||
drawText(
|
||||
ctx,
|
||||
comboTextWidth > gameState.puckWidth ? gameState.combo.toString() : comboText,
|
||||
|
|
|
@ -586,4 +586,37 @@ export const rawUpgrades = [
|
|||
help: (lvl: number) => t("upgrades.clairvoyant.help"),
|
||||
fullHelp: t("upgrades.clairvoyant.fullHelp"),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
rejects: "",
|
||||
threshold: 150000,
|
||||
giftable: true,
|
||||
id: "side_kick",
|
||||
max: 3,
|
||||
name: t("upgrades.side_kick.name"),
|
||||
help: (lvl: number) => t("upgrades.side_kick.help",{lvl}),
|
||||
fullHelp: t("upgrades.side_kick.fullHelp"),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
rejects: "",
|
||||
threshold: 155000,
|
||||
giftable: false,
|
||||
id: "implosions",
|
||||
max: 1,
|
||||
name: t("upgrades.implosions.name"),
|
||||
help: (lvl: number) => t("upgrades.implosions.help"),
|
||||
fullHelp: t("upgrades.implosions.fullHelp"),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
rejects: "",
|
||||
threshold: 160000,
|
||||
giftable: false,
|
||||
id: "corner_shot",
|
||||
max: 1,
|
||||
name: t("upgrades.corner_shot.name"),
|
||||
help: (lvl: number) => t("upgrades.corner_shot.help"),
|
||||
fullHelp: t("upgrades.corner_shot.fullHelp"),
|
||||
},
|
||||
] as const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue