Fixed zooming bug black lines again
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user