Build 29071527

This commit is contained in:
Renan LE CARO 2025-04-10 15:27:38 +02:00
parent 9ae649743c
commit c37b860fe3
13 changed files with 116 additions and 19 deletions

View file

@ -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) {