diff --git a/www/html/Game/public/js/play.js b/www/html/Game/public/js/play.js index 322f175..8de35b5 100644 --- a/www/html/Game/public/js/play.js +++ b/www/html/Game/public/js/play.js @@ -387,7 +387,10 @@ const drawHIntro = Math.round(intro.naturalHeight * scaleI); const scaleL = cwR / loop.naturalWidth; const drawHLoop = Math.max(1, Math.round(loop.naturalHeight * scaleL)); - const S = stackTowerScrollBgPx + getStackTowerBgScrollHeightBoostPx(); + 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 vp0 = S; const vp1 = S + chR; const yLimit = vp1 + drawHLoop * 2; @@ -12916,17 +12919,21 @@ 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, worldMinY); - const bgMaxY = Math.min(mapHpx, worldMaxY); + const bgMinY = Math.max(0, worldMinYBg); + const bgMaxY = Math.min(mapHpx, worldMaxYBg); 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 - camY) * zDraw + canvas.height / 2; + const destY = (bgMinY - bgCamY) * 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 e299770..c6e43da 100644 --- a/www/html/Game/public/play.html +++ b/www/html/Game/public/play.html @@ -2009,7 +2009,7 @@ - +