diff --git a/www/html/Game/public/editor.html b/www/html/Game/public/editor.html index efca2f8..e634972 100644 --- a/www/html/Game/public/editor.html +++ b/www/html/Game/public/editor.html @@ -264,13 +264,13 @@ - +
v —
diff --git a/www/html/Game/public/js/play.js b/www/html/Game/public/js/play.js index 8de35b5..8fad99b 100644 --- a/www/html/Game/public/js/play.js +++ b/www/html/Game/public/js/play.js @@ -387,10 +387,7 @@ const drawHIntro = Math.round(intro.naturalHeight * scaleI); const scaleL = cwR / loop.naturalWidth; const drawHLoop = Math.max(1, Math.round(loop.naturalHeight * scaleL)); - const worldBoost = getStackTowerBgScrollHeightBoostPx(); - const mapHpxRef = (mapData && mapData.height ? mapData.height : 15) * (tileSize || 32); - const stripScale = Math.max(1.2, (drawHIntro + drawHLoop * 0.9) / Math.max(mapHpxRef * 0.32, 140)); - const S = stackTowerScrollBgPx + worldBoost * stripScale; + const S = stackTowerScrollBgPx; const vp0 = S; const vp1 = S + chR; const yLimit = vp1 + drawHLoop * 2; @@ -6556,7 +6553,7 @@ return { enabled: raw.enabled !== false, pxPerLayer, maxPx }; } - /** เลื่อนเฉพาะแถบ BG (stackTowerScrollBg) — ไม่เลื่อนกล้องโลก */ + /** world px ตามความสูงหอ (mnn93hpi) — ใช้เลื่อนกล้องให้บล็อก/ฉากไปกับมุมมอง */ function getStackTowerBgScrollHeightBoostPx() { if (!isStackTowerMissionUiMapPlay() || !stackMini) return 0; const cfg = getStackTowerCameraFollowPlayConfig(); @@ -6574,6 +6571,7 @@ function getStackCameraCentersPx() { const w = mapData.width || 20, h = mapData.height || 15; const ts = tileSize; + const mapHpx = h * ts; const land = getStackAreaBoundsPlay(mapData.stackLandArea, w, h); const rel = getStackAreaBoundsPlay(mapData.stackReleaseArea, w, h); let cx = (w / 2) * ts; @@ -6588,6 +6586,12 @@ cx = rel.cx * ts; cy = rel.cy * ts; } + if (isStackTowerMissionUiMapPlay() && stackMini) { + const shift = getStackTowerBgScrollHeightBoostPx(); + if (shift > 0) { + cy = Math.max(ts * 1.5, Math.min(mapHpx - ts * 2, cy - shift)); + } + } return { px: cx, py: cy }; } @@ -12919,21 +12923,17 @@ ctx.fillRect(0, 0, canvas.width, canvas.height); const natW = mapBackgroundImg.naturalWidth; const natH = mapBackgroundImg.naturalHeight; - const towerBgBoost = (isStackTowerMissionUiMapPlay() && stackMini) ? getStackTowerBgScrollHeightBoostPx() : 0; - const bgCamY = camY - towerBgBoost; - const worldMinYBg = bgCamY - halfH; - const worldMaxYBg = bgCamY + halfH; const bgMinX = Math.max(0, worldMinX); const bgMaxX = Math.min(mapWpx, worldMaxX); - const bgMinY = Math.max(0, worldMinYBg); - const bgMaxY = Math.min(mapHpx, worldMaxYBg); + const bgMinY = Math.max(0, worldMinY); + const bgMaxY = Math.min(mapHpx, worldMaxY); if (bgMaxX > bgMinX && bgMaxY > bgMinY) { const srcX = (bgMinX / mapWpx) * natW; const srcY = (bgMinY / mapHpx) * natH; const srcW = ((bgMaxX - bgMinX) / mapWpx) * natW; const srcH = ((bgMaxY - bgMinY) / mapHpx) * natH; const destX = (bgMinX - camX) * zDraw + canvas.width / 2; - const destY = (bgMinY - bgCamY) * zDraw + canvas.height / 2; + const destY = (bgMinY - camY) * zDraw + canvas.height / 2; const destW = (bgMaxX - bgMinX) * zDraw; const destH = (bgMaxY - bgMinY) * zDraw; if (srcW > 0.25 && srcH > 0.25 && destW > 0.25 && destH > 0.25) { diff --git a/www/html/Game/public/play.html b/www/html/Game/public/play.html index c6e43da..07ac273 100644 --- a/www/html/Game/public/play.html +++ b/www/html/Game/public/play.html @@ -2009,7 +2009,7 @@ - +
v —