修复特殊节点反馈并强化跟手缩放和选关标题
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
@font-face{font-family:NumberSwipePlayful;src:url(../fonts/NumberSwipePlayful.ttf)}
|
||||
*{box-sizing:border-box}body{margin:0;background:#fff6df;color:#43382f;font:15px NumberSwipeSans500,sans-serif}header{padding:28px 32px 20px;border-bottom:1px solid #e5d7ba}h1{margin:0 0 8px;font:25px NumberSwipeSans700}p{margin:8px 0;line-height:1.7;color:#71604f}main{display:flex;gap:32px;padding:28px 32px;align-items:flex-start}.tools{width:270px;position:sticky;top:24px}.tools h2{font-size:17px;margin:24px 0 10px}.tools button,select{font:14px NumberSwipeSans600;cursor:pointer;border:1px solid #d8c4a0;background:#fffbf2;color:#43382f;border-radius:12px;padding:12px;margin:0 6px 8px 0}.tools button:hover{border-color:#6552d9;color:#5140b7}.tools select{width:100%}.phone{border:1px solid #d8c4a0;border-radius:24px;overflow:hidden;box-shadow:0 12px 34px #43382f14;background:#ffe69a}canvas{display:block;touch-action:none}.note{font-size:13px}#status{background:#ece7ff;color:#5140b7;border-radius:12px;padding:12px;margin-top:16px}a{color:#5140b7}@media(max-width:750px){main{padding:16px;flex-direction:column}.tools{width:100%;position:static}.phone{align-self:center}header{padding:20px}}
|
||||
</style>
|
||||
<header><h1>数字一笔 · 分层反馈独立实验版</h1><p>200关实际游戏包的 Canvas 预览。全部画面由程序绘制,字体随包提供。</p></header>
|
||||
<header><h1>数字一笔 · 节点反馈与立体标题验收</h1><p>200关实际游戏包的 Canvas 预览。全部画面由程序绘制,字体随包提供。</p></header>
|
||||
<main><aside class="tools"><label for="size">屏幕尺寸</label><select id="size"><option>375×812</option><option>320×568</option><option>375×667</option><option>390×844</option><option>414×896</option></select><label for="feedback-mode">反馈对照</label><select id="feedback-mode"><option value="enhanced">强化版</option><option value="original">原版</option></select><h2>真实关卡样张</h2><div id="samples"></div><h2>指定关卡</h2><select id="level"></select><button id="partial">画前几步</button><button id="hint">显示指路</button><button id="clear">完成本关</button><button id="select">返回选关</button><p class="note">在右侧直接点击或滑动。音乐、音效与振动开关在游戏选关页的“设置”中。辅助演示按钮仅属于此验收页。</p><div id="status">加载字体与游戏包…</div><p class="note" id="audio-status" role="status">音效:点击游戏后播放</p><p class="note">本页不触发触觉。原版/强化版切换用于音色和表现对照;iPhone、Android触觉与性能仍需真机验收。</p><p><a href="hints.html" target="_blank">运行200关提示像素检查</a></p></aside><div class="phone" id="phone"></div></main>
|
||||
<script type="module">
|
||||
import {solve} from '../src/upstream/rules.mjs';
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Browser tab: 10, Title: "指路与玩家填色像素回归", URL: "http://127.0.0.1:17862/qa/hints.html".
|
||||
0 AXWebArea 指路与玩家填色像素回归, URL: 127.0.0.1:17862/qa/hints.html
|
||||
1 heading 指路与玩家填色像素回归, Value: 1
|
||||
2 text 指路与玩家填色像素回归
|
||||
3 text PASS:200/200 关,点击指路前后和撤销重画后,玩家已走格子的实际 Canvas 填色像素一致。左图无提示,右图开启高对比提示。
|
||||
|
||||
The focused UI element is 0 AXWebArea 指路与玩家填色像素回归, URL: 127.0.0.1:17862/qa/hints.html
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
> numberswipe-main@1.0.0 check
|
||||
> npm run build && npm test && npm run smoke
|
||||
|
||||
|
||||
> numberswipe-main@1.0.0 build
|
||||
> node build.mjs
|
||||
|
||||
Built campaign-200-r2: 200 levels
|
||||
|
||||
> numberswipe-main@1.0.0 test
|
||||
> node --test *.test.mjs
|
||||
|
||||
✔ 手机没有浏览器音频接口时,原生播放器仍能播放全部 36 步和六类反馈音 (3.9885ms)
|
||||
✔ 关闭音效停止播放;再次开启会试听并保存偏好;后台中断停止所有播放器 (0.7226ms)
|
||||
✔ 延迟通关音在静音或进入后台时取消,不在返回后突然播放 (43.816ms)
|
||||
✔ 音频错误可诊断,不再静默吞掉 (0.4879ms)
|
||||
✔ 所有音频均为非静音 PCM;原版第13步比第1步高一个八度 (17.705ms)
|
||||
✔ 教学和组合规则用具体动作及奇偶例子解释,没有未解释的术语 (10.1978ms)
|
||||
✔ 过关提示同步使用实际播放起点,非请求时间 (0.67ms)
|
||||
✔ 过关和弦收尾持续衰减,不在后半段重新起音 (2.9896ms)
|
||||
✔ merged irregular outlines retain holes and never draw internal unit edges (47.5019ms)
|
||||
✔ all 200 boards fit four screen budgets with stable safe anchors and real shared entrances (610.3905ms)
|
||||
✔ guides through every irregular block stay inside its occupied shape (29.4299ms)
|
||||
✔ visited, conflicting and hinted category cells retain their material identity (10.7152ms)
|
||||
✔ five font subsets match their manifest and fit the package budget (3.8633ms)
|
||||
✔ upstream adapter fails closed if the inspected render seams change (0.7606ms)
|
||||
✔ procedural cushion pixels preserve holes and light the upper bevel without a border (18.2888ms)
|
||||
✔ visible glyph bounds are centered independently of font ascent and side bearings (1.8222ms)
|
||||
✔ stage with zero depth casts alpha shadows without painting a solid backing (8.1804ms)
|
||||
✔ native width-only TextMetrics still centers the rasterized glyph ink (2.6229ms)
|
||||
✔ fixed channels remain anchored at their block centers after number enlargement (781.7528ms)
|
||||
✔ checkpoint ribbons trigger on correct arrival only and never duplicate per frame (4.1184ms)
|
||||
✔ checkpoint pulse is small, centered in time and settles without looping (0.3466ms)
|
||||
✔ event batches preserve every landing and sequence but commit only highest audio and haptic (2.9218ms)
|
||||
✔ completion waits at most 120ms and ignores late audio callbacks (0.5196ms)
|
||||
✔ light haptics are limited, checkpoint replaces light, and completion adds only one delayed short pulse (0.4533ms)
|
||||
✔ unsupported graded haptic falls back to one short pulse, never long vibration (0.3297ms)
|
||||
✔ haptic disable, preview and lifecycle cancellation suppress delayed or expired work (0.5018ms)
|
||||
✔ late failed haptic requests cannot revive old pulses and ungraded completion falls back once (0.3539ms)
|
||||
✔ rectangles, concave shapes and hexagons require geometric inward distance without treating internal seams as walls (1.3157ms)
|
||||
✔ one high-speed native move records all intermediate cells and completion without duplicate final node (121.2167ms)
|
||||
✔ legal but off-solution moves use public rules, while invalid clues only produce error (60.7207ms)
|
||||
✔ drag near a previous-block boundary cannot undo; deeper entry can, and undo button remains immediate (44.9951ms)
|
||||
✔ tutorial, redraw, hint and restored saved routes do not generate player feedback (78.4011ms)
|
||||
✔ pressure and rebound have bounded amplitude and duration (0.3839ms)
|
||||
✔ interpolation cannot duplicate the same failed-cell event within one native movement (0.2255ms)
|
||||
✔ nodes are driven by explicit events even when multiple arrive before rendering; at most two ribbons survive (18.5497ms)
|
||||
✔ audio fast moves merge to latest pitch and completion stops the whole four-channel pool (1.2874ms)
|
||||
✔ settings persist haptic preference independently and chapter cards always use three columns (75.56ms)
|
||||
✔ original audio is preserved and high pitches lose energy rather than growing sharper (7.6609ms)
|
||||
✔ empty, partial and wrong routes reveal the first incomplete full segment (3.5196ms)
|
||||
✔ completion hides the hint; repeat clicks cannot skip; undo and restart return to earlier segments (0.5284ms)
|
||||
✔ all 200 levels reveal consecutive segments without changing the player path (1330.6071ms)
|
||||
✔ hint draws skip player edges and mask visited cells on their own layer; compositing is restored (0.8237ms)
|
||||
✔ parity is a segment anchor; colour is not; flow moves continuously across cells (0.3012ms)
|
||||
✔ coral teaching ribbon preserves visited masks and offers direction in reduced motion (1.3822ms)
|
||||
✔ hint rounds shared guide junctions and keeps separate runs disconnected (0.2984ms)
|
||||
✔ 实际教学关动画:basic (4.1589ms)
|
||||
✔ 实际教学关动画:walls (0.8719ms)
|
||||
✔ 实际教学关动画:straight (1.9467ms)
|
||||
✔ 实际教学关动画:vertical (2.6791ms)
|
||||
✔ 实际教学关动画:corner (1.1548ms)
|
||||
✔ 实际教学关动画:colour (0.5767ms)
|
||||
✔ 实际教学关动画:parity (0.515ms)
|
||||
✔ 实际教学关动画:rhythm-door (0.704ms)
|
||||
✔ 实际教学关动画:hex (0.6488ms)
|
||||
✔ 实际教学关动画:unknown-start (1.7224ms)
|
||||
✔ 200关的组合规则均能找到对应真实教学关 (91.9189ms)
|
||||
✔ 教学减速,结束停留1秒后自动循环 (4.4562ms)
|
||||
✔ music loops independently, persists mute and cancels in background (1.613ms)
|
||||
✔ old arrows retain distance, rush to endpoint and fresh arrows move at base speed (0.7279ms)
|
||||
✔ settings have exactly three independent preferences, and hint has its own cue (124.8702ms)
|
||||
✔ actual fixed numeric node uses checkpoint pitch, final cell uses complete chord (107.024ms)
|
||||
✔ two original music loops are quiet, nonempty and have a smooth loop seam (1.5419ms)
|
||||
✔ all 200 levels: valid numeric, parity and direction arrivals play checkpoint pitch; final arrival only completes (24773.4619ms)
|
||||
✔ drag back and undo button both vibrate lightly; disabling vibration suppresses both (50.2723ms)
|
||||
✔ haptic cadence is approximately 15 percent denser without changing light or medium grades (1.4843ms)
|
||||
✔ regular and special scale settle at 90ms with a larger special peak (0.3ms)
|
||||
✔ rendered undo target and nonnumeric checkpoint animate immediately without adding ribbons (6.1374ms)
|
||||
✔ quick undo cancels removed node rebound, including last-step removal (1.9203ms)
|
||||
✔ first launch goes directly to gameplay (86.9461ms)
|
||||
✔ resume unfinished route after exit from gameplay (105.339ms)
|
||||
✔ resume unfinished route after exit from selection (89.2179ms)
|
||||
✔ completed level resumes next unfinished, including leaving from cleared screen (75.952ms)
|
||||
✔ replaying a cleared level does not replace the unfinished save (79.5395ms)
|
||||
✔ legacy saves, malformed data and full completion have valid startup targets (56.1729ms)
|
||||
✔ selection pages expose fifteen cards and fit phone safe areas (247.9721ms)
|
||||
✔ hint-only frames reuse static UI, and player input invalidates it (46.1472ms)
|
||||
✔ hint curves are cached and distance lookup is stable at boundaries (1.1599ms)
|
||||
✔ new-mechanic lesson reuses the board while the continuous cursor advances (39.2951ms)
|
||||
ℹ tests 78
|
||||
ℹ suites 0
|
||||
ℹ pass 78
|
||||
ℹ fail 0
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 25049.2178
|
||||
|
||||
> numberswipe-main@1.0.0 smoke
|
||||
> node smoke.mjs
|
||||
|
||||
PASS 200/200: r2源文件哈希一致、唯一解、微信发布包触摸通关、撤销/重开/指路、存档/音效设置恢复、前后台切换。
|
||||
@@ -1,12 +1,12 @@
|
||||
import fs from 'node:fs';import vm from 'node:vm';import assert from 'node:assert/strict';import path from 'node:path';import {fileURLToPath} from 'node:url';
|
||||
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');const pack=JSON.parse(fs.readFileSync(path.join(root,'src/upstream/levels.json'))),ordered=pack.playOrder.map(id=>pack.levels.find(l=>l.id===id));
|
||||
export function boot(storage = new Map(), width = 375, height = 812) {
|
||||
const handlers = {}, frames = new Map(), played=[];
|
||||
const handlers = {}, frames = new Map(), played=[],vibrated=[];
|
||||
let frameId = 0,now=100000;
|
||||
class Clock extends Date {static now(){return now;}}
|
||||
const text = [],images=[];
|
||||
const ctx = new Proxy({ drawImage:(image,x,y,w,h)=>images.push({x,y,w,h}),measureText: s => ({ width: [...String(s)].reduce((n,c)=>n+(/[^\x00-\x7f]/.test(c)?1:.55),0)*(Number(/([\d.]+)px/.exec(ctx.font)?.[1])||16) }), fillText: (s, x, y) => text.push({ s, x, y }) }, { get: (o, k) => o[k] ?? (() => { }), set: (o, k, v) => (o[k] = v, true) });
|
||||
const wx = {setInnerAudioOption:()=>{},createInnerAudioContext:()=>({stop(){},onError(){},play(){assert.ok(fs.existsSync(path.join(root,this.src)),this.src);played.push(this.src);}}), createCanvas: () => ({ getContext: () => ctx }), getWindowInfo: () => ({ windowWidth: width, windowHeight: height, pixelRatio: 2, safeArea: { top: 44, bottom: height - 34 } }), getMenuButtonBoundingClientRect: () => ({ bottom: 80 }), getStorageSync: k => storage.get(k) || '', setStorageSync: (k, v) => storage.set(k, v), removeStorageSync: k => storage.delete(k), getPerformance: () => ({ now: () => Date.now() }), showModal: () => { }, env: { USER_DATA_PATH: '/user' } };
|
||||
const wx = {vibrateShort:o=>vibrated.push({type:o.type,at:now}),setInnerAudioOption:()=>{},createInnerAudioContext:()=>({stop(){},onError(){},play(){assert.ok(fs.existsSync(path.join(root,this.src)),this.src);played.push(this.src);}}), createCanvas: () => ({ getContext: () => ctx }), getWindowInfo: () => ({ windowWidth: width, windowHeight: height, pixelRatio: 2, safeArea: { top: 44, bottom: height - 34 } }), getMenuButtonBoundingClientRect: () => ({ bottom: 80 }), getStorageSync: k => storage.get(k) || '', setStorageSync: (k, v) => storage.set(k, v), removeStorageSync: k => storage.delete(k), getPerformance: () => ({ now: () => Date.now() }), showModal: () => { }, env: { USER_DATA_PATH: '/user' } };
|
||||
wx.loadFont=p=>{assert.ok(fs.existsSync(path.join(root,p)),'字体必须随包提供 '+p);return path.basename(p,'.ttf');};
|
||||
for (const name of ['TouchStart', 'TouchMove', 'TouchEnd', 'TouchCancel', 'Hide', 'Show', 'WindowResize'])
|
||||
wx['on' + name] = cb => handlers[name] = cb;
|
||||
@@ -25,5 +25,5 @@ export function boot(storage = new Map(), width = 375, height = 812) {
|
||||
assert.ok(++steps < 25);
|
||||
} button(api.buttons().some(b => b.label === label) ? label : label + ' ✓'); if (api.buttons().some(b => b.label === '返回游戏'))
|
||||
button('返回游戏'); assert.equal(api.snapshot().level, ordered[i].id); };
|
||||
return { advance(ms){now+=ms;tick();}, api, button, cell, select, tick, handlers, frames, storage, text, played,images };
|
||||
return { advance(ms){now+=ms;tick();}, api, button, cell, select, tick, handlers, frames, storage, text, played,images,vibrated };
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
Reference in New Issue
Block a user