Fixed zooming bug black lines again

This commit is contained in:
2026-02-07 14:36:18 +11:00
parent 72c4251fc4
commit 88017add92
2 changed files with 3 additions and 3 deletions

View File

@@ -103,9 +103,9 @@ export const GAME_CONFIG = {
rendering: { rendering: {
tileSize: 16, tileSize: 16,
cameraZoom: 2, cameraZoom: 2,
minZoom: 0.5, minZoom: 1,
maxZoom: 4, maxZoom: 4,
zoomStep: 0.1, zoomStep: 1,
wallColor: 0x2b2b2b, wallColor: 0x2b2b2b,
floorColor: 0x161616, floorColor: 0x161616,
exitColor: 0xffd166, exitColor: 0xffd166,

View File

@@ -58,7 +58,7 @@ export class CameraController {
handleWheel(deltaY: number): void { handleWheel(deltaY: number): void {
const zoomDir = deltaY > 0 ? -1 : 1; const zoomDir = deltaY > 0 ? -1 : 1;
const newZoom = Phaser.Math.Clamp( const newZoom = Phaser.Math.Clamp(
this.camera.zoom + zoomDir * GAME_CONFIG.rendering.zoomStep, Math.round(this.camera.zoom + zoomDir * GAME_CONFIG.rendering.zoomStep),
GAME_CONFIG.rendering.minZoom, GAME_CONFIG.rendering.minZoom,
GAME_CONFIG.rendering.maxZoom GAME_CONFIG.rendering.maxZoom
); );