Skip to content

Commit e4f8d3b

Browse files
committed
Fix game on small resolutions
1 parent 8454a78 commit e4f8d3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/js/game/camera.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ export class Camera extends BasicSerializableObject {
168168
* Finds a good initial zoom level
169169
*/
170170
findInitialZoom() {
171-
const desiredWorldSpaceWidth = 18 * globalConfig.tileSize;
171+
let desiredWorldSpaceWidth = 18 * globalConfig.tileSize;
172+
if (window.innerWidth < 1000) {
173+
desiredWorldSpaceWidth = 12 * globalConfig.tileSize;
174+
}
175+
172176
const zoomLevelX = this.root.gameWidth / desiredWorldSpaceWidth;
173177
const zoomLevelY = this.root.gameHeight / desiredWorldSpaceWidth;
174178

0 commit comments

Comments
 (0)