กระโดดขึ้นแท่น CyberCrime done

This commit is contained in:
2026-05-07 16:15:17 +00:00
parent 1d6370c12e
commit 4ad29169b2
3 changed files with 37 additions and 26 deletions
File diff suppressed because one or more lines are too long
+35 -24
View File
@@ -2224,7 +2224,7 @@
/** quiz_carry — โซนตัวเลือกบนแมป / ธีมป้ายต่อช่องสูงสุด 16 */
const QUIZ_CARRY_MAX_OPTION_SLOTS = 16;
/** jump_survive — กล้องตามตัวในกรอบ + แพลตฟอร์มเลื่อนขึ้น (scroll) ไม่ลากทั้งฉาก */
/** jump_survive — กล้องตามตัวในกรอบ + แพลตฟอร์มเลื่อนลง (scroll เพิ่ม world Y ของแพลตฟอร์ม) ไม่ลากทั้งฉาก */
let jumpSurviveCamCenterX = 0;
let jumpSurviveCamCenterY = 0;
let jumpSurviveEliminated = false;
@@ -3115,8 +3115,9 @@
return;
}
const qmCenter = isQuizQuestionMissionHudActivePlay() ? getQuizQuestionMissionMapCenterWorldPxPlay() : null;
const camX = qmCenter ? qmCenter.cx : me.x * tileSize;
const camY = qmCenter ? qmCenter.cy : me.y * tileSize;
const carryCam = !qmCenter && isQuizCarry() ? getQuizCarryMapCameraWorldCenterPxPlay() : null;
const camX = qmCenter ? qmCenter.cx : (carryCam ? carryCam.cx : me.x * tileSize);
const camY = qmCenter ? qmCenter.cy : (carryCam ? carryCam.cy : me.y * tileSize);
const zDom = playDomSyncZoom();
const left = (bounds.minX * tileSize - camX) * zDom + canvas.width / 2;
const top = (bounds.minY * tileSize - camY) * zDom + canvas.height / 2;
@@ -3244,8 +3245,9 @@
clearToFullStack();
return;
}
const camX = me.x * tileSize;
const camY = me.y * tileSize;
const cc = getQuizCarryMapCameraWorldCenterPxPlay();
const camX = cc ? cc.cx : me.x * tileSize;
const camY = cc ? cc.cy : me.y * tileSize;
const zDom = playDomSyncZoom();
const left = (bounds.minX * tileSize - camX) * zDom + canvas.width / 2;
const top = (bounds.minY * tileSize - camY) * zDom + canvas.height / 2;
@@ -3316,8 +3318,9 @@
return;
}
}
const camX = me.x * tileSize;
const camY = me.y * tileSize;
const cc = getQuizCarryMapCameraWorldCenterPxPlay();
const camX = cc ? cc.cx : me.x * tileSize;
const camY = cc ? cc.cy : me.y * tileSize;
const zDom = playDomSyncZoom();
const l = (bounds.minX * tileSize - camX) * zDom + canvasEl.width / 2;
const t = (bounds.minY * tileSize - camY) * zDom + canvasEl.height / 2;
@@ -4428,6 +4431,10 @@
if (qmc) {
zDraw = Math.min(canvas.width / qmc.mwPx, canvas.height / qmc.mhPx) * 0.96;
}
} else if (isQuizCarry()) {
const mwPx = w * tileSize;
const mhPx = h * tileSize;
zDraw = Math.min(canvas.width / mwPx, canvas.height / mhPx) * 0.96;
}
if (isLastLightEmbedZoomLockedPlay()) {
playEmbedUserZoomMul = PLAY_EMBED_LAST_LIGHT_FIXED_ZOOM_MUL;
@@ -6575,6 +6582,13 @@
function isBalloonBoss() { return mapData && mapData.gameType === 'balloon_boss'; }
function isQuizCarry() { return mapData && mapData.gameType === 'quiz_carry'; }
/** quiz_carry: จุดกลางแมป (world px) — กล้องไม่ตามตัวละคร; ใช้ร่วม draw + overlay DOM */
function getQuizCarryMapCameraWorldCenterPxPlay() {
if (!mapData || mapData.gameType !== 'quiz_carry') return null;
const ww = mapData.width || 20, hh = mapData.height || 15;
const ts = tileSize;
return { cx: ww * ts * 0.5, cy: hh * ts * 0.5 };
}
function isQuizBattle() { return mapData && mapData.gameType === 'quiz_battle'; }
function quizCarryNeonColorForChoice(choiceIndex) {
@@ -12582,7 +12596,7 @@
return out;
}
/** ความสูงแมปเป็นคาบวนของแพลตฟอร์ม — แถวที่เลื่อนออกบนจะวนมาโผล่ล่าง */
/** ความสูงแมปเป็นคาบวนของแพลตฟอร์ม — แถวที่เลื่อนออกล่างจะวนมาโผล่บน */
function jumpSurvivePlatformPeriodPx(md) {
return (md.height || 15) * tileSize;
}
@@ -12595,7 +12609,7 @@
const h = md.height || 15;
const period = jumpSurvivePlatformPeriodPx(md);
const { cw, ch } = getCharacterFootprintWH(md);
const rawTop = ty * ts - scrollPx;
const rawTop = ty * ts + scrollPx;
const hintY = (jumpSurviveCamCenterY > 1)
? jumpSurviveCamCenterY
: h * ts * 0.72;
@@ -12909,7 +12923,7 @@
for (let ty = 0; ty < h; ty++) {
for (let tx = x0; tx <= x1; tx++) {
if (!pa[ty] || pa[ty][tx] !== 1) continue;
const rawTop = ty * ts - scrollPx;
const rawTop = ty * ts + scrollPx;
let kMin = Math.ceil((top - rawTop - ts - vm) / period);
let kMax = Math.floor((bottom - rawTop + vm) / period);
/* ceil/floor กับช่วงสั้น ๆ อาจได้ kMin > kMax → ไม่ลอง k เลย แล้วตกทะลุแพลตฟอร์ม */
@@ -12975,7 +12989,7 @@
if (ty < 0 || ty >= h || !pa[ty]) return false;
for (let tx = x0; tx <= x1; tx++) {
if (pa[ty][tx] !== 1) continue;
const rawTop = ty * ts - scrollPx;
const rawTop = ty * ts + scrollPx;
let kMin = Math.ceil((top - rawTop - ts - vm) / period);
let kMax = Math.floor((bottom - rawTop + vm) / period);
if (kMin > kMax) {
@@ -14793,8 +14807,9 @@
const sx = e.clientX - r.left;
const sy = e.clientY - r.top;
const qmC = isQuizQuestionMissionHudActivePlay() ? getQuizQuestionMissionMapCenterWorldPxPlay() : null;
const camX = qmC ? qmC.cx : me.x * tileSize;
const camY = qmC ? qmC.cy : me.y * tileSize;
const carryCam = !qmC && isQuizCarry() ? getQuizCarryMapCameraWorldCenterPxPlay() : null;
const camX = qmC ? qmC.cx : (carryCam ? carryCam.cx : me.x * tileSize);
const camY = qmC ? qmC.cy : (carryCam ? carryCam.cy : me.y * tileSize);
const zHit = lastPlayZDrawForInput > 0 ? lastPlayZDrawForInput : zoom;
const gx = (sx - canvas.width / 2) / zHit + camX;
const gy = (sy - canvas.height / 2) / zHit + camY;
@@ -16526,6 +16541,12 @@
const mwPx = w * tileSize, mhPx = h * tileSize;
camX = mwPx * 0.5;
camY = mhPx * 0.5;
} else if (isQuizCarry()) {
const qc = getQuizCarryMapCameraWorldCenterPxPlay();
if (qc) {
camX = qc.cx;
camY = qc.cy;
}
} else if (isQuizQuestionMissionHudActivePlay()) {
const qmc = getQuizQuestionMissionMapCenterWorldPxPlay();
if (qmc) {
@@ -16871,7 +16892,7 @@
const tileWorldLeft = px * tsz;
const tileWorldRight = (px + runLen) * tsz;
if (tileWorldRight <= worldMinX || tileWorldLeft >= worldMaxX) continue;
const rawTop = py * tsz - sc;
const rawTop = py * tsz + sc;
const kMin = Math.ceil((visTop - rawTop - tsz + eps) / period);
const kMax = Math.floor((visBot - rawTop - eps) / period);
if (kMax < kMin) continue;
@@ -16900,20 +16921,10 @@
try { ctx.imageSmoothingEnabled = true; } catch (e) { /* ignore */ }
ctx.drawImage(jumpPlatImg, dx, dy, dw, dh);
ctx.restore();
ctx.strokeStyle = 'rgba(0, 255, 240, 0.4)';
ctx.lineWidth = 1.5;
ctx.strokeRect(dx, dy, dw, dh);
ctx.lineWidth = 1;
} else {
const fillW = runLen > 1 ? segScreenW - 6 : psz - 6;
ctx.fillStyle = 'rgba(0, 40, 52, 0.72)';
ctx.fillRect(psx + 3, psy + 3, fillW, psz - 6);
ctx.strokeStyle = 'rgba(0, 255, 240, 0.55)';
ctx.lineWidth = 2;
ctx.strokeRect(psx + 3, psy + 3, fillW, psz - 6);
ctx.strokeStyle = 'rgba(120, 255, 255, 0.35)';
ctx.lineWidth = 1;
ctx.strokeRect(psx + 5, psy + 5, fillW - 4, psz - 10);
const grad = ctx.createLinearGradient(psx, psy, psx, psy + psz);
grad.addColorStop(0, 'rgba(0, 255, 240, 0.12)');
grad.addColorStop(0.5, 'rgba(0, 0, 0, 0)');
+1 -1
View File
@@ -3203,7 +3203,7 @@
</div>
<script src="/Game/socket.io/socket.io.js"></script>
<script src="js/version.js?v=0.0306"></script>
<script src="js/play.js?v=0.0409"></script>
<script src="js/play.js?v=0.0411"></script>
<div class="version-tag">v —</div>
</body>
</html>