mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-23 21:46:15 -04:00
Build 29071527
This commit is contained in:
parent
9ae649743c
commit
c37b860fe3
13 changed files with 116 additions and 19 deletions
10
src/game.ts
10
src/game.ts
|
@ -68,6 +68,7 @@ import { hashCode } from "./getLevelBackground";
|
|||
import {
|
||||
catchRateBest,
|
||||
catchRateGood,
|
||||
clamp,
|
||||
hoursSpentPlaying,
|
||||
levelTimeBest,
|
||||
levelTimeGood,
|
||||
|
@ -397,7 +398,7 @@ export function tick() {
|
|||
const timeDeltaMs = currentTick - gameState.lastTick;
|
||||
gameState.lastTick = currentTick;
|
||||
|
||||
const frames = Math.min(4, timeDeltaMs / (1000 / 60));
|
||||
let frames = Math.min(4, timeDeltaMs / (1000 / 60));
|
||||
|
||||
if (gameState.keyboardPuckSpeed) {
|
||||
setMousePos(
|
||||
|
@ -405,6 +406,13 @@ export function tick() {
|
|||
gameState.puckPosition + gameState.keyboardPuckSpeed,
|
||||
);
|
||||
}
|
||||
if (gameState.perks.superhot) {
|
||||
frames *= clamp(
|
||||
Math.abs(gameState.puckPosition - gameState.lastPuckPosition) / 5,
|
||||
0.2 / gameState.perks.superhot,
|
||||
1,
|
||||
);
|
||||
}
|
||||
normalizeGameState(gameState);
|
||||
|
||||
if (gameState.running) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue