mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 13:06:15 -04:00
Build 29079087
This commit is contained in:
parent
06843047d2
commit
8e4e67e33b
17 changed files with 199 additions and 234 deletions
|
@ -461,11 +461,11 @@ export function explodeBrick(
|
|||
gameState.runStatistics.coins_spawned += coinsToSpawn;
|
||||
gameState.runStatistics.bricks_broken++;
|
||||
|
||||
const maxCoins = getCurrentMaxCoins()
|
||||
const maxCoins = getCurrentMaxCoins();
|
||||
const spawnableCoins =
|
||||
liveCount(gameState.coins) > getCurrentMaxCoins()
|
||||
? 1
|
||||
: Math.floor((maxCoins - liveCount(gameState.coins)) /2) ;
|
||||
: Math.floor((maxCoins - liveCount(gameState.coins)) / 2);
|
||||
|
||||
const pointsPerCoin = Math.max(1, Math.ceil(coinsToSpawn / spawnableCoins));
|
||||
|
||||
|
@ -1218,10 +1218,28 @@ export function gameStateTick(
|
|||
|
||||
const speed = (Math.abs(coin.vx) + Math.abs(coin.vy)) * 10;
|
||||
const hitBorder = bordersHitCheck(gameState, coin, coin.size / 2, frames);
|
||||
if(coin.previousY<gameState.gameZoneHeight && coin.y>gameState.gameZoneHeight && coin.vy>0 && speed > 20) {
|
||||
schedulGameSound(gameState, "plouf", coin.x, clamp(speed, 20,100)/100*0.2);
|
||||
if(!isOptionOn('basic')){
|
||||
makeParticle(gameState, coin.x,gameState.gameZoneHeight, -coin.vx/5, -coin.vy/5, coin.color, false )
|
||||
if (
|
||||
coin.previousY < gameState.gameZoneHeight &&
|
||||
coin.y > gameState.gameZoneHeight &&
|
||||
coin.vy > 0 &&
|
||||
speed > 20
|
||||
) {
|
||||
schedulGameSound(
|
||||
gameState,
|
||||
"plouf",
|
||||
coin.x,
|
||||
(clamp(speed, 20, 100) / 100) * 0.2,
|
||||
);
|
||||
if (!isOptionOn("basic")) {
|
||||
makeParticle(
|
||||
gameState,
|
||||
coin.x,
|
||||
gameState.gameZoneHeight,
|
||||
-coin.vx / 5,
|
||||
-coin.vy / 5,
|
||||
coin.color,
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue