mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 13:06:15 -04:00
Re-introduced power saving mode
This commit is contained in:
parent
9bf7e9534d
commit
bdfe5408b9
6 changed files with 3702 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue