This commit is contained in:
Renan LE CARO 2025-05-03 20:17:49 +02:00
parent 014aea003f
commit 9e12f62b81
8 changed files with 2189 additions and 2166 deletions

View file

@ -642,6 +642,22 @@ export function render(gameState: GameState) {
);
}
startWork("render:timeout");
if(gameState.winAt || gameState.startCountDown){
const remaining = gameState.startCountDown || Math.ceil((gameState.winAt-gameState.levelTime)/1000)
if(remaining>0 && remaining<5){
ctx.globalAlpha=1
ctx.globalCompositeOperation="destination-out";
drawText(ctx, remaining.toString(), 'white', 65, gameState.canvasWidth/2, gameState.canvasHeight/2)
ctx.globalCompositeOperation="screen";
ctx.globalAlpha=1/remaining
drawText(ctx, remaining.toString(), 'white', 60, gameState.canvasWidth/2, gameState.canvasHeight/2)
}
}
ctx.globalAlpha=1
startWork("render:askForWakeLock");
askForWakeLock(gameState);