This commit is contained in:
Renan LE CARO 2025-04-20 21:14:35 +02:00
parent 9716235531
commit 0a1d9dfe2f
18 changed files with 2391 additions and 1981 deletions

View file

@ -302,22 +302,20 @@ export function render(gameState: GameState) {
});
startWork("render:ball shade");
// Black shadow around balls
if (!isOptionOn("basic")) {
ctx.globalCompositeOperation = "source-over";
gameState.balls.forEach((ball) => {
ctx.globalAlpha =
Math.min(0.8, liveCount(gameState.coins) / 20) *
(1 - ballTransparency(ball, gameState));
ctx.globalCompositeOperation = "source-over";
gameState.balls.forEach((ball) => {
ctx.globalAlpha =
Math.min(0.8, liveCount(gameState.coins) / 20) *
(1 - ballTransparency(ball, gameState));
drawBall(
ctx,
level.color || "#000",
gameState.ballSize * 6,
ball.x,
ball.y,
);
});
}
drawBall(
ctx,
level.color || "#000",
gameState.ballSize * 6,
ball.x,
ball.y,
);
});
startWork("render:bricks");
ctx.globalCompositeOperation = "source-over";
renderAllBricks();