mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-20 12:15:06 -04:00
Wind perk
This commit is contained in:
parent
43e5e76666
commit
6d1cbddf95
2 changed files with 125 additions and 10 deletions
|
@ -648,6 +648,13 @@ const upgrades = [
|
|||
"max": 3,
|
||||
"help": "Puck repulses balls.",
|
||||
},
|
||||
{
|
||||
"threshold": 35000,
|
||||
"id": "wind",
|
||||
"name": "Wind",
|
||||
"max": 3,
|
||||
"help": "Puck position creates wind.",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
@ -904,6 +911,10 @@ function bordersHitCheck(coin, radius, delta) {
|
|||
coin.sx *= 0.9;
|
||||
coin.sy *= 0.9;
|
||||
|
||||
if (perks.wind) {
|
||||
coin.vx += (puck - (offsetX + gameZoneWidth / 2)) / gameZoneWidth * perks.wind * 0.5;
|
||||
}
|
||||
|
||||
let vhit = 0, hhit = 0;
|
||||
|
||||
|
||||
|
@ -1026,6 +1037,28 @@ function tick() {
|
|||
|
||||
balls.forEach((ball) => ballTick(ball, delta));
|
||||
|
||||
if (perks.wind) {
|
||||
|
||||
const windD = (puck - (offsetX + gameZoneWidth / 2)) / gameZoneWidth * 2 * perks.wind
|
||||
for (var i = 0; i < perks.wind; i++) {
|
||||
if(Math.random()*Math.abs(windD)>0.5) {
|
||||
flashes.push({
|
||||
type: "particle",
|
||||
duration: 150,
|
||||
ethereal: true,
|
||||
time: levelTime,
|
||||
size: coinSize / 2,
|
||||
color: rainbowColor(),
|
||||
x: offsetXRoundedDown+ Math.random() * gameZoneWidthRoundedUp ,
|
||||
y: Math.random() * gameZoneHeight,
|
||||
vx: windD*8,
|
||||
vy: 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flashes.forEach((flash) => {
|
||||
if (flash.type === "particle") {
|
||||
flash.x += flash.vx * delta;
|
||||
|
|
|
@ -9122,5 +9122,87 @@ let allLevels=[
|
|||
""
|
||||
],
|
||||
"svg": ""
|
||||
},
|
||||
{
|
||||
"name": "perk:wind",
|
||||
"size": 9,
|
||||
"bricks": [
|
||||
"",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
"#E67070",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"#E66BA8",
|
||||
"#E66BA8",
|
||||
"#E66BA8",
|
||||
"#E66BA8",
|
||||
null,
|
||||
"#E67070",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
"",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
null,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
"",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
"#E67070",
|
||||
null,
|
||||
"#E67070",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
"#E67070",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"#E66BA8",
|
||||
"#E66BA8",
|
||||
"#E66BA8",
|
||||
"#E66BA8",
|
||||
null,
|
||||
null,
|
||||
"#E67070",
|
||||
"#E67070"
|
||||
],
|
||||
"svg": ""
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue