From 4acc55d4b3608b434861bbb6ae2c8b75b8fbc633 Mon Sep 17 00:00:00 2001 From: Dono <3781087+Donorhan@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:31:37 +0100 Subject: [PATCH] 1 - level: fix world bounds (camera & physics) --- core/client/level-manager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/client/level-manager.js b/core/client/level-manager.js index 435f3cd0..d8eeab97 100644 --- a/core/client/level-manager.js +++ b/core/client/level-manager.js @@ -22,7 +22,11 @@ levelManager = { this.initMapLayers(); this.addTilesetsToLayers(Tilesets.find().fetch()); - // physics + // todo: debug why we need to multiply by 48 instead of tile size (phaser bug?) + this.map.widthInPixels = (level.width || defaultMapConfig.width) * 48; + this.map.heightInPixels = (level.height || defaultMapConfig.height) * 48; + + // physics bounds this.scene.physics.world.bounds.width = this.map.widthInPixels; this.scene.physics.world.bounds.height = this.map.heightInPixels; },