mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 04:56:15 -04:00
Red border dashes
This commit is contained in:
parent
83d335b05e
commit
80dd1f0758
11 changed files with 1011 additions and 931 deletions
|
@ -53,9 +53,6 @@ import { use } from "react";
|
|||
|
||||
export function setMousePos(gameState: GameState, x: number) {
|
||||
// Sets the puck position, and updates the ball position if they are supposed to follow it
|
||||
if (Math.abs(x - gameState.puckPosition) > 1) {
|
||||
gameState.lastPuckMove = gameState.levelTime;
|
||||
}
|
||||
gameState.puckPosition = x;
|
||||
gameState.needsRender = true;
|
||||
}
|
||||
|
@ -165,6 +162,11 @@ export function normalizeGameState(gameState: GameState) {
|
|||
if (gameState.ballStickToPuck) {
|
||||
putBallsAtPuck(gameState);
|
||||
}
|
||||
|
||||
if (Math.abs(gameState.lastPuckPosition - gameState.puckPosition) > 1 && gameState.running) {
|
||||
gameState.lastPuckMove = gameState.levelTime;
|
||||
}
|
||||
gameState.lastPuckPosition = gameState.puckPosition
|
||||
}
|
||||
|
||||
export function baseCombo(gameState: GameState) {
|
||||
|
@ -431,7 +433,7 @@ export function explodeBrick(
|
|||
gameState.lastPuckMove &&
|
||||
gameState.perks.passive_income &&
|
||||
gameState.lastPuckMove >
|
||||
gameState.levelTime - 500 * gameState.perks.passive_income
|
||||
gameState.levelTime - 250 * gameState.perks.passive_income
|
||||
) {
|
||||
resetCombo(gameState, x, y);
|
||||
}
|
||||
|
@ -845,6 +847,7 @@ export function gameStateTick(
|
|||
gameState.combo,
|
||||
);
|
||||
|
||||
|
||||
gameState.balls = gameState.balls.filter((ball) => !ball.destroyed);
|
||||
|
||||
const remainingBricks = gameState.bricks.filter(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue