diff --git a/src/scenes/ShipDeckScene.js b/src/scenes/ShipDeckScene.js index d9894ed..81c04cf 100644 --- a/src/scenes/ShipDeckScene.js +++ b/src/scenes/ShipDeckScene.js @@ -95,15 +95,18 @@ export default class ShipDeckScene extends Phaser.Scene { const barrelCount = Math.ceil(this.inventory.fuel / 10); if (barrelCount === 0) return; - // Position relative to deck - const baseX = this.deckLeftX + 70; - const baseY = this.deckBottomY + 40; const barrelWidth = 50; const barrelHeight = 70; const horizontalSpacing = 60; const verticalSpacing = 75; const barrelsPerRow = 5; + // Calculate group width and center it in left half of deck + const groupWidth = (Math.min(barrelCount, barrelsPerRow) * horizontalSpacing); + const leftHalfCenter = this.deckLeftX + (this.deckWidth / 4); + const baseX = leftHalfCenter - (groupWidth / 2) + (horizontalSpacing / 2); + const baseY = this.deckBottomY + 40; + // Create barrels in stacking pattern for (let i = 0; i < barrelCount; i++) { const row = i % barrelsPerRow; @@ -143,15 +146,18 @@ export default class ShipDeckScene extends Phaser.Scene { const barrelCount = Math.ceil(this.inventory.whaleOil / 10); if (barrelCount === 0) return; - // Position relative to deck - const baseX = this.deckCenterX + 30; - const baseY = this.deckBottomY + 40; const barrelWidth = 50; const barrelHeight = 70; const horizontalSpacing = 60; const verticalSpacing = 75; const barrelsPerRow = 3; + // Calculate group width and center it in right half of deck + const groupWidth = (Math.min(barrelCount, barrelsPerRow) * horizontalSpacing); + const rightHalfCenter = this.deckCenterX + (this.deckWidth / 4); + const baseX = rightHalfCenter - (groupWidth / 2) + (horizontalSpacing / 2); + const baseY = this.deckBottomY + 40; + // Create barrels in stacking pattern for (let i = 0; i < barrelCount; i++) { const row = i % barrelsPerRow;