Re-introduced power saving mode

This commit is contained in:
Renan LE CARO 2025-03-16 20:11:08 +01:00
parent 9bf7e9534d
commit bdfe5408b9
6 changed files with 3702 additions and 4 deletions

View file

@ -35,6 +35,7 @@ import { isOptionOn } from "./options";
export function setMousePos(gameState: GameState, x: number) {
// Sets the puck position, and updates the ball position if they are supposed to follow it
gameState.puckPosition = x;
gameState.needsRender=true
}
function getBallDefaultVx(gameState: GameState) {
@ -43,6 +44,7 @@ function getBallDefaultVx(gameState: GameState) {
(Math.random() > 0.5 ? gameState.baseSpeed : -gameState.baseSpeed)
);
}
export function resetBalls(gameState: GameState) {
const count = 1 + (gameState.perks?.multiball || 0);
const perBall = gameState.puckWidth / (count + 1);