From b1db1c1402f647ccbf2aabd70cbcec3264af51b2 Mon Sep 17 00:00:00 2001 From: Thomas Richter Date: Wed, 17 Dec 2025 04:00:32 +0100 Subject: [PATCH] Center barrel groups within their deck sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Calculate total width of each barrel group - Center fuel barrels in left quarter of deck - Center oil barrels in right quarter of deck - More balanced and symmetrical layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/scenes/ShipDeckScene.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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;