mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-05-05 03:07:14 -04:00
wip
This commit is contained in:
parent
014aea003f
commit
9e12f62b81
8 changed files with 2189 additions and 2166 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue