Graphics change, more light thanks to optimized computations

This commit is contained in:
Renan LE CARO 2025-04-03 15:15:00 +02:00
parent 83c79b6564
commit ba7e368938
16 changed files with 215 additions and 90 deletions

View file

@ -45,6 +45,8 @@ import {
backgroundCanvas,
ctx,
gameCanvas,
haloCanvas,
haloScale,
render,
scoreDisplay,
} from "./render";
@ -127,12 +129,15 @@ export const fitSize = () => {
gameState.canvasHeight = height;
gameCanvas.width = width;
gameCanvas.height = height;
ctx.fillStyle = currentLevelInfo(gameState)?.color || "black";
ctx.globalAlpha = 1;
ctx.fillRect(0, 0, width, height);
// ctx.fillStyle = currentLevelInfo(gameState)?.color || "black";
// ctx.globalAlpha = 1;
// ctx.fillRect(0, 0, width, height);
backgroundCanvas.width = width;
backgroundCanvas.height = height;
haloCanvas.width = width / haloScale;
haloCanvas.height = height / haloScale;
gameState.gameZoneHeight = isOptionOn("mobile-mode")
? (height * 80) / 100
: height;