Skip to content

Commit

Permalink
1 - level: fix world bounds (camera & physics)
Browse files Browse the repository at this point in the history
  • Loading branch information
Donorhan committed Nov 15, 2024
1 parent 0bae8f5 commit 4acc55d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/client/level-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

0 comments on commit 4acc55d

Please sign in to comment.