diff --git a/src/main.ts b/src/main.ts index bccca9d..04d5dac 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,7 @@ import { Resources, loader } from './resources'; const game = new ex.Engine({ width: 800, height: 600, + displayMode: ex.DisplayMode.FitScreenAndFill, pixelArt: true, pixelRatio: 2 }); @@ -11,9 +12,6 @@ const game = new ex.Engine({ game.start(loader).then(() => { Resources.SpriteFusionMap.addToScene(game.currentScene); - - - const playerLayer = Resources.SpriteFusionMap.layers.find(l => l.data.name === "Player"); if (playerLayer) { @@ -31,7 +29,7 @@ game.start(loader).then(() => { const tile = playerLayer.tilemap.getTile(playerTile.x, playerTile.y); const player = playerLayer.entities.find(e => e.name === 'Player'); game.currentScene.camera.pos = tile.pos; - game.currentScene.camera.zoom = 4; + game.currentScene.camera.zoom = 6; game.currentScene.camera.strategy.lockToActor(player as ex.Actor); if (mapBounds) { game.currentScene.camera.strategy.limitCameraBounds(mapBounds) diff --git a/src/resources.ts b/src/resources.ts index 8b25bc0..95c323b 100644 --- a/src/resources.ts +++ b/src/resources.ts @@ -12,6 +12,7 @@ export const Resources = { SpriteFusionMap: new SpriteFusionResource({ mapPath, spritesheetPath, + useTileMapCameraStrategy: true, entityTileIdFactories: { 2: (props) => { const player = new Player(props.worldPos);