Compare commits
1
Commits
v1.1.3-beian
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f02f9b085e |
No files matched your search
@@ -23,3 +23,6 @@ node_modules/
|
||||
#//////////////////////////
|
||||
.idea/
|
||||
.DS_Store
|
||||
|
||||
# Large local AI art review PNGs (keep locally, do not bloat git push)
|
||||
docs/art-review/
|
||||
@@ -1,12 +1,15 @@
|
||||
import { Component, Game, game, Node, view, _decorator } from 'cc';
|
||||
import { PREVIEW } from 'cc/env';
|
||||
import { AtelierService } from './core/AtelierService';
|
||||
import { RELEASE_LEVELS } from './core/ReleaseLevels';
|
||||
import { SoundService } from './core/SoundService';
|
||||
import { StorageService } from './core/StorageService';
|
||||
import { findValidationSample, VALIDATION_SAMPLES, ValidationSampleEntry } from './core/ValidationSamples';
|
||||
import { EmbroideryRenderer } from './render/EmbroideryRenderer';
|
||||
import { LobbyView } from './ui/LobbyView';
|
||||
import { PlayView } from './ui/PlayView';
|
||||
import { applyResponsivePolicy, computeScreenMetrics, ScreenMetrics } from './ui/ScreenAdapter';
|
||||
import { createLabel, createPanel, createUINode } from './ui/UiBuilder';
|
||||
import { createButton, createLabel, createPanel, createUINode, hex, StyledButton } from './ui/UiBuilder';
|
||||
|
||||
const { ccclass } = _decorator;
|
||||
|
||||
@@ -19,6 +22,9 @@ export class MainController extends Component {
|
||||
private lobbyView!: LobbyView;
|
||||
private playView!: PlayView;
|
||||
private mockCapsuleNode: Node | null = null;
|
||||
private sampleBarNode: Node | null = null;
|
||||
private sampleBarBtns: { key: string; btn: StyledButton }[] = [];
|
||||
private activeSampleKey: string | null = null;
|
||||
|
||||
protected onLoad(): void {
|
||||
applyResponsivePolicy();
|
||||
@@ -53,7 +59,20 @@ export class MainController extends Component {
|
||||
game.on(Game.EVENT_SHOW, this.onAppShow, this);
|
||||
view.on('canvas-resize', this.onCanvasResize, this);
|
||||
this.applyLayoutMetrics();
|
||||
this.showLobby();
|
||||
|
||||
const sampleParam = PREVIEW && typeof window !== 'undefined'
|
||||
? new URLSearchParams(window.location?.search ?? '').get('sample')
|
||||
: null;
|
||||
const sampleEntry = findValidationSample(sampleParam);
|
||||
if (sampleEntry) {
|
||||
this.enterValidationSample(sampleEntry);
|
||||
} else if (sampleParam === '024') {
|
||||
this.lobbyView.node.active = false;
|
||||
this.playView.node.active = true;
|
||||
this.playView.loadCustomLevel(RELEASE_LEVELS[23], '样板 024 · 晨露叶桥');
|
||||
} else {
|
||||
this.showLobby();
|
||||
}
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
@@ -72,6 +91,70 @@ export class MainController extends Component {
|
||||
this.lobbyView?.applyScreenMetrics(metrics);
|
||||
this.playView?.applyScreenMetrics(metrics);
|
||||
this.syncMockWeChatCapsule(metrics);
|
||||
this.syncSampleBarPosition(metrics);
|
||||
}
|
||||
|
||||
/** 仅在 PREVIEW 且 URL 带 ?sample= 时显示底部紧凑样板切换条,便于手机一指切换对照测试 */
|
||||
private ensureSampleBar(): void {
|
||||
if (!PREVIEW || this.sampleBarNode) return;
|
||||
const bar = createPanel('SampleSwitcherBar', 726, 48, {
|
||||
fill: '#2f1e10e8',
|
||||
stroke: '#d8b06a',
|
||||
strokeWidth: 1.6,
|
||||
radius: 16,
|
||||
depth: 3,
|
||||
depthColor: '#1a0f07',
|
||||
}, this.node);
|
||||
this.sampleBarNode = bar.node;
|
||||
this.sampleBarBtns = [];
|
||||
const count = VALIDATION_SAMPLES.length;
|
||||
const btnW = 134;
|
||||
const gap = 8;
|
||||
const totalW = count * btnW + (count - 1) * gap;
|
||||
VALIDATION_SAMPLES.forEach((entry, idx) => {
|
||||
const x = -totalW / 2 + btnW / 2 + idx * (btnW + gap);
|
||||
const btn = createButton({
|
||||
name: `SampleBtn_${entry.key}`,
|
||||
text: entry.shortLabel,
|
||||
w: btnW,
|
||||
h: 34,
|
||||
radius: 12,
|
||||
fill: '#f3e5c7',
|
||||
stroke: '#c9a367',
|
||||
depth: 2,
|
||||
depthColor: '#9c7843',
|
||||
textColor: '#482e14',
|
||||
fontSize: 15,
|
||||
onClick: () => this.enterValidationSample(entry),
|
||||
}, bar.node);
|
||||
btn.node.setPosition(x, 0, 0);
|
||||
this.sampleBarBtns.push({ key: entry.key, btn });
|
||||
});
|
||||
this.syncSampleBarPosition(computeScreenMetrics());
|
||||
}
|
||||
|
||||
private syncSampleBarPosition(m: ScreenMetrics): void {
|
||||
if (!this.sampleBarNode) return;
|
||||
const bottomSafe = Math.min(54, Math.max(0, m.bottomInset));
|
||||
this.sampleBarNode.setPosition(0, -m.visibleH / 2 + bottomSafe + 28, 0);
|
||||
}
|
||||
|
||||
private refreshSampleBarHighlight(): void {
|
||||
for (const item of this.sampleBarBtns) {
|
||||
const active = item.key === this.activeSampleKey;
|
||||
item.btn.label.color = hex(active ? '#9f2f23' : '#482e14');
|
||||
item.btn.node.setScale(active ? 1.05 : 1, active ? 1.05 : 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
private enterValidationSample(entry: ValidationSampleEntry): void {
|
||||
this.activeSampleKey = entry.key;
|
||||
this.ensureSampleBar();
|
||||
if (this.sampleBarNode) this.sampleBarNode.active = true;
|
||||
this.refreshSampleBarHighlight();
|
||||
this.lobbyView.node.active = false;
|
||||
this.playView.node.active = true;
|
||||
this.playView.loadCustomLevel(entry.level, entry.headerTitle);
|
||||
}
|
||||
|
||||
/** 仅在浏览器 URL 带 ?wxsim=iphone15 或 ?wxsim=iphonese 时绘制模拟微信胶囊,方便真机前目视验收 */
|
||||
@@ -110,6 +193,7 @@ export class MainController extends Component {
|
||||
|
||||
private showLobby(): void {
|
||||
this.atelier?.settleIdle(Date.now());
|
||||
if (this.sampleBarNode) this.sampleBarNode.active = false;
|
||||
this.playView.node.active = false;
|
||||
this.lobbyView.node.active = true;
|
||||
this.lobbyView.refresh();
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
import { NEST } from './LevelData';
|
||||
import { LEAF_BRIDGE_PREVIEW } from './UnspoolLevels';
|
||||
import type { ChapterDef, LevelDef, OldStrandDef, Point2D, SectionDef, TargetColor } from './Types';
|
||||
|
||||
export const RELEASE_CHAPTERS: ChapterDef[] = [
|
||||
{ id: 'unspool-scarf', index: 0, startIndex: 0, count: 10, motif: 'custom', name: '第一章 · 初拆旧围巾', subtitle: '认识线头与三格线碗' },
|
||||
{ id: 'unspool-box', index: 1, startIndex: 10, count: 10, motif: 'custom', name: '第二章 · 两格针线盒', subtitle: '先送一团,再给下层留位' },
|
||||
{ id: 'unspool-bridge', index: 2, startIndex: 20, count: 10, motif: 'custom', name: '第三章 · 叶桥与花锁', subtitle: '用落针改变下一条路' },
|
||||
];
|
||||
|
||||
export const RELEASE_CHAPTER_LABELS = {
|
||||
zh: ['初拆', '两格', '叶桥'],
|
||||
en: ['Scarf', 'Bowls', 'Bridge'],
|
||||
};
|
||||
|
||||
type Key = 'a' | 'b' | 'c' | 'd' | 'e' | 'f';
|
||||
type Needle = [key: Key, color: TargetColor, x: number, y: number, shape: NonNullable<SectionDef['patch']>];
|
||||
type Pond = [x: number, y: number, rx: number, ry: number, bridge?: Key];
|
||||
|
||||
interface Pattern {
|
||||
name: string;
|
||||
rank: 1 | 2 | 3 | 4;
|
||||
goal: string;
|
||||
needles: Needle[];
|
||||
piles: Key[][];
|
||||
locks?: Partial<Record<Key, Key>>;
|
||||
ponds?: Pond[];
|
||||
}
|
||||
|
||||
const patterns: Pattern[] = [
|
||||
{ name: '第一根线', rank: 1, goal: '点亮金线头,再拖蚂蚁把线送到花心。', needles: [['a','gold',300,228,'flower']], piles: [['a']] },
|
||||
{ name: '围巾的一层边', rank: 1, goal: '浅杏线压着金线,先从露出的线头拆起。', needles: [['a','coral',214,292,'leaf'],['b','gold',348,212,'flower']], piles: [['a','b']] },
|
||||
{ name: '双瓣初开', rank: 1, goal: '两根金线可分开送,也可以让一只蚂蚁串两团。', needles: [['a','gold',219,214,'flower'],['b','gold',376,219,'flower']], piles: [['a'],['b']] },
|
||||
{ name: '一金一绿', rank: 1, goal: '金线织花,绿线补上叶尖。', needles: [['a','gold',273,188,'flower'],['b','green',353,316,'leaf']], piles: [['a'],['b']] },
|
||||
{ name: '露出线头', rank: 2, goal: '看清哪根旧线压住下一层,顺势拆出花与叶。', needles: [['a','green',230,315,'leaf'],['b','gold',322,185,'flower'],['c','rose',375,298,'flower']], piles: [['a','b'],['c']] },
|
||||
{ name: '左右花瓣', rank: 2, goal: '从两组旧线拆出材料,补齐两侧花瓣。', needles: [['a','rose',179,246,'flower'],['b','green',239,345,'leaf'],['c','rose',426,231,'flower'],['d','gold',355,297,'flower']], piles: [['a','b'],['c','d']] },
|
||||
{ name: '午后茶花', rank: 1, goal: '两个粉线头都露着,织一朵左右相合的茶花。', needles: [['a','rose',252,240,'flower'],['b','rose',346,205,'flower']], piles: [['a'],['b']] },
|
||||
{ name: '水边的小芽', rank: 2, goal: '拖线时从水洼边绕过去。', needles: [['a','green',223,289,'leaf'],['b','gold',385,219,'flower']], piles: [['a'],['b']], ponds: [[327,391,72,28]] },
|
||||
{ name: '针线盒归位', rank: 2, goal: '用三个线碗安排双金和一片绿叶。', needles: [['a','gold',197,212,'flower'],['b','gold',405,199,'flower'],['c','green',300,313,'leaf']], piles: [['a'],['b'],['c']] },
|
||||
{ name: '围巾里的向日葵', rank: 3, goal: '绿叶先绣会开花锁,记得留下可用线碗。', needles: [['a','gold',205,207,'flower'],['b','green',240,315,'leaf'],['c','gold',378,204,'flower'],['d','rose',408,322,'flower']], piles: [['a','b'],['c','d']], locks: {a:'b'} },
|
||||
|
||||
{ name: '两只浅槽', rank: 1, goal: '落针后腾出的空碗,可以立刻装下一团。', needles: [['a','sky',208,239,'bell'],['b','gold',378,220,'bell']], piles: [['a'],['b']] },
|
||||
{ name: '先送眼前的一团', rank: 2, goal: '三个线头只有两个碗,先送已经能落针的一团。', needles: [['a','rose',195,221,'bell'],['b','gold',302,184,'bell'],['c','sky',401,267,'bell']], piles: [['a'],['b'],['c']] },
|
||||
{ name: '细边两卷', rank: 2, goal: '同一组旧线有三层,拆到一半就要先织。', needles: [['a','green',202,315,'leaf'],['b','rose',314,240,'bell'],['c','gold',392,183,'bell']], piles: [['a','b','c']] },
|
||||
{ name: '空格留给同色', rank: 2, goal: '先让双金各占一格,可以一笔送到两个针位。', needles: [['a','green',249,341,'leaf'],['b','gold',184,207,'bell'],['c','gold',393,206,'bell']], piles: [['a'],['b'],['c']] },
|
||||
{ name: '星星露一角', rank: 3, goal: '金针还锁着,先保留能取绿线的空位。', needles: [['a','gold',197,193,'bell'],['b','green',258,329,'leaf'],['c','rose',406,260,'bell']], piles: [['a','b'],['c']], locks: {a:'b'} },
|
||||
{ name: '锁上挂绳', rank: 3, goal: '绿叶开粉锁,粉铃再打开金铃。', needles: [['a','rose',223,206,'bell'],['b','green',300,322,'leaf'],['c','gold',410,220,'bell']], piles: [['a','b'],['c']], locks: {a:'b',c:'a'} },
|
||||
{ name: '两瓣余香', rank: 2, goal: '并排两根线,顺手织完两枚小风铃。', needles: [['a','rose',236,230,'bell'],['b','rose',358,274,'bell']], piles: [['a'],['b']] },
|
||||
{ name: '两种铃声', rank: 3, goal: '先拆左、先拆右都可行,先取到的绿线会打开不同落点。', needles: [['a','rose',188,219,'bell'],['b','green',218,328,'leaf'],['c','gold',411,219,'bell'],['d','green',381,327,'leaf']], piles: [['a','b'],['c','d']], locks: {a:'b',c:'d'} },
|
||||
{ name: '三卷一花', rank: 3, goal: '先送走一团好用的线,再取到要搭档的第二团金线。', needles: [['a','sky',240,288,'bell'],['b','gold',203,199,'bell'],['c','rose',383,304,'bell'],['d','gold',396,189,'bell']], piles: [['a','b'],['c','d']], locks: {d:'a'} },
|
||||
{ name: '风铃穿针盒', rank: 4, goal: '蓝纹能搭桥,绿结能开锁。先看准备走哪边。', needles: [['a','rose',190,195,'bell'],['b','green',211,315,'leaf'],['c','gold',416,203,'bell'],['d','sky',381,289,'ripple'],['e','coral',308,155,'flower']], piles: [['a','b'],['c','d'],['e']], locks: {a:'b',c:'d',e:'a'}, ponds: [[321,391,76,20,'d']] },
|
||||
|
||||
{ name: '露珠与小荷', rank: 2, goal: '先送一团绿线补叶,粉荷才会打开。', needles: [['a','green',195,300,'leaf'],['b','rose',365,209,'flower']], piles: [['a'],['b']], locks: {b:'a'} },
|
||||
{ name: '金蕊睡莲', rank: 2, goal: '金线先抽出来,给下层的绿线留一格。', needles: [['a','gold',361,208,'flower'],['b','green',234,318,'leaf']], piles: [['a','b']], locks: {a:'b'} },
|
||||
{ name: '荷叶渡', rank: 3, goal: '可以先织叶搭桥,也可以让金舟先沿岸绕行。', needles: [['a','green',212,317,'leaf'],['b','gold',378,221,'boat'],['c','sky',307,276,'ripple']], piles: [['a'],['b','c']], ponds: [[298,392,91,25,'a']] },
|
||||
{ name: '晨露叶桥', rank: 3, goal: '两根金线里,有一根压住绿线。留一格给绿线搭桥。', needles: [['a','gold',219,199,'flower'],['b','green',357,315,'leaf'],['c','gold',381,199,'flower']], piles: [['a','b'],['c']], locks: {a:'b',c:'b'}, ponds: [[298,392,82,24,'b']] },
|
||||
{ name: '双叶金盏', rank: 3, goal: '两片绿叶各开一侧花锁,先决定哪一格留给底层。', needles: [['a','gold',190,199,'flower'],['b','green',223,322,'leaf'],['c','gold',407,195,'flower'],['d','green',375,322,'leaf']], piles: [['a','d'],['c','b']], locks: {a:'d',c:'b'} },
|
||||
{ name: '水田双桥', rank: 4, goal: '左右都能先搭桥。先开哪座桥会决定手里的线先去哪里。', needles: [['a','rose',182,181,'flower'],['b','green',205,304,'leaf'],['c','gold',418,179,'flower'],['d','sky',397,306,'ripple'],['e','coral',302,227,'flower']], piles: [['a','b'],['c','d'],['e']], locks: {a:'d',c:'b',e:'b'}, ponds: [[222,380,65,20,'b'],[381,381,65,20,'d']] },
|
||||
{ name: '扁舟靠岸', rank: 2, goal: '两团露线,补齐近岸舟身和水纹。', needles: [['a','gold',244,247,'boat'],['b','sky',367,302,'ripple']], piles: [['a'],['b']] },
|
||||
{ name: '荷茎上的两瓣', rank: 4, goal: '先织能开路的叶子,留意同色两瓣谁先解锁。', needles: [['a','rose',200,212,'flower'],['b','green',234,325,'leaf'],['c','rose',405,196,'flower'],['d','green',387,309,'leaf'],['e','sky',298,253,'ripple']], piles: [['a','b'],['c','d'],['e']], locks: {a:'b',c:'e',e:'d'}, ponds: [[278,383,72,23,'b']] },
|
||||
{ name: '并蒂荷与叶桥', rank: 4, goal: '一处绿叶开桥,另一处开花锁。两团线占槽前,想好先开哪边。', needles: [['a','gold',202,182,'flower'],['b','green',226,305,'leaf'],['c','rose',397,192,'flower'],['d','sky',373,302,'ripple'],['e','coral',302,149,'flower']], piles: [['a','b'],['c','d'],['e']], locks: {a:'d',c:'b',e:'c'}, ponds: [[266,389,88,22,'b']] },
|
||||
{ name: '荷塘夜灯', rank: 4, goal: '两座桥各放开一条路。选一侧起手,留出碗位给压层里的灯线。', needles: [['a','gold',182,191,'bell'],['b','green',195,306,'leaf'],['c','rose',421,190,'flower'],['d','sky',400,304,'ripple'],['e','coral',294,221,'flower'],['f','gold',300,141,'bell']], piles: [['a','b'],['c','d'],['e','f']], locks: {a:'d',c:'b',e:'b',f:'e'}, ponds: [[223,385,73,22,'b'],[380,386,73,22,'d']] },
|
||||
];
|
||||
|
||||
function buildStage(pattern: Pattern, index: number): LevelDef {
|
||||
const chapter = Math.floor(index / 10);
|
||||
const id = `unspool-release-${index + 1}`;
|
||||
const needleId = (key: Key) => `${id}-${key}`;
|
||||
const targets = pattern.needles.map(([key, color, x, y, patch]) => ({
|
||||
id: needleId(key), color, x, y, patch, rx: patch === 'ripple' ? 39 : 32, ry: patch === 'ripple' ? 23 : 31,
|
||||
}));
|
||||
const byKey = new Map(pattern.needles.map(needle => [needle[0], needle[1]]));
|
||||
const strands: OldStrandDef[] = [];
|
||||
pattern.piles.forEach((pile, column) => {
|
||||
const width = 504 / pattern.piles.length;
|
||||
const left = 28 + column * width;
|
||||
const mirror = (index + column) % 2 === 0;
|
||||
for (let depth = pile.length - 1; depth >= 0; depth--) {
|
||||
const key = pile[depth];
|
||||
const x = (fraction: number) => left + width * (mirror ? fraction : 1 - fraction);
|
||||
const tip = 0.82 - depth * 0.25;
|
||||
const points: [number, number][] = depth === 0
|
||||
? [[x(.15), 24], [x(.39), 38], [x(.59), 72], [x(tip), 105]]
|
||||
: [[x(.13), 82 + (depth - 1) * 20], [x(.34), 67 + (depth - 1) * 24], [x(.60), 62 + (depth - 1) * 22], [x(tip), 50 + (depth - 1) * 15]];
|
||||
strands.push({ id: needleId(key), color: byKey.get(key)!, points, coveredBy: depth ? [needleId(pile[depth - 1])] : [] });
|
||||
}
|
||||
});
|
||||
const userSlots = chapter === 0 ? [176, 300, 424] : [186, 414];
|
||||
const slots: Point2D[] = userSlots.map((x, slot) => ({
|
||||
x, y: chapter === 0 && slot === 1 ? 458 : 475,
|
||||
}));
|
||||
const locks: Record<string, string> = {};
|
||||
const patternLocks = pattern.locks ?? {};
|
||||
for (const key of Object.keys(patternLocks) as Key[]) {
|
||||
const dependsOn = patternLocks[key];
|
||||
if (dependsOn) locks[needleId(key)] = needleId(dependsOn);
|
||||
}
|
||||
const level: LevelDef = {
|
||||
id, chapter, name: pattern.name, difficulty: `D${pattern.rank}`, lesson: pattern.goal, goal: pattern.goal,
|
||||
ruleTag: ['抽线与落针', '两格取线', '叶桥与花锁'][chapter], motif: 'custom',
|
||||
nests: [{ ...NEST }], balls: [], targets, locks,
|
||||
ponds: (pattern.ponds ?? []).map(([x,y,rx,ry,bridge]) => ({ x, y, rx, ry, bridgeSectionId: bridge ? needleId(bridge) : undefined })),
|
||||
spools: [], buttons: [], dyes: [], gates: [], roughZones: [],
|
||||
threeStar: 420 * targets.length * (pattern.rank >= 3 ? 1.1 : 1.25),
|
||||
twoStar: 510 * targets.length * (pattern.rank >= 3 ? 1.1 : 1.25),
|
||||
demo: [],
|
||||
unspool: { slots, strands, storyTitle: ['旧围巾', '旧针线袋', '旧荷包'][chapter], storyNote: pattern.goal },
|
||||
};
|
||||
if (index === 23) {
|
||||
// This blueprint was already tested with the physical drag UI.
|
||||
const preview = LEAF_BRIDGE_PREVIEW.level;
|
||||
level.unspool = preview.unspool;
|
||||
level.threeStar = preview.threeStar;
|
||||
level.twoStar = preview.twoStar;
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
export const RELEASE_LEVELS: LevelDef[] = patterns.map(buildStage);
|
||||
|
||||
export function isReleaseStageOpen(index: number, hasCleared: (level: LevelDef) => boolean): boolean {
|
||||
return index >= 0 && index < RELEASE_LEVELS.length && (index === 0 || hasCleared(RELEASE_LEVELS[index - 1]));
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "56e03130-f18b-4bfa-9d90-465f36b53019",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -11,6 +11,8 @@ import {
|
||||
GateEvent,
|
||||
HintState,
|
||||
LevelDef,
|
||||
OldClothClipDef,
|
||||
OldStrandDef,
|
||||
PickEvent,
|
||||
Point2D,
|
||||
PondDef,
|
||||
@@ -20,6 +22,7 @@ import {
|
||||
SpoolDef,
|
||||
SpoolEvent,
|
||||
TargetColor,
|
||||
UnspoolConfig,
|
||||
YarnColor,
|
||||
} from './Types';
|
||||
|
||||
@@ -183,6 +186,40 @@ export function isPondBridged(pond: PondDef, lines: RouteState[]): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isClipUnlocked(
|
||||
clip: OldClothClipDef,
|
||||
lines: RouteState[],
|
||||
drawing?: RouteState | null,
|
||||
): boolean {
|
||||
for (const line of lines) {
|
||||
if (line.deliveries.some(d => d.target.id === clip.unlockSectionId)) return true;
|
||||
}
|
||||
if (drawing && drawing.deliveries.some(d => d.target.id === clip.unlockSectionId)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isStrandClipLocked(
|
||||
config: UnspoolConfig,
|
||||
strand: OldStrandDef,
|
||||
lines: RouteState[],
|
||||
): OldClothClipDef | null {
|
||||
if (!strand.clipId || !config.clips?.length) return null;
|
||||
const clip = config.clips.find(c => c.id === strand.clipId);
|
||||
if (!clip) return null;
|
||||
return isClipUnlocked(clip, lines) ? null : clip;
|
||||
}
|
||||
|
||||
export function isStrandExposed(
|
||||
config: UnspoolConfig,
|
||||
strand: OldStrandDef,
|
||||
removedIds: Set<string>,
|
||||
lines: RouteState[],
|
||||
): boolean {
|
||||
if (removedIds.has(strand.id)) return false;
|
||||
if (isStrandClipLocked(config, strand, lines)) return false;
|
||||
return strand.coveredBy.every(cid => removedIds.has(cid));
|
||||
}
|
||||
|
||||
export function isTargetLocked(
|
||||
level: LevelDef,
|
||||
targetId: string,
|
||||
|
||||
@@ -159,6 +159,13 @@ export class SoundService {
|
||||
this.playTone(587, 0.08, 0, { type: 'sine', volume: 0.06, slideTo: 880 });
|
||||
}
|
||||
|
||||
/** 「拆旧织新」抽线解压音效:轻快上升丝线抽拉 + 卷球落碗啵声 */
|
||||
public unspool(): void {
|
||||
this.playTone(392, 0.065, 0, { type: 'triangle', volume: 0.045, slideTo: 523 });
|
||||
this.playTone(523, 0.075, 0.06, { type: 'triangle', volume: 0.048, slideTo: 659 });
|
||||
this.playTone(784, 0.13, 0.13, { type: 'sine', volume: 0.06, slideTo: 988 });
|
||||
}
|
||||
|
||||
public button(): void {
|
||||
this.playTone(784, 0.055, 0, { volume: 0.05 });
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ export interface SectionDef {
|
||||
ry: number;
|
||||
color: TargetColor;
|
||||
petals?: number[];
|
||||
patch?: 'flower' | 'leaf' | 'bell' | 'ripple' | 'boat';
|
||||
side?: number;
|
||||
lotus?: 'bloom' | 'bud' | 'pad-left' | 'pad-right';
|
||||
sakura?: 'left' | 'top' | 'right' | 'bird' | 'leaf';
|
||||
@@ -97,6 +98,67 @@ export interface ChapterDef {
|
||||
count: number;
|
||||
}
|
||||
|
||||
/** 「拆旧织新」旧布木夹:绣完指定针位后松开夹子,解锁该区域内的旧线 */
|
||||
export interface OldClothClipDef {
|
||||
id: string;
|
||||
/** 被夹住的旧布区域(旧绣片局部坐标 0..560 x 0..136) */
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
/** 必须先绣完的绣面针位 ID */
|
||||
unlockSectionId: string;
|
||||
/** 木夹与对应针位共用的辨识色与纹样 */
|
||||
badgeColor: TargetColor;
|
||||
badgeShape: 'leaf' | 'flower' | 'bell' | 'ripple';
|
||||
/** 木夹上的简短标注 */
|
||||
label?: string;
|
||||
}
|
||||
|
||||
/** 「拆旧织新」旧绣片上的一根可分层抽取的旧毛线 */
|
||||
export interface OldStrandDef {
|
||||
id: string;
|
||||
color: YarnColor;
|
||||
/** 旧绣片画布局部坐标 (0..560 x 0..136) */
|
||||
points: [number, number][];
|
||||
/** 压在该线上方的线 ID(全部抽走后才露出可抽) */
|
||||
coveredBy: string[];
|
||||
/** 若属于某个被木夹夹住的旧布区,需对应旧夹松开后才可抽取 */
|
||||
clipId?: string;
|
||||
/** 可选指定落入的供线位索引(多巢空间供线时使用) */
|
||||
slotIndex?: number;
|
||||
}
|
||||
|
||||
export interface UnspoolConfig {
|
||||
/** 绣绷内的固定线碗位置(紧挨蚁巢,抽出的球落入空碗成为标准毛线球) */
|
||||
slots: Point2D[];
|
||||
/** 同时最多可暂存的毛线球数(省略时等于 slots.length) */
|
||||
capacity?: number;
|
||||
/** 可选两片旧布拼接分界 X 坐标(0..560) */
|
||||
patchDividerX?: number;
|
||||
/** 可选旧布木夹列表(「新针开旧夹」) */
|
||||
clips?: OldClothClipDef[];
|
||||
/** 按从底层到顶层排列的旧线列表 */
|
||||
strands: OldStrandDef[];
|
||||
storyTitle: string;
|
||||
storyNote: string;
|
||||
}
|
||||
|
||||
export interface UnspoolRuntimeState {
|
||||
/** 已经彻底抽完的线 ID */
|
||||
removedIds: string[];
|
||||
/** 正在播放逐段缩回动效的线 */
|
||||
animating: { strandId: string; progress: number; slotIndex: number } | null;
|
||||
/** 每个线碗里当前存放的 ballId(null 表示空碗) */
|
||||
slotBallIds: (number | null)[];
|
||||
/** 是否触发满槽死锁提示 */
|
||||
deadlocked: boolean;
|
||||
/** 点击被夹旧布时,高亮脉冲对应开夹针位 ID */
|
||||
pulseTargetId?: string | null;
|
||||
/** 高亮脉冲截止时间戳(ms) */
|
||||
pulseUntil?: number;
|
||||
}
|
||||
|
||||
export interface LevelDef {
|
||||
id: string;
|
||||
recordId?: string;
|
||||
@@ -129,6 +191,8 @@ export interface LevelDef {
|
||||
twoStar: number;
|
||||
/** 每笔演示折线(首点必须是某个蚁巢坐标) */
|
||||
demo: [number, number][][];
|
||||
/** 若存在,则本关启用「拆旧织新」旧绣片分层抽线 + 绣绷线碗模式 */
|
||||
unspool?: UnspoolConfig;
|
||||
}
|
||||
|
||||
export interface PickEvent {
|
||||
@@ -250,6 +314,8 @@ export interface GameState {
|
||||
/** 本关是否看过演示(重来/重绣不清空,仅换关时重置) */
|
||||
demoWatched: boolean;
|
||||
hint: HintState | null;
|
||||
/** 「拆旧织新」运行态(普通 60 关为 null) */
|
||||
unspool?: UnspoolRuntimeState | null;
|
||||
}
|
||||
|
||||
export interface RecordEntry {
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
import { MOTIFS, NEST } from './LevelData';
|
||||
import { LevelDef, MotifId, SectionDef } from './Types';
|
||||
|
||||
function pickSections(motif: MotifId, ids: string[]): SectionDef[] {
|
||||
return ids.map(id => {
|
||||
const hit = MOTIFS[motif].find(s => s.id === id);
|
||||
if (!hit) throw new Error(`Unknown section "${id}" in motif "${motif}"`);
|
||||
return hit;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 「拆旧织新」特别番外原型(3 关渐进验证):
|
||||
* - 番外 1:自由抽线体验(旧绣片无压层,感受抽线卷球滚入绣绷线碗 + 蚂蚁织画)
|
||||
* - 番外 2:2 格线碗 + 压层 + 浮桥铜锁(验证“先抽压住绿线的左金线”核心顿悟)
|
||||
* - 番外 3:双层压叠 + 不交叉 + 连锁锁桥(验证两步前瞻规划与双可行续法)
|
||||
*/
|
||||
export const UNSPOOL_LEVELS: LevelDef[] = [
|
||||
{
|
||||
id: 'unspool-1-scarf',
|
||||
chapter: 0,
|
||||
name: '旧围巾第一缕',
|
||||
difficulty: '番外入门',
|
||||
lesson: '点击或轻划上方旧绣片发光的线头,把旧毛线抽进绣绷线碗,再拖蚂蚁织成新花!',
|
||||
goal: '拆下 3 缕旧毛线,补齐向日葵左右花瓣与绿叶。',
|
||||
ruleTag: '拆旧织新 · 入门',
|
||||
motif: 'sunflower',
|
||||
budget: 1450,
|
||||
nests: [{ ...NEST }],
|
||||
targets: pickSections('sunflower', ['left', 'right', 'leaf']),
|
||||
balls: [],
|
||||
ponds: [],
|
||||
spools: [],
|
||||
buttons: [],
|
||||
dyes: [],
|
||||
gates: [],
|
||||
roughZones: [],
|
||||
threeStar: 1120,
|
||||
twoStar: 1320,
|
||||
demo: [],
|
||||
unspool: {
|
||||
storyTitle: '特别委托 · 旧围巾改织新画(1/3)',
|
||||
storyNote: '林阿婆翻出一条褪边的小围巾,想拆下旧毛线给茶室织一朵新向日葵。',
|
||||
slots: [
|
||||
{ x: 186, y: 468 },
|
||||
{ x: 414, y: 468 },
|
||||
],
|
||||
strands: [
|
||||
{
|
||||
id: 'u1-gold-l',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
points: [[54, 42], [110, 28], [156, 58], [122, 98], [72, 102]],
|
||||
},
|
||||
{
|
||||
id: 'u1-green',
|
||||
color: 'green',
|
||||
coveredBy: [],
|
||||
points: [[236, 98], [268, 42], [304, 34], [336, 76], [294, 106]],
|
||||
},
|
||||
{
|
||||
id: 'u1-gold-r',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
points: [[414, 36], [472, 30], [506, 68], [468, 104], [418, 92]],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'unspool-2-lock-bridge',
|
||||
chapter: 0,
|
||||
name: '压线解锁桥',
|
||||
difficulty: '番外进阶',
|
||||
lesson: '两格线碗有限!两片金花瓣都上了铜锁,必须先抽走压住绿线的那缕金线,拆出绿线搭桥解锁!',
|
||||
goal: '先拆压层取绿线绣叶搭桥解锁,再双球绣齐金花瓣。',
|
||||
ruleTag: '2 格线碗 · 压层解锁',
|
||||
motif: 'sunflower',
|
||||
budget: 1480,
|
||||
locks: { left: 'leaf', right: 'leaf' },
|
||||
nests: [{ ...NEST }],
|
||||
targets: pickSections('sunflower', ['left', 'right', 'leaf']),
|
||||
balls: [],
|
||||
ponds: [{ x: 298, y: 392, rx: 82, ry: 24, bridgeSectionId: 'leaf' }],
|
||||
spools: [],
|
||||
buttons: [],
|
||||
dyes: [],
|
||||
gates: [],
|
||||
roughZones: [],
|
||||
threeStar: 1180,
|
||||
twoStar: 1380,
|
||||
demo: [],
|
||||
unspool: {
|
||||
storyTitle: '特别委托 · 旧围巾改织新画(2/3)',
|
||||
storyNote: '旧绣片里绿线被左侧金线压在底下;线碗只有两格,先抽哪缕金线决定能不能过河!',
|
||||
slots: [
|
||||
{ x: 186, y: 474 },
|
||||
{ x: 414, y: 474 },
|
||||
],
|
||||
strands: [
|
||||
// 底层绿线(被左金线压住,清晰从下方透出绿色)
|
||||
{
|
||||
id: 'u2-green',
|
||||
color: 'green',
|
||||
coveredBy: ['u2-gold-l'],
|
||||
points: [[96, 78], [134, 68], [182, 67], [238, 73], [296, 68]],
|
||||
},
|
||||
// 顶层左金线(斜跨压住绿线)
|
||||
{
|
||||
id: 'u2-gold-l',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
points: [[142, 24], [164, 39], [188, 65], [206, 91], [228, 110]],
|
||||
},
|
||||
// 顶层右金线(独立露在最上层,误先抽它会与左金线一起堵满 2 格线碗)
|
||||
{
|
||||
id: 'u2-gold-r',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
points: [[386, 32], [425, 27], [465, 42], [480, 69], [468, 91], [428, 108]],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'unspool-3-double-lotus',
|
||||
chapter: 1,
|
||||
name: '双层织晨荷',
|
||||
difficulty: '番外挑战',
|
||||
lesson: '双层压线 + 不交叉 + 连锁锁桥!先解开左侧压层拿到绿叶搭桥,再灵活安排后续两缕旧线。',
|
||||
goal: '不交叉避水,逐层拆出两绿两粉,绣成晨荷四区。',
|
||||
ruleTag: '双层压叠 · 连锁锁桥',
|
||||
motif: 'lotus',
|
||||
noCross: true,
|
||||
budget: 2150,
|
||||
locks: { 'lotus-flower': 'lotus-pad-left', 'lotus-bud': 'lotus-pad-right' },
|
||||
nests: [{ ...NEST }],
|
||||
targets: pickSections('lotus', ['lotus-pad-left', 'lotus-pad-right', 'lotus-flower', 'lotus-bud']),
|
||||
balls: [],
|
||||
ponds: [{ x: 296, y: 382, rx: 74, ry: 22, bridgeSectionId: 'lotus-pad-left' }],
|
||||
spools: [],
|
||||
buttons: [],
|
||||
dyes: [],
|
||||
gates: [],
|
||||
roughZones: [],
|
||||
threeStar: 1760,
|
||||
twoStar: 2020,
|
||||
demo: [],
|
||||
unspool: {
|
||||
storyTitle: '特别委托 · 旧围巾改织新画(3/3)',
|
||||
storyNote: '两缕翠绿丝线层层叠在旧荷帕底下;留好空碗与过桥顺序,让旧线重新开出双荷。',
|
||||
slots: [
|
||||
{ x: 186, y: 478 },
|
||||
{ x: 414, y: 478 },
|
||||
],
|
||||
strands: [
|
||||
// 最底层:第二缕绿线(被中层绿线压住)
|
||||
{
|
||||
id: 'u3-green-2',
|
||||
color: 'green',
|
||||
coveredBy: ['u3-green-1'],
|
||||
points: [[204, 104], [268, 86], [334, 86], [386, 104]],
|
||||
},
|
||||
// 中层:第一缕绿线(压住 u3-green-2,同时被左粉线压住)
|
||||
{
|
||||
id: 'u3-green-1',
|
||||
color: 'green',
|
||||
coveredBy: ['u3-rose-l'],
|
||||
points: [[96, 62], [178, 66], [254, 84], [312, 54]],
|
||||
},
|
||||
// 顶层左粉线(压住 u3-green-1)
|
||||
{
|
||||
id: 'u3-rose-l',
|
||||
color: 'rose',
|
||||
coveredBy: [],
|
||||
points: [[130, 24], [174, 66], [198, 112]],
|
||||
},
|
||||
// 顶层右粉线(露在最上层的诱饵,先抽双粉会堵碗)
|
||||
{
|
||||
id: 'u3-rose-r',
|
||||
color: 'rose',
|
||||
coveredBy: [],
|
||||
points: [[416, 28], [472, 46], [496, 92], [438, 106]],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const lockBridgePrototype = UNSPOOL_LEVELS[1];
|
||||
|
||||
export const LEAF_BRIDGE_PREVIEW: { number: number; level: LevelDef } = {
|
||||
number: 24,
|
||||
level: {
|
||||
...lockBridgePrototype,
|
||||
id: 'unspool-024-leaf-bridge',
|
||||
chapter: 2,
|
||||
name: '晨露叶桥',
|
||||
difficulty: '样板关',
|
||||
goal: '取旧线绣绿叶搭桥,再补齐两侧金瓣。',
|
||||
ruleTag: '压线 · 搭桥',
|
||||
unspool: {
|
||||
...lockBridgePrototype.unspool!,
|
||||
storyTitle: '旧荷包',
|
||||
storyNote: '拆出荷包里的三缕旧线,织成晨露叶桥。',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "000e926c-6884-45a9-b384-345f6ae6578b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,364 @@
|
||||
import { NEST } from './LevelData';
|
||||
import { RELEASE_LEVELS } from './ReleaseLevels';
|
||||
import type { LevelDef } from './Types';
|
||||
|
||||
export interface ValidationSampleEntry {
|
||||
key: '026a' | '026b' | '038a' | '039' | '051';
|
||||
shortLabel: string;
|
||||
headerTitle: string;
|
||||
hypothesis: string;
|
||||
level: LevelDef;
|
||||
}
|
||||
|
||||
const base026 = RELEASE_LEVELS[25];
|
||||
|
||||
/** 样板 026A:对照基准(现行 026 水田双桥,2 格线碗 + 三列竖栈) */
|
||||
const sample026A: LevelDef = {
|
||||
...base026,
|
||||
id: 'sample-026a',
|
||||
name: '水田双桥 · 2碗对照',
|
||||
difficulty: 'A对照',
|
||||
goal: 'A对照组:2 格碗 + 三列单栈。感受开局腾格压力与双桥顺序。',
|
||||
ruleTag: '2碗 · 竖栈对照',
|
||||
unspool: {
|
||||
...base026.unspool!,
|
||||
storyTitle: '026A · 2碗竖栈',
|
||||
storyNote: '对照组:两格线碗、三列互不交叉的竖向压层。',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 样板 026B:实验组(同盘面目标/双桥/交叉锁,改为 3 格线碗 + 真交叉压层)
|
||||
* - 底层绿 b 被「左粉 a + 中拱浅杏 e」双压(2 压 1)
|
||||
* - 底层蓝 d 被「右金 c + 中拱浅杏 e」双压(2 压 1)
|
||||
* - 中拱浅杏 e 同时压住绿 b 与蓝 d(1 压 2)
|
||||
* - 验证重点:小屏能否一眼读出「先拆中拱 e 配任意一侧」,且 3 碗下仍保留误拆 a+c 满碗的真实张力
|
||||
*/
|
||||
const sample026B: LevelDef = {
|
||||
...base026,
|
||||
id: 'sample-026b',
|
||||
name: '水田双桥 · 3碗交叉',
|
||||
difficulty: 'B实验',
|
||||
goal: 'B实验组:3 格碗 + 交叉压层。中拱浅杏线同时压着左右底层,读清压层再拆!',
|
||||
ruleTag: '3碗 · 交叉压层',
|
||||
unspool: {
|
||||
storyTitle: '026B · 3碗交叉',
|
||||
storyNote: '实验组:中拱浅杏同时压住绿、蓝两缕底层线,左粉与右金各压一侧。',
|
||||
slots: [
|
||||
{ x: 176, y: 474 },
|
||||
{ x: 300, y: 458 },
|
||||
{ x: 424, y: 474 },
|
||||
],
|
||||
strands: [
|
||||
// 底层左:绿 b(被 a 与 e 双压;线头在最左,距其他线头 > 100px)
|
||||
{
|
||||
id: 'unspool-release-26-b',
|
||||
color: 'green',
|
||||
coveredBy: ['unspool-release-26-a', 'unspool-release-26-e'],
|
||||
points: [[246, 84], [190, 76], [124, 78], [58, 86]],
|
||||
},
|
||||
// 底层右:蓝 d(被 c 与 e 双压;线头在最右)
|
||||
{
|
||||
id: 'unspool-release-26-d',
|
||||
color: 'sky',
|
||||
coveredBy: ['unspool-release-26-c', 'unspool-release-26-e'],
|
||||
points: [[314, 84], [370, 76], [436, 78], [502, 86]],
|
||||
},
|
||||
// 上层左斜:粉 a(压住绿 b,线头在左上)
|
||||
{
|
||||
id: 'unspool-release-26-a',
|
||||
color: 'rose',
|
||||
coveredBy: [],
|
||||
points: [[96, 114], [114, 82], [134, 50], [152, 22]],
|
||||
},
|
||||
// 上层右斜:金 c(压住蓝 d,线头在右上)
|
||||
{
|
||||
id: 'unspool-release-26-c',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
points: [[464, 114], [446, 82], [426, 50], [408, 22]],
|
||||
},
|
||||
// 上层中拱:浅杏 e(同时压住绿 b 与蓝 d,1 压 2 关键线,线头在右下拱脚)
|
||||
{
|
||||
id: 'unspool-release-26-e',
|
||||
color: 'coral',
|
||||
coveredBy: [],
|
||||
points: [[212, 112], [234, 72], [280, 32], [326, 72], [348, 112]],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 样板 038A:039 前置极简教学(双巢 + 不交叉,10 秒读懂「留一条外路」)
|
||||
* - 两个全露头线(金左、绿右)落入对应左右碗,但目标交叉在右上/左上
|
||||
* - 直觉斜穿正中会挡住另一色,需一笔走顺路、另一笔顺外侧弧线绕开
|
||||
*/
|
||||
const sample038A: LevelDef = {
|
||||
id: 'sample-038a',
|
||||
chapter: 3,
|
||||
name: '双巢让路 · 教学',
|
||||
difficulty: '前置教',
|
||||
lesson: '本关毛线不可交叉!先画的一笔会占路,试着给另一只蚂蚁留出绕行通道。',
|
||||
goal: '两巢不交叉:给另一色留一条外侧走廊,两笔成画。',
|
||||
ruleTag: '不交叉 · 前置教学',
|
||||
motif: 'custom',
|
||||
noCross: true,
|
||||
maxDispatches: 2,
|
||||
nests: [
|
||||
{ x: 148, y: 472 },
|
||||
{ x: 452, y: 472 },
|
||||
],
|
||||
balls: [],
|
||||
targets: [
|
||||
{ id: 's38a-gold', color: 'gold', x: 396, y: 234, rx: 32, ry: 31, patch: 'flower' },
|
||||
{ id: 's38a-green', color: 'green', x: 204, y: 234, rx: 32, ry: 31, patch: 'leaf' },
|
||||
],
|
||||
ponds: [],
|
||||
spools: [],
|
||||
buttons: [],
|
||||
dyes: [],
|
||||
gates: [],
|
||||
roughZones: [],
|
||||
threeStar: 1120,
|
||||
twoStar: 1320,
|
||||
demo: [],
|
||||
unspool: {
|
||||
storyTitle: '038A · 让路教学',
|
||||
storyNote: '拆下金、绿两缕线,体验不交叉条件下的双巢避让。',
|
||||
slots: [
|
||||
{ x: 184, y: 400 },
|
||||
{ x: 416, y: 400 },
|
||||
],
|
||||
strands: [
|
||||
{
|
||||
id: 's38a-gold',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
slotIndex: 0,
|
||||
points: [[72, 92], [134, 52], [218, 74]],
|
||||
},
|
||||
{
|
||||
id: 's38a-green',
|
||||
color: 'green',
|
||||
coveredBy: [],
|
||||
slotIndex: 1,
|
||||
points: [[488, 92], [426, 52], [342, 74]],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 样板 039:三巢让路(调近双解耗线差版本)
|
||||
* - 三巢、两格容量(三处空间供线位、同时最多占 2 格)、不交叉、最多 3 笔
|
||||
* - 方案 A(3 笔直达):左右巢分送双金,中巢直达绿叶(省线)
|
||||
* - 方案 B(2 笔串双金 + 绕外路):两格装双金后左巢一笔串送两金,再取绿球由中巢绕外侧避让(省笔)
|
||||
*/
|
||||
const sample039: LevelDef = {
|
||||
id: 'sample-039',
|
||||
chapter: 3,
|
||||
name: '三巢让路 · 双解',
|
||||
difficulty: 'D4样板',
|
||||
lesson: '同时最多暂存 2 团线,且毛线不可交叉!比较「三笔直达」与「两笔串双金 + 外圈让路」。',
|
||||
goal: '不交叉三巢:可用 3 笔分送省线,或 2 笔串双金留外路。',
|
||||
ruleTag: '三巢 · 不交叉双解',
|
||||
motif: 'custom',
|
||||
noCross: true,
|
||||
maxDispatches: 3,
|
||||
nests: [
|
||||
{ x: 152, y: 462 },
|
||||
{ x: 300, y: 504 },
|
||||
{ x: 448, y: 462 },
|
||||
],
|
||||
balls: [],
|
||||
targets: [
|
||||
{ id: 's39-gold-l', color: 'gold', x: 204, y: 244, rx: 30, ry: 30, patch: 'flower' },
|
||||
{ id: 's39-green', color: 'green', x: 300, y: 176, rx: 30, ry: 30, patch: 'leaf' },
|
||||
{ id: 's39-gold-r', color: 'gold', x: 396, y: 244, rx: 30, ry: 30, patch: 'flower' },
|
||||
],
|
||||
ponds: [],
|
||||
spools: [],
|
||||
buttons: [],
|
||||
dyes: [],
|
||||
gates: [],
|
||||
roughZones: [],
|
||||
threeStar: 1180,
|
||||
twoStar: 1460,
|
||||
demo: [],
|
||||
unspool: {
|
||||
storyTitle: '039 · 三巢让路',
|
||||
storyNote: '三缕全露头线按左/中/右落入近巢供线碗,同时最多暂存 2 团。',
|
||||
capacity: 2,
|
||||
slots: [
|
||||
{ x: 176, y: 386 },
|
||||
{ x: 300, y: 446 },
|
||||
{ x: 424, y: 386 },
|
||||
],
|
||||
strands: [
|
||||
{
|
||||
id: 's39-gold-l',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
slotIndex: 0,
|
||||
points: [[44, 88], [94, 48], [154, 78]],
|
||||
},
|
||||
{
|
||||
id: 's39-green',
|
||||
color: 'green',
|
||||
coveredBy: [],
|
||||
slotIndex: 1,
|
||||
points: [[224, 96], [280, 44], [336, 92]],
|
||||
},
|
||||
{
|
||||
id: 's39-gold-r',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
slotIndex: 2,
|
||||
points: [[516, 88], [466, 48], [406, 78]],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 样板 051:新针开旧夹(验证「织一针松开右片旧布,是否让玩家主动改变取线顺序」)
|
||||
* - 左片(开放):露头「金甲」(压着「粉甲」) 与露头「绿叶」(对应右片绿叶木夹)
|
||||
* - 右片(被绿叶木夹夹住):「金乙」与「粉乙」
|
||||
* - 策略对照:
|
||||
* 1) 朴素起手(先拆左片金甲→粉甲,后开夹):5 笔全分送,也能顺畅过关(1–2★)
|
||||
* 2) 读夹变序(先抽绿叶开夹 → 双金串送 → 双粉串送):仅需 3 笔,狂省线拿 3★!
|
||||
*/
|
||||
const sample051: LevelDef = {
|
||||
id: 'sample-051',
|
||||
chapter: 5,
|
||||
name: '拼布开旧夹 · 样板',
|
||||
difficulty: 'D4样板',
|
||||
lesson: '右片旧布被绿叶木夹夹住了!先绣左片金花也能过,但先绣绿叶开夹能凑齐同色串双球省大线!',
|
||||
goal: '观察右片木夹:先绣带绿叶夹标的针位开夹,再巧用同色串双球!',
|
||||
ruleTag: '新针开旧夹 · 2碗',
|
||||
motif: 'custom',
|
||||
nests: [{ ...NEST }],
|
||||
balls: [],
|
||||
targets: [
|
||||
{ id: 's51-green', color: 'green', x: 296, y: 332, rx: 32, ry: 29, patch: 'leaf' },
|
||||
{ id: 's51-gold-a', color: 'gold', x: 214, y: 214, rx: 31, ry: 31, patch: 'flower' },
|
||||
{ id: 's51-gold-b', color: 'gold', x: 280, y: 186, rx: 31, ry: 31, patch: 'flower' },
|
||||
{ id: 's51-rose-a', color: 'rose', x: 356, y: 236, rx: 31, ry: 31, patch: 'flower' },
|
||||
{ id: 's51-rose-b', color: 'rose', x: 416, y: 192, rx: 31, ry: 31, patch: 'flower' },
|
||||
],
|
||||
ponds: [],
|
||||
spools: [],
|
||||
buttons: [],
|
||||
dyes: [],
|
||||
gates: [],
|
||||
roughZones: [],
|
||||
threeStar: 1740,
|
||||
twoStar: 2120,
|
||||
demo: [],
|
||||
unspool: {
|
||||
storyTitle: '051 · 新针开旧夹',
|
||||
storyNote: '两片拼布:左片开放,右片被绿叶木夹夹住。先开夹就能和左片凑双金、双粉!',
|
||||
patchDividerX: 278,
|
||||
clips: [
|
||||
{
|
||||
id: 'clip-right',
|
||||
x: 286,
|
||||
y: 10,
|
||||
w: 264,
|
||||
h: 116,
|
||||
unlockSectionId: 's51-green',
|
||||
badgeColor: 'green',
|
||||
badgeShape: 'leaf',
|
||||
label: '绿叶开',
|
||||
},
|
||||
],
|
||||
slots: [
|
||||
{ x: 186, y: 472 },
|
||||
{ x: 414, y: 472 },
|
||||
],
|
||||
strands: [
|
||||
// 左片底层:粉甲(被金甲压住)
|
||||
{
|
||||
id: 's51-rose-a',
|
||||
color: 'rose',
|
||||
coveredBy: ['s51-gold-a'],
|
||||
points: [[36, 94], [88, 76], [148, 86]],
|
||||
},
|
||||
// 左片上层左:金甲(露头,直接可绣,但先拆会失去和右片金乙串双球机会)
|
||||
{
|
||||
id: 's51-gold-a',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
points: [[68, 22], [90, 68], [108, 114]],
|
||||
},
|
||||
// 左片上层右:绿叶(露头,绣完即咔哒松开右片木夹)
|
||||
{
|
||||
id: 's51-green',
|
||||
color: 'green',
|
||||
coveredBy: [],
|
||||
points: [[182, 108], [210, 64], [244, 30]],
|
||||
},
|
||||
// 右片(木夹内):金乙(开夹即露头)
|
||||
{
|
||||
id: 's51-gold-b',
|
||||
color: 'gold',
|
||||
coveredBy: [],
|
||||
clipId: 'clip-right',
|
||||
points: [[342, 92], [380, 48], [418, 34]],
|
||||
},
|
||||
// 右片(木夹内):粉乙(开夹即露头)
|
||||
{
|
||||
id: 's51-rose-b',
|
||||
color: 'rose',
|
||||
coveredBy: [],
|
||||
clipId: 'clip-right',
|
||||
points: [[442, 106], [486, 84], [520, 44]],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const VALIDATION_SAMPLES: ValidationSampleEntry[] = [
|
||||
{
|
||||
key: '026a',
|
||||
shortLabel: '026A 2碗',
|
||||
headerTitle: '样板 026A · 2碗竖栈',
|
||||
hypothesis: '对照组:2 格碗 + 三列单栈(8 种两抽开局 6 种卡住)',
|
||||
level: sample026A,
|
||||
},
|
||||
{
|
||||
key: '026b',
|
||||
shortLabel: '026B 3碗交叉',
|
||||
headerTitle: '样板 026B · 3碗交叉',
|
||||
hypothesis: '实验组:3 格碗 + 中拱 1 压 2 交叉压层,测小屏可读性与取舍感',
|
||||
level: sample026B,
|
||||
},
|
||||
{
|
||||
key: '038a',
|
||||
shortLabel: '038A 让路教',
|
||||
headerTitle: '样板 038A · 让路教学',
|
||||
hypothesis: '039 前置极简教学:2 巢 2 色不交叉,先建立“留外路”直觉',
|
||||
level: sample038A,
|
||||
},
|
||||
{
|
||||
key: '039',
|
||||
shortLabel: '039 三巢让路',
|
||||
headerTitle: '样板 039 · 三巢让路',
|
||||
hypothesis: '拉近 3 笔分送与 2 笔串双金让路的耗线差,测走线是否多出一套策略',
|
||||
level: sample039,
|
||||
},
|
||||
{
|
||||
key: '051',
|
||||
shortLabel: '051 开旧夹',
|
||||
headerTitle: '样板 051 · 新针开旧夹',
|
||||
hypothesis: '测“绣绿叶松开右片木夹”是否让玩家主动改变取线顺序(5 笔→3 笔)',
|
||||
level: sample051,
|
||||
},
|
||||
];
|
||||
|
||||
export function findValidationSample(rawKey: string | null): ValidationSampleEntry | null {
|
||||
if (!rawKey) return null;
|
||||
const norm = rawKey.trim().toLowerCase();
|
||||
return VALIDATION_SAMPLES.find(item => item.key === norm) ?? null;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1a0513c2-a6b1-4ca8-87a2-a3391a79f94b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ImageAsset, resources, SpriteFrame, Texture2D } from 'cc';
|
||||
import { POSTER_FRAMES, PosterFrameDef } from '../core/AtelierService';
|
||||
import { HOOP_CENTER, HOOP_HEIGHT, HOOP_RADIUS, HOOP_WIDTH, MOTIFS, NEST } from '../core/LevelData';
|
||||
import { dyeRemainingUses, isPondBridged, isTargetLocked } from '../core/RouteEngine';
|
||||
import { dyeRemainingUses, isClipUnlocked, isPondBridged, isStrandClipLocked, isStrandExposed, isTargetLocked } from '../core/RouteEngine';
|
||||
import {
|
||||
AntState,
|
||||
ButtonAnchorDef,
|
||||
@@ -10,16 +10,24 @@ import {
|
||||
GateDef,
|
||||
HintState,
|
||||
LevelDef,
|
||||
OldClothClipDef,
|
||||
Point2D,
|
||||
PondDef,
|
||||
RoughZoneDef,
|
||||
RouteState,
|
||||
SectionDef,
|
||||
SpoolDef,
|
||||
TargetColor,
|
||||
UnspoolConfig,
|
||||
UnspoolRuntimeState,
|
||||
YarnColor,
|
||||
} from '../core/Types';
|
||||
|
||||
declare const wx: any;
|
||||
|
||||
export const UNSPOOL_CLOTH_WIDTH = 560;
|
||||
export const UNSPOOL_CLOTH_HEIGHT = 136;
|
||||
|
||||
const GOLD = ['#9f501b', '#d59328', '#f6bb4f', '#ffe698'];
|
||||
const HONEY = ['#9a4b1d', '#cb7724', '#ed9b39', '#ffd283'];
|
||||
const LEAF = ['#394a31', '#7d8b50', '#a8aa68', '#d0cd8a'];
|
||||
@@ -1120,7 +1128,80 @@ function drawStartDragGuide(c: CanvasRenderingContext2D, level: LevelDef, time:
|
||||
c.restore();
|
||||
}
|
||||
|
||||
function drawPatch(c: CanvasRenderingContext2D, section: SectionDef, stitched: boolean): void {
|
||||
const palette = YARN_PALETTES[section.color];
|
||||
const w = section.rx;
|
||||
const h = section.ry;
|
||||
c.save();
|
||||
c.translate(section.x, section.y);
|
||||
c.beginPath();
|
||||
if (section.patch === 'flower') {
|
||||
for (let i = 0; i <= 120; i++) {
|
||||
const a = TAU * i / 120;
|
||||
const radius = 0.75 + 0.23 * Math.cos(6 * a);
|
||||
const x = Math.cos(a) * w * radius;
|
||||
const y = Math.sin(a) * h * radius;
|
||||
if (i === 0) c.moveTo(x, y);
|
||||
else c.lineTo(x, y);
|
||||
}
|
||||
} else if (section.patch === 'leaf') {
|
||||
c.moveTo(-w, h * 0.28);
|
||||
c.quadraticCurveTo(-w * 0.57, -h, w, -h * 0.38);
|
||||
c.quadraticCurveTo(w * 0.3, h, -w, h * 0.28);
|
||||
} else if (section.patch === 'bell') {
|
||||
c.moveTo(-w, h * 0.5);
|
||||
c.quadraticCurveTo(-w * 0.5, h * 0.16, -w * 0.54, -h * 0.27);
|
||||
c.bezierCurveTo(-w * 0.37, -h, w * 0.37, -h, w * 0.54, -h * 0.27);
|
||||
c.quadraticCurveTo(w * 0.5, h * 0.16, w, h * 0.5);
|
||||
c.quadraticCurveTo(0, h, -w, h * 0.5);
|
||||
} else if (section.patch === 'boat') {
|
||||
c.moveTo(-w, h * 0.1);
|
||||
c.quadraticCurveTo(0, h * 1.5, w, h * 0.1);
|
||||
c.lineTo(w * 0.18, h * 0.1);
|
||||
c.lineTo(w * 0.18, -h);
|
||||
c.quadraticCurveTo(-w * 0.49, -h * 0.63, -w * 0.48, h * 0.1);
|
||||
c.lineTo(-w, h * 0.1);
|
||||
} else {
|
||||
c.moveTo(-w, 0);
|
||||
c.bezierCurveTo(-w * 0.5, -h * 1.22, w * 0.54, h * 0.17, w, -h * 0.55);
|
||||
c.bezierCurveTo(w * 0.55, h * 1.25, -w * 0.43, h * 0.13, -w, 0);
|
||||
}
|
||||
c.closePath();
|
||||
c.fillStyle = stitched ? palette[1] : `${ROUTE_COLORS[section.color]}20`;
|
||||
c.fill();
|
||||
c.lineWidth = stitched ? 1.6 : 1.9;
|
||||
c.strokeStyle = RINGS[section.color];
|
||||
if (!stitched) c.setLineDash([4, 5]);
|
||||
c.stroke();
|
||||
if (stitched) {
|
||||
c.save();
|
||||
c.clip();
|
||||
c.lineWidth = 1.2;
|
||||
for (let y = -h - w; y < h + w; y += 2.8) {
|
||||
c.strokeStyle = y % 4 < 1 ? palette[1] : palette[2];
|
||||
line(c, -w - 2, y, w + 2, y - w * 0.72);
|
||||
}
|
||||
c.restore();
|
||||
const detail = section.patch;
|
||||
if (detail === 'flower' || detail === 'bell') {
|
||||
ellipse(c, 0, detail === 'bell' ? h * 0.75 : 0, w * 0.19, h * 0.17);
|
||||
c.fillStyle = palette[0];
|
||||
c.fill();
|
||||
}
|
||||
if (detail === 'leaf') {
|
||||
c.strokeStyle = palette[3];
|
||||
c.lineWidth = 1.4;
|
||||
line(c, -w * 0.72, h * 0.18, w * 0.74, -h * 0.32);
|
||||
}
|
||||
}
|
||||
c.restore();
|
||||
}
|
||||
|
||||
function drawSection(c: CanvasRenderingContext2D, section: SectionDef, stitched: boolean): void {
|
||||
if (section.patch) {
|
||||
drawPatch(c, section, stitched);
|
||||
return;
|
||||
}
|
||||
if (section.garden) {
|
||||
drawGardenSection(c, section, stitched);
|
||||
return;
|
||||
@@ -1143,6 +1224,9 @@ function drawSection(c: CanvasRenderingContext2D, section: SectionDef, stitched:
|
||||
}
|
||||
|
||||
function sectionBounds(section: SectionDef): { x: number; y: number; w: number; h: number } {
|
||||
if (section.patch) {
|
||||
return { x: section.x - section.rx - 5, y: section.y - section.ry - 5, w: 2 * section.rx + 10, h: 2 * section.ry + 10 };
|
||||
}
|
||||
if (section.garden) {
|
||||
return { x: Math.max(0, section.x - 52), y: Math.max(0, section.y - 52), w: 104, h: 104 };
|
||||
}
|
||||
@@ -1442,6 +1526,9 @@ export class EmbroideryRenderer {
|
||||
private workshopLayer: OffscreenLayer | null = null;
|
||||
private workshopTexture: Texture2D | null = null;
|
||||
private workshopSpriteFrame: SpriteFrame | null = null;
|
||||
private unspoolLayer: OffscreenLayer | null = null;
|
||||
private unspoolTexture: Texture2D | null = null;
|
||||
private unspoolSpriteFrame: SpriteFrame | null = null;
|
||||
private activeLevel: LevelDef | null = null;
|
||||
|
||||
constructor(renderScale = 1.5) {
|
||||
@@ -1853,7 +1940,10 @@ export class EmbroideryRenderer {
|
||||
else this.drawOverlay(c, section);
|
||||
}
|
||||
if (level.motif === 'custom') {
|
||||
for (const target of level.targets) this.drawArtworkGuideRing(c, target);
|
||||
for (const target of level.targets) {
|
||||
if (target.patch) drawSection(c, target, false);
|
||||
else this.drawArtworkGuideRing(c, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2001,6 +2091,33 @@ export class EmbroideryRenderer {
|
||||
const locked = isTargetLocked(level, target.id, lines, drawing);
|
||||
const needsStop = !locked && Boolean(drawing && drawing.color === target.color && drawing.picks.length > drawing.deliveries.length);
|
||||
drawTargetPin(c, target, Boolean(planned || needsStop), time, planned?.step, locked);
|
||||
|
||||
// 「新针开旧夹」:在对应开夹针位旁绘制与旧布木夹完全一致的微型徽标
|
||||
const linkedClip = level.unspool?.clips?.find(clip => clip.unlockSectionId === target.id && !isClipUnlocked(clip, lines, drawing));
|
||||
if (linkedClip) {
|
||||
const pulsing = state.unspool?.pulseTargetId === target.id && time < (state.unspool.pulseUntil ?? 0);
|
||||
if (pulsing) {
|
||||
const wave = (time % 650) / 650;
|
||||
c.save();
|
||||
ellipse(c, target.x, target.y, target.rx + 8 + wave * 18, target.ry + 8 + wave * 18);
|
||||
c.strokeStyle = ROUTE_COLORS[linkedClip.badgeColor];
|
||||
c.globalAlpha = Math.max(0.15, 0.9 - wave * 0.75);
|
||||
c.lineWidth = 3.5;
|
||||
c.stroke();
|
||||
c.restore();
|
||||
}
|
||||
const bx = target.x + Math.max(22, target.rx * 0.72);
|
||||
const by = target.y - Math.max(20, target.ry * 0.68);
|
||||
c.save();
|
||||
roundRectPath(c, bx - 14, by - 11, 28, 22, 6);
|
||||
c.fillStyle = '#8b5e36';
|
||||
c.fill();
|
||||
c.strokeStyle = pulsing ? '#fff1a8' : '#573619';
|
||||
c.lineWidth = pulsing ? 2.4 : 1.5;
|
||||
c.stroke();
|
||||
this.drawClipEmblem(c, bx, by, 7.5, linkedClip.badgeColor, linkedClip.badgeShape);
|
||||
c.restore();
|
||||
}
|
||||
}
|
||||
drawUnlockLinks(c, level, lines, drawing, time);
|
||||
|
||||
@@ -2009,6 +2126,42 @@ export class EmbroideryRenderer {
|
||||
drawNest(c, nestPos, time, lines.length === 0 && !drawing, idx === activeNestIndex, multiNest);
|
||||
});
|
||||
|
||||
if (level.unspool) {
|
||||
const deadlocked = Boolean(state.unspool?.deadlocked);
|
||||
const animSlot = state.unspool?.animating?.slotIndex ?? -1;
|
||||
const capacity = level.unspool.capacity ?? level.unspool.slots.length;
|
||||
const occupiedCount = state.unspool?.slotBallIds.filter(id => id != null).length ?? 0;
|
||||
const capFull = occupiedCount >= capacity;
|
||||
level.unspool.slots.forEach((slot, idx) => {
|
||||
const occupied = state.unspool?.slotBallIds[idx] != null;
|
||||
const receiving = animSlot === idx;
|
||||
const capBlocked = !occupied && capFull;
|
||||
c.save();
|
||||
c.translate(slot.x, slot.y);
|
||||
c.globalAlpha = capBlocked ? 0.56 : 1;
|
||||
ellipse(c, 2, 12, 30, 15);
|
||||
c.fillStyle = '#63503d28';
|
||||
c.fill();
|
||||
ellipse(c, 0, 2, 28, 25);
|
||||
c.fillStyle = deadlocked ? '#e7b9aa' : '#ddd0b9';
|
||||
c.fill();
|
||||
c.strokeStyle = deadlocked ? '#975449' : receiving ? '#826146' : '#a08e73';
|
||||
c.lineWidth = receiving || deadlocked ? 2.8 : 1.6;
|
||||
c.stroke();
|
||||
ellipse(c, 0, 2, 21, 18);
|
||||
c.fillStyle = occupied ? '#c2b091' : '#f2e7d4';
|
||||
c.fill();
|
||||
if (!occupied) {
|
||||
c.fillStyle = '#6d5e4e';
|
||||
c.font = `700 12px ${SERIF_FONT}`;
|
||||
c.textAlign = 'center';
|
||||
c.textBaseline = 'middle';
|
||||
c.fillText(capBlocked ? '满格' : `线碗${idx + 1}`, 0, 2);
|
||||
}
|
||||
c.restore();
|
||||
});
|
||||
}
|
||||
|
||||
for (const ball of level.balls) {
|
||||
let pickedAt: number | undefined;
|
||||
for (const l of lines) {
|
||||
@@ -2503,6 +2656,318 @@ export class EmbroideryRenderer {
|
||||
this.workshopTexture.uploadData(this.workshopLayer.canvas);
|
||||
}
|
||||
|
||||
public getUnspoolClothSpriteFrame(): SpriteFrame {
|
||||
if (!this.unspoolSpriteFrame) {
|
||||
this.unspoolLayer = createLayer(UNSPOOL_CLOTH_WIDTH, UNSPOOL_CLOTH_HEIGHT, 1.5);
|
||||
const imageAsset = new ImageAsset(this.unspoolLayer.canvas);
|
||||
this.unspoolTexture = new Texture2D();
|
||||
this.unspoolTexture.image = imageAsset;
|
||||
this.unspoolSpriteFrame = new SpriteFrame();
|
||||
this.unspoolSpriteFrame.texture = this.unspoolTexture;
|
||||
}
|
||||
return this.unspoolSpriteFrame;
|
||||
}
|
||||
|
||||
private drawClipEmblem(
|
||||
c: CanvasRenderingContext2D,
|
||||
x: number,
|
||||
y: number,
|
||||
r: number,
|
||||
color: TargetColor,
|
||||
shape: OldClothClipDef['badgeShape'],
|
||||
): void {
|
||||
c.save();
|
||||
c.translate(x, y);
|
||||
ellipse(c, 0, 0, r + 1.5, r + 1.5);
|
||||
c.fillStyle = '#fbf4e4';
|
||||
c.fill();
|
||||
c.fillStyle = ROUTE_COLORS[color];
|
||||
c.strokeStyle = RINGS[color];
|
||||
c.lineWidth = 1.2;
|
||||
c.beginPath();
|
||||
if (shape === 'leaf') {
|
||||
c.moveTo(-r * 0.72, r * 0.45);
|
||||
c.quadraticCurveTo(-r * 0.35, -r * 0.78, r * 0.76, -r * 0.52);
|
||||
c.quadraticCurveTo(r * 0.42, r * 0.76, -r * 0.72, r * 0.45);
|
||||
c.closePath();
|
||||
c.fill();
|
||||
c.stroke();
|
||||
} else if (shape === 'flower') {
|
||||
for (let i = 0; i < 5; i++) {
|
||||
const a = (i * Math.PI * 2) / 5 - Math.PI / 2;
|
||||
c.moveTo(Math.cos(a) * r * 0.42 + r * 0.32, Math.sin(a) * r * 0.42);
|
||||
c.arc(Math.cos(a) * r * 0.42, Math.sin(a) * r * 0.42, r * 0.32, 0, Math.PI * 2);
|
||||
}
|
||||
c.fill();
|
||||
} else if (shape === 'bell') {
|
||||
c.arc(0, -r * 0.1, r * 0.56, Math.PI, 0);
|
||||
c.lineTo(r * 0.68, r * 0.52);
|
||||
c.lineTo(-r * 0.68, r * 0.52);
|
||||
c.closePath();
|
||||
c.fill();
|
||||
c.stroke();
|
||||
} else {
|
||||
c.arc(0, 0, r * 0.58, 0, Math.PI * 2);
|
||||
c.fill();
|
||||
c.stroke();
|
||||
}
|
||||
c.restore();
|
||||
}
|
||||
|
||||
/** 「拆旧织新」上方旧绣片 2D 实时渲染:底层→顶层压叠投影、交叉阴影断口、旧布木夹与可抽亮色线头脉冲 */
|
||||
public renderUnspoolClothFrame(
|
||||
config: UnspoolConfig,
|
||||
runtime: UnspoolRuntimeState,
|
||||
timeMs: number,
|
||||
lines: RouteState[] = [],
|
||||
): void {
|
||||
if (!this.unspoolLayer || !this.unspoolTexture) return;
|
||||
const W = UNSPOOL_CLOTH_WIDTH;
|
||||
const H = UNSPOOL_CLOTH_HEIGHT;
|
||||
const c = this.unspoolLayer.ctx;
|
||||
c.clearRect(0, 0, W, H);
|
||||
|
||||
const fabric = c.createLinearGradient(0, 0, W, H);
|
||||
fabric.addColorStop(0, '#f5eddb');
|
||||
fabric.addColorStop(1, '#e9dfcc');
|
||||
roundRectPath(c, 1, 1, W - 2, H - 2, 15);
|
||||
c.fillStyle = fabric;
|
||||
c.fill();
|
||||
c.strokeStyle = '#cfc0a7';
|
||||
c.lineWidth = 1.5;
|
||||
c.stroke();
|
||||
|
||||
c.save();
|
||||
roundRectPath(c, 3, 3, W - 6, H - 6, 14);
|
||||
c.clip();
|
||||
if (config.patchDividerX) {
|
||||
const dx = config.patchDividerX;
|
||||
c.fillStyle = '#e7eef1';
|
||||
c.fillRect(dx, 0, W - dx, H);
|
||||
c.fillStyle = '#6f8ea11c';
|
||||
for (let x = dx + 6; x < W; x += 12) c.fillRect(x, 0, 1.2, H);
|
||||
for (let y = 6; y < H; y += 12) c.fillRect(dx, y, W - dx, 1.2);
|
||||
c.fillStyle = '#8069490f';
|
||||
for (let x = 3; x < dx; x += 5) c.fillRect(x, 0, 0.8, H);
|
||||
c.beginPath();
|
||||
c.moveTo(dx, 6);
|
||||
c.lineTo(dx, H - 6);
|
||||
c.strokeStyle = '#8f775d99';
|
||||
c.lineWidth = 1.5;
|
||||
c.setLineDash([4, 4]);
|
||||
c.stroke();
|
||||
c.setLineDash([]);
|
||||
} else {
|
||||
c.fillStyle = '#8069490d';
|
||||
for (let x = 3; x < W; x += 5) c.fillRect(x, 0, 0.7, H);
|
||||
c.fillStyle = '#ffffff66';
|
||||
for (let y = 3; y < H; y += 5) c.fillRect(0, y, W, 0.8);
|
||||
}
|
||||
roundRectPath(c, 9, 9, W - 18, H - 18, 9);
|
||||
c.strokeStyle = '#9c836d66';
|
||||
c.lineWidth = 1;
|
||||
c.setLineDash([3, 4]);
|
||||
c.stroke();
|
||||
c.restore();
|
||||
|
||||
const removed = new Set(runtime.removedIds);
|
||||
const remaining = config.strands.filter(s => !removed.has(s.id));
|
||||
|
||||
if (remaining.length === 0) {
|
||||
c.fillStyle = '#5f4627';
|
||||
c.font = `700 18px ${SERIF_FONT}`;
|
||||
c.textAlign = 'center';
|
||||
c.textBaseline = 'middle';
|
||||
c.fillText('旧线已拆完,拖蚂蚁开始落针', W / 2, H / 2);
|
||||
this.unspoolTexture.uploadData(this.unspoolLayer.canvas);
|
||||
return;
|
||||
}
|
||||
|
||||
const coversSomeone = new Set<string>();
|
||||
for (const s of remaining) {
|
||||
for (const cid of s.coveredBy) {
|
||||
if (!removed.has(cid)) coversSomeone.add(cid);
|
||||
}
|
||||
}
|
||||
|
||||
for (const strand of remaining) {
|
||||
const lockedClip = isStrandClipLocked(config, strand, lines);
|
||||
const exposed = isStrandExposed(config, strand, removed, lines);
|
||||
const isUpper = exposed || coversSomeone.has(strand.id);
|
||||
const isAnim = runtime.animating?.strandId === strand.id;
|
||||
const progress = isAnim ? Math.min(1, Math.max(0, runtime.animating!.progress)) : 0;
|
||||
|
||||
const rawPts = strand.points.map(([x, y]) => ({ x, y }));
|
||||
const segLens: number[] = [];
|
||||
let totalLen = 0;
|
||||
for (let i = 1; i < rawPts.length; i++) {
|
||||
const d = Math.hypot(rawPts[i].x - rawPts[i - 1].x, rawPts[i].y - rawPts[i - 1].y);
|
||||
segLens.push(d);
|
||||
totalLen += d;
|
||||
}
|
||||
const keepLen = totalLen * (1 - progress);
|
||||
const drawPts: Point2D[] = [rawPts[0]];
|
||||
let acc = 0;
|
||||
for (let i = 1; i < rawPts.length; i++) {
|
||||
const seg = segLens[i - 1];
|
||||
if (acc + seg >= keepLen) {
|
||||
const t = seg > 0 ? Math.max(0, Math.min(1, (keepLen - acc) / seg)) : 0;
|
||||
drawPts.push({
|
||||
x: rawPts[i - 1].x + (rawPts[i].x - rawPts[i - 1].x) * t,
|
||||
y: rawPts[i - 1].y + (rawPts[i].y - rawPts[i - 1].y) * t,
|
||||
});
|
||||
break;
|
||||
}
|
||||
drawPts.push(rawPts[i]);
|
||||
acc += seg;
|
||||
}
|
||||
|
||||
const palette = YARN_PALETTES[strand.color];
|
||||
const mainColor = ROUTE_COLORS[strand.color];
|
||||
const darkColor = RINGS[strand.color];
|
||||
const lightColor = palette[3];
|
||||
const width = exposed ? 13.5 : 10.5;
|
||||
|
||||
c.save();
|
||||
c.lineCap = 'round';
|
||||
c.lineJoin = 'round';
|
||||
c.globalAlpha = exposed ? 1 : lockedClip ? 0.56 : 0.72;
|
||||
|
||||
if (drawPts.length >= 2) {
|
||||
const traceSmoothPath = () => {
|
||||
c.beginPath();
|
||||
c.moveTo(drawPts[0].x, drawPts[0].y);
|
||||
for (let i = 1; i < drawPts.length - 1; i++) {
|
||||
const prev = drawPts[i - 1];
|
||||
const joint = drawPts[i];
|
||||
const next = drawPts[i + 1];
|
||||
const inScale = Math.min(0.25, 9 / Math.hypot(joint.x - prev.x, joint.y - prev.y));
|
||||
const outScale = Math.min(0.25, 9 / Math.hypot(next.x - joint.x, next.y - joint.y));
|
||||
c.lineTo(joint.x + (prev.x - joint.x) * inScale, joint.y + (prev.y - joint.y) * inScale);
|
||||
c.quadraticCurveTo(
|
||||
joint.x, joint.y,
|
||||
joint.x + (next.x - joint.x) * outScale, joint.y + (next.y - joint.y) * outScale,
|
||||
);
|
||||
}
|
||||
const last = drawPts[drawPts.length - 1];
|
||||
c.lineTo(last.x, last.y);
|
||||
};
|
||||
|
||||
if (isUpper && coversSomeone.has(strand.id)) {
|
||||
traceSmoothPath();
|
||||
c.strokeStyle = '#efe5d2ee';
|
||||
c.lineWidth = width + 6;
|
||||
c.stroke();
|
||||
}
|
||||
|
||||
traceSmoothPath();
|
||||
c.shadowColor = exposed ? '#3b281496' : '#543f2526';
|
||||
c.shadowBlur = exposed ? 6 : 1.5;
|
||||
c.shadowOffsetY = exposed ? 3.5 : 1;
|
||||
c.strokeStyle = darkColor;
|
||||
c.lineWidth = width;
|
||||
c.stroke();
|
||||
c.shadowColor = 'transparent';
|
||||
c.strokeStyle = mainColor;
|
||||
c.lineWidth = width - 1.4;
|
||||
c.stroke();
|
||||
|
||||
c.beginPath();
|
||||
for (let i = 1; i < drawPts.length; i++) {
|
||||
const start = drawPts[i - 1];
|
||||
const end = drawPts[i];
|
||||
const len = Math.hypot(end.x - start.x, end.y - start.y);
|
||||
if (len < 10) continue;
|
||||
const dx = (end.x - start.x) / len;
|
||||
const dy = (end.y - start.y) / len;
|
||||
for (let along = 5; along <= len - 5; along += 4.3) {
|
||||
const x = start.x + dx * along;
|
||||
const y = start.y + dy * along;
|
||||
const radius = width * 0.37;
|
||||
c.moveTo(x + dy * radius - dx * 1.9, y - dx * radius - dy * 1.9);
|
||||
c.quadraticCurveTo(x + dx * 0.5, y + dy * 0.5, x - dy * radius + dx * 1.9, y + dx * radius + dy * 1.9);
|
||||
}
|
||||
}
|
||||
c.strokeStyle = lightColor + '9c';
|
||||
c.lineWidth = 1.1;
|
||||
c.stroke();
|
||||
}
|
||||
|
||||
const tip = drawPts[drawPts.length - 1];
|
||||
if (isAnim) {
|
||||
this.drawBall(c, tip.x, tip.y, strand.color, 0.45 + progress * 0.58, progress * 11, true);
|
||||
} else if (exposed) {
|
||||
const halo = 12.5 + Math.sin(timeMs / 280 + tip.x * 0.03) * 1.5;
|
||||
ellipse(c, tip.x, tip.y, halo, halo);
|
||||
c.fillStyle = '#fff9e4c8';
|
||||
c.fill();
|
||||
c.strokeStyle = darkColor;
|
||||
c.lineWidth = 1.6;
|
||||
c.stroke();
|
||||
|
||||
ellipse(c, tip.x, tip.y, 5.5, 5.5);
|
||||
c.fillStyle = mainColor;
|
||||
c.fill();
|
||||
}
|
||||
c.restore();
|
||||
}
|
||||
|
||||
if (config.clips?.length) {
|
||||
for (const clip of config.clips) {
|
||||
const unlocked = isClipUnlocked(clip, lines);
|
||||
c.save();
|
||||
if (!unlocked) {
|
||||
roundRectPath(c, clip.x, clip.y, clip.w, clip.h, 10);
|
||||
c.fillStyle = '#dce4e888';
|
||||
c.fill();
|
||||
c.strokeStyle = '#7b6345aa';
|
||||
c.lineWidth = 1.6;
|
||||
c.setLineDash([5, 4]);
|
||||
c.stroke();
|
||||
c.setLineDash([]);
|
||||
|
||||
const cx = clip.x + 18;
|
||||
const cy = clip.y + clip.h / 2;
|
||||
c.shadowColor = '#2e1d0f55';
|
||||
c.shadowBlur = 6;
|
||||
c.shadowOffsetY = 2;
|
||||
roundRectPath(c, cx - 22, cy - 30, 44, 60, 10);
|
||||
const wood = c.createLinearGradient(cx - 22, cy - 30, cx + 22, cy + 30);
|
||||
wood.addColorStop(0, '#ab7846');
|
||||
wood.addColorStop(1, '#784c27');
|
||||
c.fillStyle = wood;
|
||||
c.fill();
|
||||
c.shadowColor = 'transparent';
|
||||
c.strokeStyle = '#4e2f15';
|
||||
c.lineWidth = 1.8;
|
||||
c.stroke();
|
||||
c.fillStyle = '#e7c985';
|
||||
c.fillRect(cx - 18, cy - 3, 36, 5);
|
||||
this.drawClipEmblem(c, cx, cy - 11, 11, clip.badgeColor, clip.badgeShape);
|
||||
c.fillStyle = '#fff5df';
|
||||
c.font = `700 11px ${SERIF_FONT}`;
|
||||
c.textAlign = 'center';
|
||||
c.textBaseline = 'middle';
|
||||
c.fillText(clip.label ?? '旧夹', cx, cy + 16);
|
||||
} else {
|
||||
const cx = clip.x + clip.w - 34;
|
||||
const cy = clip.y + 13;
|
||||
roundRectPath(c, cx - 24, cy - 9, 48, 18, 9);
|
||||
c.fillStyle = '#6b8555d8';
|
||||
c.fill();
|
||||
c.fillStyle = '#fffaf0';
|
||||
c.font = `700 11px ${SERIF_FONT}`;
|
||||
c.textAlign = 'center';
|
||||
c.textBaseline = 'middle';
|
||||
c.fillText('已开夹', cx, cy + 0.5);
|
||||
}
|
||||
c.restore();
|
||||
}
|
||||
}
|
||||
|
||||
this.unspoolTexture.uploadData(this.unspoolLayer.canvas);
|
||||
}
|
||||
|
||||
public exportArtwork(
|
||||
state: GameState,
|
||||
meta: {
|
||||
|
||||
+371
-33
@@ -3,6 +3,7 @@ import { AtelierService } from '../core/AtelierService';
|
||||
import { CHAPTERS, CHAPTER_UNLOCK_STARS, formatLength, formatShort, HOOP_HEIGHT, HOOP_WIDTH, LEVELS, NEST, YARN_COLORS } from '../core/LevelData';
|
||||
import {
|
||||
ANT_SPEED,
|
||||
availableTargets,
|
||||
checkSegmentBlock,
|
||||
createEmptyRoute,
|
||||
dispatchWarning,
|
||||
@@ -11,11 +12,15 @@ import {
|
||||
findNextHint,
|
||||
interpolate,
|
||||
isButtonEvent,
|
||||
isClipUnlocked,
|
||||
isDeliveryEvent,
|
||||
isDyeEvent,
|
||||
isGateEvent,
|
||||
isPickEvent,
|
||||
isSpoolEvent,
|
||||
isStrandClipLocked,
|
||||
isStrandExposed,
|
||||
isTargetLocked,
|
||||
passedGateIds,
|
||||
planStops,
|
||||
prepareRouteForRun,
|
||||
@@ -28,8 +33,8 @@ import {
|
||||
} from '../core/RouteEngine';
|
||||
import { SoundService } from '../core/SoundService';
|
||||
import { StorageService } from '../core/StorageService';
|
||||
import { BlockReason, GameState, LevelDef, Point2D, RouteState, TargetColor } from '../core/Types';
|
||||
import { EmbroideryRenderer } from '../render/EmbroideryRenderer';
|
||||
import { BallDef, BlockReason, GameState, LevelDef, Point2D, RouteState, TargetColor } from '../core/Types';
|
||||
import { EmbroideryRenderer, UNSPOOL_CLOTH_HEIGHT, UNSPOOL_CLOTH_WIDTH } from '../render/EmbroideryRenderer';
|
||||
import { AtelierTab } from './AtelierModal';
|
||||
import { applyCoverBackground, applySafeContentTransform, ScreenMetrics } from './ScreenAdapter';
|
||||
import {
|
||||
@@ -54,6 +59,8 @@ const { ccclass } = _decorator;
|
||||
const HOOP_DISPLAY_W = 708;
|
||||
const HOOP_DISPLAY_H = Math.round((HOOP_DISPLAY_W * HOOP_HEIGHT) / HOOP_WIDTH);
|
||||
const RELATIVE_GAIN = 1.42;
|
||||
const UNSPOOL_DISPLAY_WIDTH = 492;
|
||||
const UNSPOOL_DISPLAY_HEIGHT = Math.round((UNSPOOL_DISPLAY_WIDTH * UNSPOOL_CLOTH_HEIGHT) / UNSPOOL_CLOTH_WIDTH);
|
||||
|
||||
const CHIP_STYLES: Record<TargetColor, { icon: string; dot: string; fill: string; stroke: string; text: string }> = {
|
||||
gold: { icon: '✿', dot: '#d89a2c', fill: '#fbf0d4', stroke: '#d9b574', text: '#6a410b' },
|
||||
@@ -86,8 +93,19 @@ export class PlayView extends Component {
|
||||
private onOpenAtelier?: (tab: AtelierTab, chapterIndex: number, focusLevelIndex?: number) => void;
|
||||
|
||||
private currentIndex = 0;
|
||||
private customMode = false;
|
||||
private level: LevelDef = LEVELS[0];
|
||||
private activeNestIndex = 0;
|
||||
|
||||
private get unspoolMode(): boolean {
|
||||
return Boolean(this.level.unspool);
|
||||
}
|
||||
|
||||
private unspoolNextBallId = 100;
|
||||
private unspoolHistory: (
|
||||
| { kind: 'unspool'; strandId: string; slotIndex: number; ballId: number }
|
||||
| { kind: 'stitch'; restoredBalls: { slotIndex: number; ball: BallDef }[] }
|
||||
)[] = [];
|
||||
private targetCounts: Record<TargetColor, number> = {
|
||||
gold: 0,
|
||||
green: 0,
|
||||
@@ -150,9 +168,14 @@ export class PlayView extends Component {
|
||||
private topBarNode!: Node;
|
||||
private missionRowNode!: Node;
|
||||
private whisperRibbonNode!: Node;
|
||||
private unspoolPanelNode!: Node;
|
||||
private unspoolClothNode!: Node;
|
||||
private unspoolClothTransform!: UITransform;
|
||||
private unspoolHeaderLabel!: Label;
|
||||
private resultFrameNode!: Node;
|
||||
private relativeAnchorNode!: Node;
|
||||
private relativeThumbNode!: Node;
|
||||
private lastMetrics: ScreenMetrics | null = null;
|
||||
|
||||
private hintBtn!: ArtButton;
|
||||
private hintHalo!: Node;
|
||||
@@ -229,6 +252,38 @@ export class PlayView extends Component {
|
||||
hoopSprite.sizeMode = Sprite.SizeMode.CUSTOM;
|
||||
hoopSprite.spriteFrame = this.renderer.getSpriteFrame();
|
||||
|
||||
// 「拆旧织新」胡桃木铜钉旧布抽线板(仅在带 unspool 配置的关卡显示)
|
||||
const unspoolFrame = createPanel('UnspoolClothPanel', 698, 132, {
|
||||
fill: '#3c2514ee',
|
||||
stroke: '#d8b068',
|
||||
strokeWidth: 2,
|
||||
radius: 20,
|
||||
depth: 4,
|
||||
depthColor: '#221308',
|
||||
shadow: 5,
|
||||
rivets: true,
|
||||
rivetColor: '#e2ba6d',
|
||||
}, this.safeRoot);
|
||||
this.unspoolPanelNode = unspoolFrame.node;
|
||||
this.unspoolHeaderLabel = createLabel('UnspoolHeader', '旧荷包\n点线头抽线', 166, 92, {
|
||||
size: 21,
|
||||
lineHeight: 30,
|
||||
color: '#fff4d8',
|
||||
bold: true,
|
||||
align: Label.HorizontalAlign.LEFT,
|
||||
overflow: Label.Overflow.SHRINK,
|
||||
}, unspoolFrame.node);
|
||||
this.unspoolHeaderLabel.node.setPosition(-242, 0, 0);
|
||||
|
||||
this.unspoolClothNode = createUINode('UnspoolClothCanvas', UNSPOOL_DISPLAY_WIDTH, UNSPOOL_DISPLAY_HEIGHT, unspoolFrame.node);
|
||||
this.unspoolClothNode.setPosition(88, 0, 0);
|
||||
this.unspoolClothTransform = this.unspoolClothNode.getComponent(UITransform)!;
|
||||
const unspoolSprite = this.unspoolClothNode.addComponent(Sprite);
|
||||
unspoolSprite.sizeMode = Sprite.SizeMode.CUSTOM;
|
||||
unspoolSprite.spriteFrame = this.renderer.getUnspoolClothSpriteFrame();
|
||||
this.unspoolClothNode.on(Node.EventType.TOUCH_START, this.onUnspoolClothTouch, this);
|
||||
this.unspoolPanelNode.active = false;
|
||||
|
||||
// 隐形相对滑动轻提示环(松手即隐)
|
||||
const relAnchor = createPanel('RelativeAnchor', 58, 58, {
|
||||
fill: '#f7e7c426', stroke: '#fff7e082', strokeWidth: 2, radius: 29,
|
||||
@@ -509,7 +564,7 @@ export class PlayView extends Component {
|
||||
onClick: () => {
|
||||
this.sound.unlock();
|
||||
const gate = this.getNextChapterGate();
|
||||
if (this.currentIndex + 1 < LEVELS.length && !gate.locked) {
|
||||
if (!this.customMode && this.currentIndex + 1 < LEVELS.length && !gate.locked) {
|
||||
this.loadLevel(this.currentIndex + 1);
|
||||
} else {
|
||||
this.onBackLobby();
|
||||
@@ -670,10 +725,16 @@ export class PlayView extends Component {
|
||||
}
|
||||
|
||||
public applyScreenMetrics(m: ScreenMetrics): void {
|
||||
this.lastMetrics = m;
|
||||
this.safeContentScale = Math.max(0.5, m.contentScale);
|
||||
if (this.bgArtNode) applyCoverBackground(this.bgArtNode, m);
|
||||
if (this.safeRoot) applySafeContentTransform(this.safeRoot, m);
|
||||
if (!this.topBarNode) return;
|
||||
this.layoutPlayArea();
|
||||
}
|
||||
|
||||
private layoutPlayArea(): void {
|
||||
if (!this.topBarNode || !this.lastMetrics) return;
|
||||
const m = this.lastMetrics;
|
||||
|
||||
// 全面屏动态贴顶/贴底锚定并拉宽 HUD 与绣绷上下呼吸感,消除大块死空白
|
||||
const h = m.safeHalfH;
|
||||
@@ -681,20 +742,44 @@ export class PlayView extends Component {
|
||||
|
||||
const topBarY = h - 56;
|
||||
const missionY = topBarY - 88 - e * 0.08;
|
||||
const ribbonY = missionY - 68 - e * 0.08;
|
||||
const dockY = -h + 84;
|
||||
|
||||
const hoopY = ((ribbonY - 20) + (dockY + 76)) / 2 + 8;
|
||||
const dockY = -h + (this.customMode ? 128 : 84);
|
||||
|
||||
this.topBarNode.setPosition(0, topBarY, 0);
|
||||
this.missionRowNode.setPosition(0, missionY, 0);
|
||||
this.whisperRibbonNode.setPosition(0, ribbonY, 0);
|
||||
this.dockTrayNode.setPosition(0, dockY, 0);
|
||||
this.hoopNode.setPosition(0, hoopY, 0);
|
||||
this.hoopShadowNode.setPosition(4, hoopY - 22, 0);
|
||||
this.dragSurfaceNode.setPosition(0, hoopY - 10, 0);
|
||||
this.resultFrameNode.setPosition(0, -h + 286, 0);
|
||||
this.tutorialOverlay.setPosition(0, ribbonY - 94, 0);
|
||||
this.resultFrameNode.setPosition(0, -h + (this.customMode ? 310 : 286), 0);
|
||||
|
||||
if (this.unspoolMode) {
|
||||
const unspoolY = missionY - 96 - e * 0.04;
|
||||
const ribbonY = dockY + 94;
|
||||
const availTop = unspoolY - 70;
|
||||
const availBottom = ribbonY + 24;
|
||||
const availH = Math.max(480, availTop - availBottom);
|
||||
const hoopScale = Math.min(0.95, availH / HOOP_DISPLAY_H);
|
||||
const hoopY = (availTop + availBottom) / 2;
|
||||
|
||||
this.unspoolPanelNode.setPosition(0, unspoolY, 0);
|
||||
this.whisperRibbonNode.setPosition(0, ribbonY, 0);
|
||||
this.hoopNode.setPosition(0, hoopY, 0);
|
||||
this.hoopNode.setScale(hoopScale, hoopScale, 1);
|
||||
this.hoopShadowNode.setPosition(4 * hoopScale, hoopY - 22 * hoopScale, 0);
|
||||
this.hoopShadowNode.setScale(hoopScale, hoopScale, 1);
|
||||
this.dragSurfaceNode.setPosition(0, hoopY, 0);
|
||||
this.dragSurfaceNode.getComponent(UITransform)!.setContentSize(740, availH + 20);
|
||||
this.tutorialOverlay.setPosition(0, unspoolY, 0);
|
||||
} else {
|
||||
const ribbonY = missionY - 68 - e * 0.08;
|
||||
const hoopY = ((ribbonY - 20) + (dockY + 76)) / 2 + 8;
|
||||
|
||||
this.whisperRibbonNode.setPosition(0, ribbonY, 0);
|
||||
this.hoopNode.setPosition(0, hoopY, 0);
|
||||
this.hoopNode.setScale(1, 1, 1);
|
||||
this.hoopShadowNode.setPosition(4, hoopY - 22, 0);
|
||||
this.hoopShadowNode.setScale(1, 1, 1);
|
||||
this.dragSurfaceNode.setPosition(0, hoopY - 10, 0);
|
||||
this.dragSurfaceNode.getComponent(UITransform)!.setContentSize(740, 940);
|
||||
this.tutorialOverlay.setPosition(0, ribbonY - 94, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private syncLoupeButton(): void {
|
||||
@@ -736,7 +821,8 @@ export class PlayView extends Component {
|
||||
if (this.pointer.relative) {
|
||||
const uiLoc = event.getUILocation();
|
||||
this.updateRelativeIndicator(uiLoc, false);
|
||||
const scaleInv = 1 / this.safeContentScale;
|
||||
const hoopScale = Math.max(0.5, this.hoopNode.scale.x);
|
||||
const scaleInv = 1 / (this.safeContentScale * hoopScale);
|
||||
const dx = (uiLoc.x - this.pointer.startUI.x) * scaleInv * (HOOP_WIDTH / HOOP_DISPLAY_W) * RELATIVE_GAIN;
|
||||
const dy = -(uiLoc.y - this.pointer.startUI.y) * scaleInv * (HOOP_HEIGHT / HOOP_DISPLAY_H) * RELATIVE_GAIN;
|
||||
if (this.state.drawing) this.state.drawing.fingerTip = null;
|
||||
@@ -831,8 +917,27 @@ export class PlayView extends Component {
|
||||
}
|
||||
|
||||
public loadLevel(index: number): void {
|
||||
this.customMode = false;
|
||||
this.currentIndex = index;
|
||||
this.level = LEVELS[index];
|
||||
const blueprint = LEVELS[index];
|
||||
if (!blueprint) return;
|
||||
this.level = blueprint.unspool ? { ...blueprint, balls: [] } : blueprint;
|
||||
const numStr = index + 1 < 10 ? '0' + (index + 1) : String(index + 1);
|
||||
this.setupLoadedLevel(`${numStr} ${this.level.name}`);
|
||||
this.tutorialOverlay.active = !this.unspoolMode && index === 0 && !this.storage.hasSeenTutorial();
|
||||
}
|
||||
|
||||
public loadCustomLevel(blueprint: LevelDef, headerTitle?: string): void {
|
||||
this.customMode = true;
|
||||
this.currentIndex = 0;
|
||||
this.level = blueprint.unspool
|
||||
? { ...blueprint, balls: [] }
|
||||
: { ...blueprint, balls: blueprint.balls.map(b => ({ ...b })) };
|
||||
this.setupLoadedLevel(headerTitle ?? blueprint.name);
|
||||
this.tutorialOverlay.active = false;
|
||||
}
|
||||
|
||||
private setupLoadedLevel(headerTitle: string): void {
|
||||
this.targetCounts = {
|
||||
gold: 0,
|
||||
green: 0,
|
||||
@@ -848,19 +953,16 @@ export class PlayView extends Component {
|
||||
}
|
||||
this.renderer.selectLevel(this.level);
|
||||
|
||||
const numStr = index + 1 < 10 ? '0' + (index + 1) : String(index + 1);
|
||||
this.titleLabel.string = `${numStr} ${this.level.name}`;
|
||||
if (this.nextBtn.label) this.nextBtn.label.string = index + 1 < LEVELS.length ? '下一关' : '返回大厅';
|
||||
this.titleLabel.string = headerTitle;
|
||||
if (this.nextBtn.label) {
|
||||
this.nextBtn.label.string = !this.customMode && this.currentIndex + 1 < LEVELS.length ? '下一关' : '返回大厅';
|
||||
}
|
||||
this.layoutTopChips();
|
||||
this.syncSoundButton();
|
||||
this.syncLanguageChrome();
|
||||
this.state.demoWatched = false;
|
||||
this.resetLevel();
|
||||
if (index === 0 && !this.storage.hasSeenTutorial()) {
|
||||
this.tutorialOverlay.active = true;
|
||||
} else {
|
||||
this.tutorialOverlay.active = false;
|
||||
}
|
||||
this.layoutPlayArea();
|
||||
}
|
||||
|
||||
private dismissTutorial(): void {
|
||||
@@ -919,6 +1021,23 @@ export class PlayView extends Component {
|
||||
this.pointer = null;
|
||||
this.activeNestIndex = 0;
|
||||
this.hideRelativeIndicator();
|
||||
if (this.unspoolMode && this.level.unspool) {
|
||||
this.level.balls = [];
|
||||
this.unspoolHistory = [];
|
||||
this.unspoolNextBallId = 100;
|
||||
this.state.unspool = {
|
||||
removedIds: [],
|
||||
animating: null,
|
||||
slotBallIds: this.level.unspool.slots.map(() => null),
|
||||
deadlocked: false,
|
||||
pulseTargetId: null,
|
||||
pulseUntil: 0,
|
||||
};
|
||||
this.unspoolHeaderLabel.string = `${this.level.unspool.storyTitle}\n点线头抽线`;
|
||||
this.renderer.renderUnspoolClothFrame(this.level.unspool, this.state.unspool, this.state.time, this.state.lines);
|
||||
} else {
|
||||
this.state.unspool = null;
|
||||
}
|
||||
this.setStatus(
|
||||
this.state.demoWatched
|
||||
? '已看过本关演示(本局最高 2 ★,换关后可重新挑战三星)。'
|
||||
@@ -928,6 +1047,160 @@ export class PlayView extends Component {
|
||||
this.renderer.renderFrame(this.state, this.activeNestIndex);
|
||||
}
|
||||
|
||||
private pointToSegDist(px: number, py: number, ax: number, ay: number, bx: number, by: number): number {
|
||||
const dx = bx - ax;
|
||||
const dy = by - ay;
|
||||
const lenSq = dx * dx + dy * dy;
|
||||
const t = lenSq > 0 ? Math.max(0, Math.min(1, ((px - ax) * dx + (py - ay) * dy) / lenSq)) : 0;
|
||||
return Math.hypot(px - (ax + dx * t), py - (ay + dy * t));
|
||||
}
|
||||
|
||||
private onUnspoolClothTouch(event: EventTouch): void {
|
||||
if (!this.unspoolMode || !this.level.unspool || !this.state.unspool) return;
|
||||
if (this.state.complete || this.state.drawing || this.state.unspool.animating) return;
|
||||
this.sound.unlock();
|
||||
event.propagationStopped = true;
|
||||
|
||||
const uiLoc = event.getUILocation();
|
||||
const local = this.unspoolClothTransform.convertToNodeSpaceAR(new Vec3(uiLoc.x, uiLoc.y, 0));
|
||||
const { width, height } = this.unspoolClothTransform.contentSize;
|
||||
const cx = (local.x / width + 0.5) * UNSPOOL_CLOTH_WIDTH;
|
||||
const cy = (0.5 - local.y / height) * UNSPOOL_CLOTH_HEIGHT;
|
||||
|
||||
if (this.level.unspool.clips?.length) {
|
||||
const hitLockedClip = this.level.unspool.clips.find(
|
||||
clip => !isClipUnlocked(clip, this.state.lines) &&
|
||||
cx >= clip.x && cx <= clip.x + clip.w && cy >= clip.y && cy <= clip.y + clip.h,
|
||||
);
|
||||
if (hitLockedClip) {
|
||||
this.sound.block();
|
||||
this.state.unspool.pulseTargetId = hitLockedClip.unlockSectionId;
|
||||
this.state.unspool.pulseUntil = this.state.time + 2200;
|
||||
this.setStatus('这块旧布被木夹夹住了!先绣出绣面上带同纹样木夹标示的针位即可松开。');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const removed = new Set(this.state.unspool.removedIds);
|
||||
const strands = this.level.unspool.strands;
|
||||
const remaining = strands.filter(strand => !removed.has(strand.id));
|
||||
let pickedStrand: typeof strands[number] | undefined;
|
||||
let nearestTip = 33;
|
||||
for (const strand of remaining) {
|
||||
const [x, y] = strand.points[strand.points.length - 1];
|
||||
const dist = Math.hypot(cx - x, cy - y);
|
||||
if (dist < nearestTip) {
|
||||
nearestTip = dist;
|
||||
pickedStrand = strand;
|
||||
}
|
||||
}
|
||||
if (!pickedStrand) {
|
||||
pickedStrand = remaining.reverse().find(strand => strand.points.some(([x, y], index) => {
|
||||
if (index === 0) return false;
|
||||
const [px, py] = strand.points[index - 1];
|
||||
return this.pointToSegDist(cx, cy, px, py, x, y) <= 14;
|
||||
}));
|
||||
}
|
||||
if (!pickedStrand) return;
|
||||
|
||||
const lockedClip = isStrandClipLocked(this.level.unspool, pickedStrand, this.state.lines);
|
||||
if (lockedClip) {
|
||||
this.sound.block();
|
||||
this.state.unspool.pulseTargetId = lockedClip.unlockSectionId;
|
||||
this.state.unspool.pulseUntil = this.state.time + 2200;
|
||||
this.setStatus('这缕线在被木夹锁住的旧布里,先绣出带同纹样木夹标示的针位即可松开!');
|
||||
return;
|
||||
}
|
||||
|
||||
const exposed = isStrandExposed(this.level.unspool, pickedStrand, removed, this.state.lines);
|
||||
if (!exposed) {
|
||||
const blockers = pickedStrand.coveredBy.filter(cid => !removed.has(cid)).length;
|
||||
this.sound.block();
|
||||
this.setStatus(
|
||||
blockers > 1
|
||||
? `这缕旧线被 ${blockers} 缕上层线压住,需先抽走压着它的上层发光线头!`
|
||||
: '这缕旧线还压在底下,先抽走压着它的上层发光线头!',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const capacity = this.level.unspool.capacity ?? this.level.unspool.slots.length;
|
||||
const occupiedCount = this.state.unspool.slotBallIds.filter(id => id !== null).length;
|
||||
if (occupiedCount >= capacity) {
|
||||
this.sound.block();
|
||||
this.setStatus(`线碗已装满(${occupiedCount}/${capacity})。先落针腾一格,或点「撤销」。`);
|
||||
return;
|
||||
}
|
||||
|
||||
const freeSlot = pickedStrand.slotIndex !== undefined && this.state.unspool.slotBallIds[pickedStrand.slotIndex] === null
|
||||
? pickedStrand.slotIndex
|
||||
: this.state.unspool.slotBallIds.indexOf(null);
|
||||
if (freeSlot === -1) {
|
||||
this.sound.block();
|
||||
this.setStatus('线碗已经装满。先落针腾一格,或点「撤销」。');
|
||||
return;
|
||||
}
|
||||
|
||||
this.sound.unspool();
|
||||
this.state.unspool.animating = { strandId: pickedStrand.id, progress: 0, slotIndex: freeSlot };
|
||||
this.setStatus('滋溜抽线中,毛线正卷球滚入线碗…');
|
||||
}
|
||||
|
||||
private finishUnspoolAnimation(): void {
|
||||
if (!this.level.unspool || !this.state.unspool || !this.state.unspool.animating) return;
|
||||
const { strandId, slotIndex } = this.state.unspool.animating;
|
||||
const strand = this.level.unspool.strands.find(s => s.id === strandId);
|
||||
const slotPos = this.level.unspool.slots[slotIndex];
|
||||
this.state.unspool.animating = null;
|
||||
if (!strand || !slotPos) return;
|
||||
|
||||
this.state.unspool.removedIds.push(strandId);
|
||||
const ballId = this.unspoolNextBallId++;
|
||||
const newBall: BallDef = { id: ballId, x: slotPos.x, y: slotPos.y, color: strand.color };
|
||||
this.level.balls.push(newBall);
|
||||
this.state.unspool.slotBallIds[slotIndex] = ballId;
|
||||
this.unspoolHistory.push({ kind: 'unspool', strandId, slotIndex, ballId });
|
||||
this.sound.pick(this.state.unspool.slotBallIds.filter(id => id !== null).length);
|
||||
|
||||
if (!this.checkUnspoolDeadlock()) {
|
||||
const rem = this.level.unspool.strands.length - this.state.unspool.removedIds.length;
|
||||
this.setStatus(
|
||||
rem > 0
|
||||
? `线球落入线碗 ${slotIndex + 1}!可继续抽线,或直接拖蚂蚁开始绣花。`
|
||||
: '旧线已全部拆完,拖蚂蚁把线碗里的毛线织成新画吧!',
|
||||
);
|
||||
}
|
||||
this.updateHud();
|
||||
}
|
||||
|
||||
private checkUnspoolDeadlock(): boolean {
|
||||
if (!this.unspoolMode || !this.level.unspool || !this.state.unspool) return false;
|
||||
const capacity = this.level.unspool.capacity ?? this.level.unspool.slots.length;
|
||||
const occupiedCount = this.state.unspool.slotBallIds.filter(id => id !== null).length;
|
||||
if (occupiedCount < capacity) {
|
||||
this.state.unspool.deadlocked = false;
|
||||
return false;
|
||||
}
|
||||
const unlockedTargets = availableTargets(this.level, this.state.lines).filter(
|
||||
t => !isTargetLocked(this.level, t.id, this.state.lines),
|
||||
);
|
||||
if (unlockedTargets.length === 0) {
|
||||
this.state.unspool.deadlocked = false;
|
||||
return false;
|
||||
}
|
||||
const unlockedColors = new Set(unlockedTargets.map(t => t.color));
|
||||
const bowlColors = this.state.unspool.slotBallIds
|
||||
.map(id => this.level.balls.find(b => b.id === id)?.color)
|
||||
.filter((c): c is TargetColor => Boolean(c));
|
||||
const canDeliver = bowlColors.some(c => unlockedColors.has(c));
|
||||
this.state.unspool.deadlocked = !canDeliver;
|
||||
if (!canDeliver) {
|
||||
this.sound.block();
|
||||
this.setStatus('线碗装满且对应针位还上着锁!点「撤销」换条拆线顺序试试~');
|
||||
}
|
||||
return !canDeliver;
|
||||
}
|
||||
|
||||
private toggleHint(): void {
|
||||
if (this.state.demo || this.state.complete) return;
|
||||
const curTier = this.state.hint?.tier ?? 0;
|
||||
@@ -969,7 +1242,28 @@ export class PlayView extends Component {
|
||||
}
|
||||
|
||||
private undoLastLine(): void {
|
||||
if (!this.state.lines.length || this.state.complete || this.state.demo) return;
|
||||
if (this.state.complete || this.state.demo) return;
|
||||
if (this.unspoolMode && this.state.unspool) {
|
||||
if (this.state.unspool.animating || !this.unspoolHistory.length) return;
|
||||
const last = this.unspoolHistory.pop()!;
|
||||
if (last.kind === 'stitch') {
|
||||
this.state.lines.pop();
|
||||
for (const item of last.restoredBalls) {
|
||||
this.state.unspool.slotBallIds[item.slotIndex] = item.ball.id;
|
||||
}
|
||||
this.setStatus('已收回上一笔刺绣,毛线球放回线碗。');
|
||||
} else {
|
||||
this.state.unspool.removedIds = this.state.unspool.removedIds.filter(id => id !== last.strandId);
|
||||
this.state.unspool.slotBallIds[last.slotIndex] = null;
|
||||
this.level.balls = this.level.balls.filter(b => b.id !== last.ballId);
|
||||
this.setStatus('已把这缕旧线放回旧绣片,可以改抽其他线头。');
|
||||
}
|
||||
this.sound.undo();
|
||||
this.checkUnspoolDeadlock();
|
||||
this.updateHud();
|
||||
return;
|
||||
}
|
||||
if (!this.state.lines.length) return;
|
||||
this.state.lines.pop();
|
||||
if (!this.state.lines.length) this.state.assisted = false;
|
||||
this.sound.undo();
|
||||
@@ -1116,7 +1410,26 @@ export class PlayView extends Component {
|
||||
prepareRouteForRun(route, this.state.time);
|
||||
this.state.lines.push(route);
|
||||
this.state.hint = null;
|
||||
this.setStatus(dispatchWarning(this.level, this.state.lines) || (route.picks.length > 1 ? '两颗球一起出发。' : '蚂蚁出发了,也可继续画下一笔。'));
|
||||
if (this.unspoolMode && this.state.unspool) {
|
||||
const restoredBalls: { slotIndex: number; ball: BallDef }[] = [];
|
||||
for (const p of route.picks) {
|
||||
const sIdx = this.state.unspool.slotBallIds.indexOf(p.ball.id);
|
||||
if (sIdx >= 0) {
|
||||
restoredBalls.push({ slotIndex: sIdx, ball: p.ball });
|
||||
this.state.unspool.slotBallIds[sIdx] = null;
|
||||
}
|
||||
}
|
||||
this.unspoolHistory.push({ kind: 'stitch', restoredBalls });
|
||||
this.state.unspool.deadlocked = false;
|
||||
}
|
||||
this.setStatus(
|
||||
dispatchWarning(this.level, this.state.lines) ||
|
||||
(this.unspoolMode
|
||||
? '蚂蚁出发啦!线碗已腾空,可以继续抽旧线~'
|
||||
: route.picks.length > 1
|
||||
? '两颗球一起出发。'
|
||||
: '蚂蚁出发了,也可继续画下一笔。'),
|
||||
);
|
||||
this.updateHud();
|
||||
return true;
|
||||
}
|
||||
@@ -1154,6 +1467,7 @@ export class PlayView extends Component {
|
||||
const elapsed = now - route.startedAt;
|
||||
let pause = 0;
|
||||
let delivered = false;
|
||||
let unlockedAnyClip = false;
|
||||
for (let i = 0; i < route.events.length; i++) {
|
||||
const ev = route.events[i];
|
||||
const ms = ev.ms ?? 0;
|
||||
@@ -1170,7 +1484,17 @@ export class PlayView extends Component {
|
||||
route.carry.shift();
|
||||
ev.arrivedAt = now;
|
||||
delivered = true;
|
||||
this.sound.deliver();
|
||||
const openedClip = this.level.unspool?.clips?.find(c => c.unlockSectionId === ev.target.id);
|
||||
if (openedClip) {
|
||||
unlockedAnyClip = true;
|
||||
this.sound.bonus();
|
||||
if (this.state.unspool?.pulseTargetId === ev.target.id) {
|
||||
this.state.unspool.pulseTargetId = null;
|
||||
}
|
||||
if (!this.state.drawing) this.setStatus('咔哒!旧布木夹松开了,右侧旧料已解锁可抽!');
|
||||
} else {
|
||||
this.sound.deliver();
|
||||
}
|
||||
} else if (isSpoolEvent(ev)) {
|
||||
ev.collectedAt = now;
|
||||
this.sound.bonus();
|
||||
@@ -1205,7 +1529,9 @@ export class PlayView extends Component {
|
||||
route.ant.walk = walking;
|
||||
|
||||
if (delivered) {
|
||||
if (!this.state.drawing) this.setStatus(dispatchWarning(this.level, this.state.lines) || '送达落针!');
|
||||
if (!this.state.drawing && !unlockedAnyClip) {
|
||||
this.setStatus(dispatchWarning(this.level, this.state.lines) || '送达落针!');
|
||||
}
|
||||
this.updateHud();
|
||||
}
|
||||
if (elapsed >= route.duration) {
|
||||
@@ -1378,9 +1704,10 @@ export class PlayView extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
this.undoBtn.setEnabled(!this.state.demo && !this.state.complete && this.state.lines.length > 0);
|
||||
this.demoBtn.setEnabled(!this.state.demo);
|
||||
this.hintBtn.setEnabled(!this.state.demo && !this.state.complete);
|
||||
const canUndo = this.unspoolMode ? this.unspoolHistory.length > 0 : this.state.lines.length > 0;
|
||||
this.undoBtn.setEnabled(!this.state.demo && !this.state.complete && canUndo);
|
||||
this.demoBtn.setEnabled(!this.state.demo && !this.unspoolMode);
|
||||
this.hintBtn.setEnabled(!this.state.demo && !this.state.complete && !this.unspoolMode);
|
||||
this.hintHalo.active = Boolean(this.state.hint);
|
||||
if (this.hintBtn.label) {
|
||||
this.hintBtn.label.string = this.state.hint ? `提示 ${this.state.hint.tier}/3` : '提示';
|
||||
@@ -1391,6 +1718,7 @@ export class PlayView extends Component {
|
||||
this.syncLoupeButton();
|
||||
|
||||
this.dockTrayNode.active = !this.state.complete;
|
||||
this.unspoolPanelNode.active = this.unspoolMode && !this.state.complete;
|
||||
this.resultOverlay.active = this.state.complete;
|
||||
if (this.state.complete) {
|
||||
const rawStars = scoreForLength(this.level, totalLength(this.state.lines));
|
||||
@@ -1411,7 +1739,7 @@ export class PlayView extends Component {
|
||||
this.resultLengthLabel.string = '用线 ' + formatLength(totalLength(this.state.lines)) + suffix;
|
||||
if (this.nextBtn.label) {
|
||||
const gate = this.getNextChapterGate();
|
||||
if (this.currentIndex + 1 >= LEVELS.length) {
|
||||
if (this.customMode || this.currentIndex + 1 >= LEVELS.length) {
|
||||
this.nextBtn.label.string = en ? 'Lobby' : '返回大厅';
|
||||
} else if (gate.locked) {
|
||||
this.nextBtn.label.string = en ? `Need ${gate.req}★` : `集满${gate.req}★解锁下章`;
|
||||
@@ -1442,6 +1770,16 @@ export class PlayView extends Component {
|
||||
const clampedMs = Math.min(50, Math.max(0, dt * 1000));
|
||||
this.state.time += clampedMs;
|
||||
|
||||
if (this.unspoolMode && this.level.unspool && this.state.unspool) {
|
||||
if (this.state.unspool.animating) {
|
||||
this.state.unspool.animating.progress += clampedMs / 340;
|
||||
if (this.state.unspool.animating.progress >= 1) {
|
||||
this.finishUnspoolAnimation();
|
||||
}
|
||||
}
|
||||
this.renderer.renderUnspoolClothFrame(this.level.unspool, this.state.unspool, this.state.time, this.state.lines);
|
||||
}
|
||||
|
||||
if (this.state.demo) this.runDemo(this.state.time);
|
||||
for (const line of this.state.lines) {
|
||||
if (!line.finished) this.animateRoute(line, this.state.time);
|
||||
@@ -1472,7 +1810,7 @@ export class PlayView extends Component {
|
||||
this.state.complete = true;
|
||||
this.state.demo = false;
|
||||
this.setStatus(this.state.assisted ? '演示完成,点「重绣本关」自己试一试。' : '这一幅绣好啦,可以保存绣画留念!');
|
||||
if (!this.state.assisted) {
|
||||
if (!this.state.assisted && !this.customMode) {
|
||||
const len = totalLength(this.state.lines);
|
||||
const rawStars = scoreForLength(this.level, len);
|
||||
const earnedStars = this.state.hintCapped ? Math.min(2, rawStars) : rawStars;
|
||||
|
||||
@@ -0,0 +1,366 @@
|
||||
# 《蚂蚁织画》拆旧织新 · 100 关设定、难度曲线与 10 章风格
|
||||
|
||||
**整理日期** 2026 年 11 月 25 日
|
||||
**内容规模** 10 章,每章 10 关。001–030 已实装,031–100 为设计规划。第 8 章每关两种成品,100 关共规划 110 种成品。
|
||||
|
||||
- [玩法规则](#一玩法规则)
|
||||
- [难度曲线](#二难度曲线)
|
||||
- [十章美术风格](#三十章美术风格)
|
||||
- [100 关逐关设定](#四100-关逐关设定)
|
||||
- [样板关与制作验收](#五样板关与制作验收)
|
||||
- [二轮评审与灰盒方案](#六二轮评审与灰盒方案)
|
||||
|
||||
> 前五节记录当前实装和原规划。第六节是二轮评审后的下一版灰盒方案。
|
||||
|
||||
## 一、玩法规则
|
||||
|
||||
玩家从旧围巾、旧针线袋或旧荷包上取线,交给小蚂蚁织成一幅新画。旧线随抽取逐渐退去,新图随落针分区显影。抽线前要考虑这团线能否立即使用,以及送出去后会打开哪条路或哪枚针。
|
||||
|
||||
1. **抽出旧线。** 点旧织物上发光的露出线头,线卷成球落入空碗。有压层时,要先抽上层才能取下层。旧线板在绣绷上方,供线碗在绣绷的下部。
|
||||
2. **管理线碗。** 每团占一格。第一章有三格,第二、三章用两格。满碗时先把能落针的线送走。两碗都装上暂时用不了的线时,可撤销最近一步或重来。
|
||||
3. **拖线落针。** 从蚁巢起手,拖过线碗里的球,送到同色针位。一只蚂蚁可串两颗同色球。有效落针会消耗线团、腾出线碗,也可能开放花锁或搭起水桥。
|
||||
4. **完成新画。** 绣齐必做针位即通关。用线越短星级越高,通关即解锁下一关。当前发布逻辑从 001 顺序推进,编辑器预览可跳关。抽线与织线在同一操作顺序中撤销。
|
||||
|
||||
**031–100 计划引入的机制** 多蚁巢、染缸与半途换色、不可交叉、顺向针门、必经扣、双图稿和旧料线夹。第 8 章允许提前查看两张图稿,第一枚专属针确定作品。完成公共针与所选专属针即可收工,选另一稿所需余线可留下。第 9 章起,落针还会反向打开旧料夹。
|
||||
|
||||
**后续加碗方案** 激励视频可在双碗关内一次性加一格,为卡关玩家提供缓冲。基础容量下的通关与三星路线仍需独立验证。
|
||||
|
||||
## 二、难度曲线
|
||||
|
||||
难度衡量玩家要同时考虑的依赖,以及一次取线对后续资源、路线和针位的影响。旧线数量给出制作规模。章首复习上章或单练新机制,每章第 7 关安排短作品,第 8–9 关增加推演,第 10 关收束本章机制。
|
||||
|
||||
| 档位 | 玩家需要判断 | 参考操作量 |
|
||||
| --- | --- | --- |
|
||||
| D1 · 上手 | 找到露出的线头和同色针位。 | 1–2 笔 |
|
||||
| D2 · 单一选择 | 判断先抽哪根、何时腾格或从哪边绕行。 | 1–3 笔 |
|
||||
| D3 · 看下一步 | 拆之前考虑下一层和下一针,保留必要空碗。 | 2–4 笔 |
|
||||
| D4 · 两步规划 | 在取线、落针、桥和锁之间安排前后,或为两条线分配同一条路。 | 3–6 笔 |
|
||||
| D5 · 组合 | 同时安排线层、容量和多个机关,起手影响之后的解法。 | 3–6 笔 |
|
||||
| D6 · 进阶 | 规划多步依赖,比较至少两种能够推进的开局。 | 4–7 笔 |
|
||||
| D7 · 终局 | 分段规划多片取线、机关和走线,再执行整套方案。 | 终局优先验证 7–9 笔 |
|
||||
|
||||
章内档位从左到右对应第 1–10 关。操作量用于设计预估,串双球和分送会改变实际笔数。
|
||||
|
||||
| 章与关号 | 旧料与线量 | 基础线碗 | 章内档位 | 均值 | 难度重点 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 01 初拆旧围巾 · 001–010 | 单片旧围巾,1–4 缕 | 3 格 | 1 · 1 · 1 · 1 · 2 · 2 · 1 · 2 · 2 · 3 | 1.6 | 露头、压层与同色落针 |
|
||||
| 02 两格针线盒 · 011–020 | 单片旧针线袋,2–5 缕 | 2 格 | 1 · 2 · 2 · 2 · 3 · 3 · 2 · 3 · 3 · 4 | 2.5 | 先用一团,再给底层留位 |
|
||||
| 03 叶桥与花锁 · 021–030 | 单片旧荷包,2–6 缕 | 2 格 | 2 · 2 · 3 · 3 · 3 · 4 · 2 · 4 · 4 · 4 | 3.1 | 旧线压层、双桥与花锁链 |
|
||||
| 04 蚂蚁分线 · 031–040 | 1 片,约 2–6 缕 | 2 格 | 2 · 3 · 3 · 4 · 4 · 4 · 2 · 4 · 4 · 5 | 3.5 | 多蚁巢分工与单向门 |
|
||||
| 05 染坊余线 · 041–050 | 1–2 片,约 1–7 缕 | 2 格 | 2 · 3 · 3 · 4 · 4 · 4 · 3 · 4 · 5 · 5 | 3.7 | 有限染色与半途换色 |
|
||||
| 06 拼布来信 · 051–060 | 2 片,约 2–7 缕 | 2 格 | 3 · 3 · 4 · 4 · 4 · 5 · 3 · 4 · 5 · 5 | 4.0 | 在两片旧布间换料,分配同色线 |
|
||||
| 07 留一条路 · 061–070 | 1–2 片,约 2–8 缕 | 2 格 | 3 · 4 · 4 · 4 · 5 · 5 · 3 · 5 · 5 · 6 | 4.4 | 不交叉、针门与必经扣 |
|
||||
| 08 一布两绣 · 071–080 | 2 片,约 3–8 缕可取 | 2 格 | 3 · 4 · 4 · 5 · 5 · 5 · 3 · 5 · 5 · 6 | 4.5 | 公共针位与专属成品分支 |
|
||||
| 09 新针开旧夹 · 081–090 | 2–3 片,约 2–8 缕 | 2 格 | 3 · 4 · 5 · 5 · 5 · 6 · 4 · 5 · 6 · 6 | 4.9 | 落针反向解锁旧料夹 |
|
||||
| 10 百针长卷 · 091–100 | 2–3 片,约 3–9 缕 | 2 格 | 4 · 4 · 5 · 5 · 6 · 6 · 4 · 5 · 6 · 7 | 5.2 | 三片取料、两桥和染色的阶段组合 |
|
||||
|
||||
**首审的关键台阶。** 010 先用三格教锁,020 在两格内组合供线、桥与花锁,026、028、029、030 再要求预判起手。首审最难的 030 有 6 缕旧线、2 个碗、2 座桥。规划里的 9 缕线留到 100 关。首审 30 关已通过抽线层级、容量与三星参考路线审计,020、026、028、029、030 各有至少两种可行起手。 [实装关卡配置](../assets/scripts/core/ReleaseLevels.ts) · [验关脚本](../tools/audit-release.mjs)
|
||||
|
||||
## 三、十章美术风格
|
||||
|
||||
统一采用可见针脚和织物触感。1–3 章用暖亚麻,4–6 章用奶油布贴,7–9 章用月色轻纱,第 10 章把三种工艺串进长卷。首页沿用奶油布贴 UI,各章工艺体现在关卡作品和展柜成品。
|
||||
|
||||
| 章 | 工艺 | 色彩、材质与图案安排 | 章末成品 |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 初拆旧围巾 | 暖亚麻植物绣 | 象牙亚麻、姜黄棉线、灰绿叶脉与豆沙粉。把一根金线的小花心逐步扩成花册。 | 010 围巾里的向日葵 |
|
||||
| 2 两格针线盒 | 暖亚麻植物绣 | 保留暖白布底,增加雾蓝、浅杏与棉线风铃。线结、铃片、挂环形成错落的小件。 | 020 风铃穿针盒 |
|
||||
| 3 叶桥与花锁 | 暖亚麻植物绣 | 灰绿荷叶、浅蓝水纹、豆沙荷花与姜黄灯。桥、水和花锁分区,装饰留在可走区域之外。 | 030 荷塘夜灯 |
|
||||
| 4 蚂蚁分线 | 奶油布贴绣 | 奶油黄薄棉与浅杏桃布贴。左右鸟翼用清晰裁边和细缝线,窗洞作为留白。 | 040 穿窗百鸟 |
|
||||
| 5 染坊余线 | 奶油布贴绣 | 杏桃花芯、雾蓝格窗、暖黄窗框。用薄棉、罗纹和几何窗片区分待染的部位。 | 050 染坊花窗 |
|
||||
| 6 拼布来信 | 奶油布贴绣 | 两种来源分别用细灯芯绒和低对比格纹薄棉。题材集中在信封、邮票、花封和圆印。 | 060 把家书拼好 |
|
||||
| 7 留一条路 | 月色轻纱绣 | 雾蓝、浅灰紫、珠白。半透明纱翼和细飘带顺着动势展开,通行区域保持清晰。 | 070 星夜风筝 |
|
||||
| 8 一布两绣 | 月色轻纱绣 | 同底布配晨光暖金或雨夜灰蓝。两幅成品共享主体骨架,用明暗、重心与方向区分。 | 080 晨窗/雨窗 |
|
||||
| 9 新针开旧夹 | 月色轻纱绣 | 雾蓝轻纱加少量珠白描边,画挂环、车窗、票袋与旅行章。旧夹沿用与针位呼应的纹样。 | 090 寄回来的行囊 |
|
||||
| 10 百针长卷 | 三种工艺合卷 | 暖亚麻作统一底,依次铺植物花叶、布贴窗桥、轻纱月色。保持三段轮廓和水路在小屏上都可读。 | 100 百针长卷 |
|
||||
|
||||
**对局可读性。** 用线色和纹样匹配旧线、线碗与针位。装饰可预绣成浅轮廓,例如花心、枝干或窗框。轻纱针位在对局加清楚描边,收工后恢复透光。线夹、锁扣和针门各用统一图标。用亮度和轮廓区分装饰与可落针部位。
|
||||
|
||||
**资源安排。** 每组先做一块底布、可复用针脚和几种基础轮廓,普通关通过面片、配色与构图改出差异。先用 010、050、070 验证三组材质,章末共规划 11 张高精收藏图,含 080 两个版本。 [三组美术样稿](art-review/chapter-styles/三组章节美术样稿.md) · [后两组材质修订](art-review/chapter-styles/revised-materials/后两组材质修订.md)
|
||||
|
||||
## 四、100 关逐关设定
|
||||
|
||||
001–030 的关名与盘面来自当前配置,旧线缕数写在盘面栏开头。031–100 沿用原规划的关名和档位,成品可使用独立的收藏名。规划关卡的坐标、耗线和替代走法在灰盒阶段确定。
|
||||
|
||||
### 第 1 章 · 初拆旧围巾 · 001–010
|
||||
|
||||
**已实装** 把阿婆的围巾边角拆出金黄、灰绿和豆沙粉,织成能放在窗边的花册。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 001 | 第一根线 | D1 | 1 缕。点唯一露出的金线头,把卷入碗中的金球送到花心。 | 一枚金色绣花针区。 |
|
||||
| 002 | 围巾的一层边 | D1 | 2 缕。浅杏线压着金线,两处针位均开放,先抽上层再露出金线。 | 浅杏色叶形边片和金色花。 |
|
||||
| 003 | 双瓣初开 | D1 | 2 缕。两缕金线都露头,两笔分送或一笔串双球都可。 | 两枚金色花瓣区。 |
|
||||
| 004 | 一金一绿 | D1 | 2 缕。两团异色线可任选起手,辨认同色针位。 | 上方金花与右下绿叶。 |
|
||||
| 005 | 露出线头 | D2 | 3 缕。一组绿线压金线,另一团粉线露头,观察抽线如何改变供给。 | 一片绿叶与两枚异色花。 |
|
||||
| 006 | 左右花瓣 | D2 | 4 缕。两组分别为粉压绿、粉压金,比较先从哪组取料。 | 两侧粉花、绿叶与金花。 |
|
||||
| 007 | 午后茶花 | D1 | 2 缕。两团粉线并列露头,可短路织成作品。 | 两片粉花,可用针脚方向区分。 |
|
||||
| 008 | 水边的小芽 | D2 | 2 缕。两缕线都能取,拖线绕过一处水洼。 | 水边的绿叶与金芽。 |
|
||||
| 009 | 针线盒归位 | D2 | 3 缕。两金一绿可同时临存,比较双金串送与分别送。 | 左右金花与中间绿叶。 |
|
||||
| 010 | 围巾里的向日葵 | D3 | 4 缕。两组为金压绿、金压粉,绿叶落针开放一枚原本锁住的金针。 | 两金花、绿叶和粉色花区。 |
|
||||
|
||||
### 第 2 章 · 两格针线盒 · 011–020
|
||||
|
||||
**已实装** 将旧针线袋的花边拆成一串风铃。小作品偏生活物件,延续植物绣的细棉线。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 011 | 两只浅槽 | D1 | 2 缕。基础容量改为两格。将两团异色线依次送出,观察落针腾格。 | 蓝与金两枚铃片。 |
|
||||
| 012 | 先送眼前的一团 | D2 | 3 缕。三缕都露头,两格装满后先送一团,再取剩下的一团。 | 粉、金、蓝三枚错落铃片。 |
|
||||
| 013 | 细边两卷 | D2 | 3 缕。单组绿压粉、粉压金,需要在拆完之前先用掉一团。 | 绿叶、粉铃和金铃。 |
|
||||
| 014 | 空格留给同色 | D2 | 3 缕。绿与双金均可取,留出两格可以一笔送双金。 | 绿叶与左右金铃。 |
|
||||
| 015 | 星星露一角 | D3 | 3 缕。金盖绿,旁边有粉线。金针暂锁,需给绿线留位置。 | 金铃、绿叶、粉铃。 |
|
||||
| 016 | 锁上挂绳 | D3 | 3 缕。粉盖绿,另有金线。绿叶、粉铃、金铃依次解锁。 | 绿结和一粉一金两枚铃片。 |
|
||||
| 017 | 两瓣余香 | D2 | 2 缕。双粉都露头,两格即可收齐,用短路径完成。 | 两枚近处粉色小风铃。 |
|
||||
| 018 | 两种铃声 | D3 | 4 缕。左粉盖绿,右金盖绿。先取得的绿线可以选择开启哪边。 | 两枚绿叶各关联一侧铃片。 |
|
||||
| 019 | 三卷一花 | D3 | 4 缕。蓝与粉各盖一缕金,先送出好用的一团,可为双金腾空间。 | 蓝、粉与双金四枚铃片。 |
|
||||
| 020 | 风铃穿针盒 | D4 | 5 缕。粉线盖绿,金线盖蓝,浅杏线另组。绿开粉锁,蓝搭桥并开放金针,粉再开放浅杏针。 | 铃片、叶结、蓝水纹与浅杏花。 |
|
||||
|
||||
### 第 3 章 · 叶桥与花锁 · 021–030
|
||||
|
||||
**已实装** 旧荷包拆成一组池边小景。叶、桥和花苞同时是可识别的机关形状。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 021 | 露珠与小荷 | D2 | 2 缕。绿与粉各自露头,只有绣完绿叶后粉花才开放。 | 左侧绿叶与右上粉荷。 |
|
||||
| 022 | 金蕊睡莲 | D2 | 2 缕。先拆金线才出现下层绿线,绣绿叶后开放金针。 | 金蕊在上,绿叶在下。 |
|
||||
| 023 | 荷叶渡 | D3 | 3 缕。绿线露头,金线压着蓝线。可先织绿叶搭桥,也可让金舟先沿岸绕行。 | 绿叶、金舟、蓝水纹。 |
|
||||
| 024 | 晨露叶桥 | D3 | 3 缕。两条金线都露头,左金盖着绿线。两枚金针同时等绿叶搭桥并解锁。 | 左右两枚金花与中段绿叶桥。 |
|
||||
| 025 | 双叶金盏 | D3 | 4 缕。两组金线各盖一团绿线,绿针的落点决定开放哪一枚金花。 | 两片绿叶与两侧金花。 |
|
||||
| 026 | 水田双桥 | D4 | 5 缕。粉盖绿、金盖蓝,另有一团浅杏。可先开左侧绿桥或右侧蓝桥,两种起手改变可用针位。 | 绿叶、蓝水纹与三处岸花。 |
|
||||
| 027 | 扁舟靠岸 | D2 | 2 缕。两缕线都露头,短路线织船与水纹。 | 金色扁舟和蓝色近岸水纹。 |
|
||||
| 028 | 荷茎上的两瓣 | D4 | 5 缕。粉色两瓣分别在两组上层,两枚绿针和蓝水纹控制开桥、开锁的次序。 | 共用荷茎构图,双粉花、双绿叶及蓝水纹。 |
|
||||
| 029 | 并蒂荷与叶桥 | D4 | 5 缕。金压绿、粉压蓝。绿叶开桥并放开粉针,蓝纹放开金针,粉针再打开浅杏针。 | 两侧花叶、蓝水纹与中间浅杏花。 |
|
||||
| 030 | 荷塘夜灯 | D4 | 6 缕。金压绿、粉压蓝、浅杏压金。两座桥的开启顺序决定哪团旧线先有去处,浅杏花完成后开放最后一盏金灯。 | 双桥、两枚金花灯与池边花叶。 |
|
||||
|
||||
### 第 4 章 · 蚂蚁分线 · 031–040
|
||||
|
||||
**规划** 一张浅色旧窗帘,改成能别在窗边的布贴鸟。布片对应鸟翼和枝叶,便于理解双巢分工。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 031 | 窗下双巢 | D2 | 左右各有蚁巢和对应供线口。两个相隔较远的针位引导玩家从近巢起手。 | 《窗边一双燕》。两处独立小燕布片,左右各一枚宽针,便于分别从最近的巢开局。 |
|
||||
| 032 | 借巢送羽 | D3 | 两座巢都能够到一颗金球。看目标在水洼哪侧,选择更顺的出发点。 | 《隔水金翅》。一枚金色大鸟翼在水洼对侧,两巢均可拾到金球,花窗的一角只做底稿。 |
|
||||
| 033 | 叶片借道 | D3 | 绿线先送到搭桥针,粉线既能从近巢绕行,也能从远巢穿桥。比较两条方案的后续影响。 | 《叶舟送燕》。绿布叶承担搭桥,粉色燕翼在对岸。下方的宽布桥与上方绕行路径分区。 |
|
||||
| 034 | 两鸟共针 | D4 | 两颗粉球可分别从左右巢送出,也可从一侧串双球。两种走法在步数和经过绣面的位置上有差异。 | 《共枝的粉雀》。左右两枚杏粉鸟翼组成一对鸟,可分送也可串双球。 |
|
||||
| 035 | 归燕换枝 | D4 | 两个同色针位都能接收先抽出的球,一处落针会解锁第二团的近路。选第一颗球送哪个针位。 | 两枚同色鸟身分居上下枝,一枚布片显影后露出通向下一枚的枝路。 |
|
||||
| 036 | 向东的线 | D4 | 中间窄道只有顺向针门,左巢和右巢都有毛线球。玩家先考虑用哪种颜色完成穿门任务。 | 《向东的折翅》。两处布翼朝同一方向。中间窗格只有一个顺向门,统一的箭头机制图标贴近窗格。 |
|
||||
| 037 | 枝头双鸟 | D2 | 两团露线、双巢、大针位。两条短路线织成停在一起的鸟。 | 两只短尾小雀各由一块大布片组成,两针即可显出完整双鸟。 |
|
||||
| 038 | 合翼留窗 | D4 | 一笔串球会从中心横过,另外一种颜色后续还需要中心通道。提前决定分送还是给它留外路。 | 中央留白是一扇窗,两块同色大翼可串绣,第三色小尾羽要经窗边走廊。 |
|
||||
| 039 | 三巢让路 | D4 | 三巢、两金一绿、不交叉。三笔方案省线,两笔方案需要给绿线预留外圈。两套方案都能完成。 | 左右两枚金翼、中央绿枝,共三域。沿用已验算的两金一绿位置关系。 |
|
||||
| 040 | 穿窗百鸟 | D5 | 章末。两片针区由一个狭口相连,两个同色球从不同巢可拾。抽取次序决定先满足哪组,已铺线路影响另一组的走法。 | 左右各一组鸟翼,布片交会处保留一个窗洞。通关显影层补小鸟眼、窗棂与远端枝叶。 |
|
||||
|
||||
### 第 5 章 · 染坊余线 · 041–050
|
||||
|
||||
**规划** 米白旧布染出窗花,最后织成一扇可以挂在桌边的小花窗。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 041 | 白线入缸 | D2 | 一根白线、一口蓝缸、一枚蓝针。让玩家亲眼看白球变蓝再落针。 | 《蓝染窗片》。单枚雾蓝方格布是唯一针位,窗沿浅预绣,先学白线入蓝缸。 |
|
||||
| 042 | 颜色留给谁 | D3 | 一根白线和一根粉原色线,两座不同色染缸开放。根据尚缺的针位决定白线的用途。 | 《粉与另一格》。固定粉色花片与待染色窗片分开。玩家从两个染缸和当前缺色选择。 |
|
||||
| 043 | 同染两团 | D3 | 两根白线可从旧层连续抽出,一口限次染缸。练习两团同笔入染,核对落针顺序。 | 《一对蓝格》。两枚同蓝布格并排在窗框内,适合一次同染两团。 |
|
||||
| 044 | 粉缸等一针 | D4 | 粉针暂锁,蓝针可先落。白线和蓝球竞争托盘空间,先用能落针的一团腾位置。 | 《等开的粉格》。下方雾蓝窗格先落针,开放上方杏粉花格。 |
|
||||
| 045 | 先用原色 | D4 | 上层金线盖白线,场上已有金针和蓝针。让玩家比较先用原色、何时留白线补另一处。 | 《金罗纹窗角》。金色实布窗角和雾蓝薄布窗芯都明确。先用金的那一步让下层白线出现。 |
|
||||
| 046 | 一针一换色 | D4 | 一笔串两团同色,先落第一针,再走覆染缸换色送第二针。新动作单练,通道宽松。 | 《一翼两色》。两块相邻布翼分别承接覆染前后颜色。一笔落两针,成品沿中缝换色。 |
|
||||
| 047 | 晒布一刻 | D3 | 一根蓝原色线、一根白线、两个近针位。短路线完成染色与原色的配合。 | 《晒在窗上的布》。一蓝一待染窗片,两个近针位,连底稿上的晾线组成一张小晒布图。 |
|
||||
| 048 | 双色琉璃 | D4 | 两处白线分层出现,两个不同色缸都只有一次机会。选先染哪一色,以便下一团顺利落针。 | 《双层琉璃花》。同一扇花窗里的两种布片纹理对照,两处待染目标分别有明确的色提示。 |
|
||||
| 049 | 窗影余色 | D5 | 原色蓝线既能开桥也能留给后针,白线可作替补。同一次染色与路线绕行之间形成选择。 | 《窗影的双蓝》。两处蓝区分别作为可开桥的近格、最终窗心水纹。原色或染出的蓝都能补位。 |
|
||||
| 050 | 染坊花窗 | D5 | 章末。两块供线料、一次同染和一次半途换色。先织金窗打开入口,再用换色线织另一侧的粉边。明确标出染缸和两处落针时机。 | 两块金黄窗框、必要的蓝窗纹与粉边。优先让金框打开可走区域,再用换色针完成粉边。 |
|
||||
|
||||
### 第 6 章 · 拼布来信 · 051–060
|
||||
|
||||
**规划** 两位家人寄来的旧布合成一封家书。左片以细灯芯绒为主,右片以薄棉和低对比细格为主。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 051 | 两片旧布 | D3 | 左片露金、右片露绿,目标两侧开放。示范两片旧料的线共享一个托盘。 | 《两片布书签》。左金色布条与右绿叶布贴组成书签。两片材料的厚度不同,目标区清晰分开。 |
|
||||
| 052 | 同色不同来处 | D3 | 两片各露出一团粉线,分别在靠近两座巢的供线点。为了下一层,选择先消耗哪片的粉线。 | 《同色双邮票》。浅灯芯绒粉和薄棉粉的两个邮票图案分别靠近两巢。同属粉针,来源与落点可交换。 |
|
||||
| 053 | 短缺的蓝线 | D4 | 左片的蓝线压在金线下,右片先露可染白线。两种取蓝方式都可用,解锁的下一层不同。 | 《蓝色信封角》。金色封印和蓝封角分为两个显影区。现成白底文纸衬出两种取得蓝线的办法。 |
|
||||
| 054 | 交换针位 | D4 | 两个同色针位分别开左右侧路。先选来源,再选落针点,照顾后续另一片料的走线空间。 | 《左右花封》。两个同色花封分别连接左右开启区,保留中间一条给后针的清楚走廊。 |
|
||||
| 055 | 一封蓝信 | D4 | 粉压绿、金压蓝,另有白线。绿叶先解锁粉瓣和水纹,天然蓝与染出的蓝可交换用在水纹和云纹。 | 绿叶先开粉瓣和蓝水纹,水纹开金岸,最后补蓝云纹,共五区。天然蓝和染蓝可互换。 |
|
||||
| 056 | 金边包角 | D5 | 两片各有一根金线,一根下面压着最先需要的颜色。先用能落针的金球腾位,再安排另一团。 | 信封上两枚同色金角独立落针,其中一枚接近当前可用区域,让先腾托盘格有对应图形。 |
|
||||
| 057 | 邮票花边 | D3 | 两片各有一段可直接取用的旧线。选先完成哪枚邮票,2–3 笔内成画。 | 一枚树叶邮票和一枚小鸟邮票,分别填一个大形,两至三笔可完成。 |
|
||||
| 058 | 两头齐进 | D4 | 左片先给一座叶桥供线,右片先给边缘针供线。都能开局,但第一笔会决定第二笔从哪个蚁巢更顺。 | 左侧叶桥和右侧信纸花边都是开局可绣区,通关时把两端接到一张小笺。 |
|
||||
| 059 | 借一抹蓝 | D5 | 一片供应两团蓝,另一片供应限次染色用的白。选从哪边取得首枚蓝针的线,以免将较难取的下一层挡在未用颜色后。 | 两枚蓝布片形成信纸与云纹,旁边用同色纹样显示蓝色的两种来源。 |
|
||||
| 060 | 家书的拼布 | D5 | 章末。两片各有关键的隐压线,计划两次换片,先织中间的共同区域,再选左右收尾顺序。 | 《把家书拼好》。中央是一枚共享封印,左右分别补成杏桃布角和雾蓝信纸边。章末展示两侧来源布的细纹。 |
|
||||
|
||||
### 第 7 章 · 留一条路 · 061–070
|
||||
|
||||
**规划** 拆旧风筝尾,改织一组天空小景。夜色采用雾蓝和灰紫,通行区以留白和描边示意。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 061 | 风筝绕线 | D3 | 两色供线和两条清楚的走廊,示范已铺线路不可交叉,预留一条明显的外圈。 | 《初放纸鸢》。一片纱翼与一段纱穗,分别沿左右开放走廊显影,顺便看清不交叉。 |
|
||||
| 062 | 错开木扣 | D4 | 两种颜色都能穿过同一必经扣。哪个颜色抢到近路,会改变另一种颜色的绕行。 | 《结在风里的扣》。两种颜色的风筝带分向两侧,都可从同一枚必经扣经过。扣点在飘带交会处。 |
|
||||
| 063 | 河口只剩一侧 | D4 | 岸边两道窄口,先走近端针可能占死另一线路的短道。通过挪动首笔路线保留河口。 | 《河口飞羽》。一枚近岸纱羽与一枚彼岸尾羽间留双窄口,供玩家辨认先走哪条会占去另一条。 |
|
||||
| 064 | 针门换人过 | D4 | 同一个单向门可以由两个蚁巢的线经过,供线开放时机不同。让玩家决定哪笔负责穿门。 | 《顺风小燕》。左右翼用不同雾色。顺向针门沿一条斜伸的绣线标明,任一符合方向的绣线都可穿过。 |
|
||||
| 065 | 先拆挡路色 | D5 | 抽出的异色实体球会挡住一个走廊。玩家要在抽它之前先织过走廊,或准备马上把它送走。 | 《桥前飘带》。伸出远端的纱带需要一条窄路,异色实体球出现在第二条尾带区域的入口处。 |
|
||||
| 066 | 夜桥前的长线 | D5 | 绿针搭桥,另一笔可以先走内侧或外侧。让绿针路线和搭桥后紧接的一笔空间兼容。 | 《月下叶桥》。绿针开桥,另一处纱翼可由内侧或外侧到达。把桥的两头留白,体现预留路线。 |
|
||||
| 067 | 风停时 | D3 | 两段旧线、两枚近针。已标出平行走廊,做一片短小的风筝尾。 | 两片近处的小风筝尾,绣好后组成一对细穗。短线也能看到叠纱完成的效果。 |
|
||||
| 068 | 另一条星轨 | D5 | 两颗同色球可以由不同巢送到两处目标。交换球与针的配对,能留出第三种颜色的走廊。 | 两处同色长星轨和一枚异色小星,交换星轨的球与目标能为小星保留入口。 |
|
||||
| 069 | 针门外的一格 | D5 | 双巢、单向门和两格暂存。要先决定谁穿门,再选哪团值得占着槽等针位开放。 | 《门外有颗星》。主体由过门的纱带和门外的星片组成,门边留出清楚的备料提示区。 |
|
||||
| 070 | 一线穿夜空 | D6 | 章末。一座桥开通后仍要留一条路给粉线,蓝线与绿线都能合法起手。先规划谁搭桥、谁穿扣,再决定取哪团。 | 《星夜风筝》。蓝翼、绿桥、粉尾和少量珠白星点组成终图。桥针、穿扣与粉尾通道各有清楚的视觉位置。 |
|
||||
|
||||
### 第 8 章 · 一布两绣 · 071–080
|
||||
|
||||
**规划** 拆一块旧桌布,交出想要的那一幅。章节陈列图稿翻页,先织哪处专属针位决定成品。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 071 | 两朵不同的花 | D3 | 一枚绿叶公共针位,两种颜色的花瓣专属针位。通过第一枚专属针选择绣品,另一根线可留在旧布上。 | 《杏色山茶》/《粉纱铃兰》。共用绿叶。金色(可呈浅杏金)大瓣形成圆山茶,粉色垂瓣形成一簇小铃兰。 |
|
||||
| 072 | 雨前和雨后 | D4 | 公共轮廓先完成,晴稿要金线,雨稿要蓝线。旧片露头不同,玩家先按想要的成品备料。 | 《放晴的伞》/《落雨的伞》。共用伞柄或伞身轮廓。金色半圆伞面偏上,蓝色雨纹伞面向下延伸。 |
|
||||
| 073 | 昼鸟与夜鸟 | D4 | 两个巢各靠近一种图稿的落针区。第一枚专属落针确定图稿,另一稿可提前预览。 | 《晨鸟》/《夜鸟》。共用预绣枝条。晨鸟是向左张开的浅色翼,夜鸟是向右收拢的深色雾紫纱翼。两巢分别靠近对应图稿。 |
|
||||
| 074 | 池心双景 | D5 | 绿叶搭一座共用桥,粉稿走外边,金稿需要先把桥上的空间留出来。两条路线各有优势。 | 《池上粉荷》/《桥边金影》。共用绿叶桥。粉稿沿外侧开花,金稿在桥下织出一支向内的倒影。 |
|
||||
| 075 | 窗上的晨昏 | D5 | 同一根白线能染成金或粉,两稿有不同先后。若选择白线作填色,要安排什么时候把它从托盘用掉。 | 《晨光花窗》/《傍晚花窗》。共用窗轴和框线。白线染金后形成上半窗斜光,染粉后形成下半窗花帘。 |
|
||||
| 076 | 晴川与暮川 | D5 | 公共针位是绿叶和水纹。晴稿用金线织桥,暮稿用粉线织花。蓝线压在金线下,暮稿要暂存一根不必用掉的金线。 | 《晴川金桥》/《暮川粉花》。共用绿叶和蓝水纹。晴稿加金桥,暮稿加粉花。蓝压在金下,两稿按样板保留不同的取线用途。 |
|
||||
| 077 | 两盏小灯 | D3 | 同一块底布配两种灯色,公共轮廓只需一笔。短途完成一稿,展柜可直接看另一稿预览。 | 《米白小灯》/《淡粉小灯》。共用一笔灯架。米白稿完成一枚月牙灯腹,淡粉稿完成花边灯腹。同样保留短关节奏。 |
|
||||
| 078 | 花开哪一面 | D5 | 公共花茎先织,金稿需要先开一把锁,粉稿需要先穿一枚扣。玩家比较取线顺序和蚁巢分配。 | 《金扇小花》/《粉纱侧花》。共用细花茎。金稿开锁后形成向上展开的扇面,粉稿穿扣后形成偏向一侧的轻纱花。 |
|
||||
| 079 | 远山留白 | D5 | 一侧图稿多一针但路线更短,另一侧用一笔串球换来长绕路。用明确的绣面轮廓展示两者的不同。 | 《远山两峰》/《一脉长坡》。共用低水纹。甲稿在两处独立落针织两峰,乙稿用成对针区串绣成连续长坡。 |
|
||||
| 080 | 双面窗景 | D6 | 章末。两片旧料、共享水纹、两个图稿各有一条机关链。两稿在取线选择、出发巢和成品上都能区分。 | 《晨窗》/《雨窗》。共用雾蓝水纹与窗框。晨窗用扇形金光和向外伸展的花叶,雨窗用斜蓝雨线和灰紫纱帘。按两套机关与路径分别出图。 |
|
||||
|
||||
### 第 9 章 · 新针开旧夹 · 081–090
|
||||
|
||||
**规划** 旧行囊中有多片被布夹扣住的布料,改织成一组可收藏的旅行挂件。落针区和旧夹通过同一纹样编号识别。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 081 | 第一只线夹 | D3 | 一枚绿针完成后打开旧片夹子,露出粉线。用一根同纹样的连线展示落针怎样解开旧料。 | 《叶形开夹牌》。先织绿牌,松开旧料后织粉花。同一枚叶纹同时出现在针位和夹旁。 |
|
||||
| 082 | 挂环与布角 | D4 | 两根可取线中,一根送达即可夹开第二片,另一根能先织装饰。让玩家决定第一格要留给哪段旧料。 | 《雾蓝行李挂环》。一枚可开夹的挂环及一枚独立布角装饰,画面上分开摆放,便于玩家比较先取哪团。 |
|
||||
| 083 | 先开哪颗扣 | D5 | 两枚可先织的针位分别打开两片旧布,开启后出现不同颜色。第一枚针要根据后续需求来选。 | 《雨和日两枚扣》。两个可先绣的挂扣各开一片旧布,天晴扣做圆形,雨天扣做滴形。 |
|
||||
| 084 | 留住一团金 | D5 | 新针能开带蓝线的夹,蓝针再解锁另一侧金区。早抽的金线会占一格,需要在合适时机消耗。 | 《金色标签与车窗》。蓝色车窗先打开侧边金色标签区域。标签是后一块大形,提示金球何时能用。 |
|
||||
| 085 | 线夹后的白 | D5 | 一根白线只在绿针后可取。该线可染成两种颜色之一,选择补哪侧会改变剩余取线顺序。 | 《夹后双彩带》。先织绿结开夹,得到一股白线可染成两种色。两侧彩带的方向和目标色都可预览。 |
|
||||
| 086 | 先搭桥再开夹 | D6 | 绿针搭桥,跨桥织粉针打开旧夹。另一只蚂蚁也可先织边缘针取得第二批线,但会占据一个近路。 | 《越过小桥的挂饰》。绿叶桥与对岸粉花挂件分居两侧。另一路可先送边缘带扣,安排好占路影响。 |
|
||||
| 087 | 旅行章 | D4 | 单夹、三个短针位。用一个已学的「织一针 → 打开旧线」做成旅行纪念章。 | 三个短针区组成山、水、票角。单一开夹前置挂在已学过的叶纹上。 |
|
||||
| 088 | 小袋里的两层 | D5 | 一个夹解开后还要抽掉上层线才能拿到关键颜色。要求在开夹前先腾出一格。 | 《两层小布袋》。旧夹打开后有两层料,完成新袋正面和一枚下层的珠白口袋扣,预判位留在布口。 |
|
||||
| 089 | 行囊重开 | D6 | 两个旧夹分别由中部和边缘针控制,至少一个开夹针的供线藏在另一片里。根据一小段可见色带决定先织哪侧。 | 《重开的旅行袋》。中央挂牌和边缘耳片分别控制旧夹。两种线夹纹样在新旧区域中能对上。 |
|
||||
| 090 | 行囊寄来的画 | D6 | 章末。三片旧料中的一片后来打开,两个槽格和一座桥形成连续选择。完整读出每个夹与针位的对应关系即可规划全局。 | 《寄回来的行囊》。左侧桥、中央车窗和右侧票袋作为三个读图区域。晚开的旧料补上最后一枚透纱小挂坠。 |
|
||||
|
||||
### 第 10 章 · 百针长卷 · 091–100
|
||||
|
||||
**规划** 从花册、拼布家书和旅行袋收回余线,合为一件共同的礼物。三种工艺各有一段画面。
|
||||
|
||||
| 关次 | 关名 | 难度 | 盘面与主要判断 | 成品与落针区 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 091 | 合卷之前 | D4 | 两片旧料和一座单向针门。以近针和空托盘起步,复习先用后抽、先看穿门方向。 | 《卷头小花结》。一枚棉线花结和一段布贴卷边,顺向穿门放在卷边走向上复习。 |
|
||||
| 092 | 同色两程 | D4 | 两颗同色球来自不同片,两个巢分别更接近两处针位。两笔走短路或一笔合送都可完成。 | 《并行的两枝金芽》。一处是细棉线金芽,另一处是奶油布贴金芽。相同目标色,源头和出发巢不同。 |
|
||||
| 093 | 长卷对河 | D5 | 两侧各有一枚前置针。一侧开桥、另一侧露出关键线,玩家决定先开哪种后续资源。 | 一侧绿叶开桥,另一侧的靠岸花开旧料,中间留河面让取线和开桥关系都能看到。 |
|
||||
| 094 | 晚一步的缸 | D5 | 白线可早拿,但染色的近路要等桥打开。选择先用原色推进,或用远巢绕到染缸。 | 《染缸旁的晚蓝窗》。金窗框先做,蓝色半透窗芯需要染色。可比较等桥开或从远巢绕缸。 |
|
||||
| 095 | 三巢共一扣 | D6 | 三座巢都有合法起手,只有一条穿扣走廊短。要在拆线前决定哪一种颜色由哪座巢出发。 | 《三鸟共一枝》。三个起手方向对应三只不同姿态的鸟,中央只有一枚短路径必经扣。羽翼造型区分走廊。 |
|
||||
| 096 | 接续两张旧片 | D6 | 一枚针同时影响新绣面的锁和一块旧夹。另一个开局先织边针,可以省线但需要更精确的取料顺序。 | 《旧片在窗边相接》。一处中央窗花同时开新绣面的锁和旧料线夹。另一处早绣的窗角作为近路策略。 |
|
||||
| 097 | 晚霞压边 | D4 | 只取三团料、织出一段短边框,保留一处熟悉的开锁关系。作为终局前的缓冲。 | 三片短绣区组成晚霞边线,一段亚麻棉针和两段浅透纱,完成后可单独收藏为卷角。 |
|
||||
| 098 | 两色过两桥 | D5 | 两处桥针开放时机不同,目标颜色来自错开的旧层。比较先开桥和先腾槽两种方案。 | 《双桥春晚》。两座桥上各有一处上色不同的桥叶和提示,沿水面从植物针脚过渡到轻纱。 |
|
||||
| 099 | 长卷最后一扣 | D6 | 两片旧料、两个蚁巢、一枚必经扣。先前置取线再定谁穿扣,要求为最后一笔预留通道。 | 《长卷最后一枚花扣》。两段图案从左右接近,以一枚必经花扣相连。留一条开阔走廊给末笔。 |
|
||||
| 100 | 拆百线,织一卷 | D7 | 终局。三片旧料、九团线、两座桥、一口限次染缸和一处旧夹。两条蓝线供给路线可互换,一种先染白、另一种先用原色,最后合成纪念长卷。 | 《百针长卷》。固定九区为绿叶、粉灯、蓝溪、金廊、蓝星、绿湾、粉翼、金窗和蓝月。西桥、东桥分别由绿叶、绿湾触发,蓝星与蓝月分别允许原蓝或染蓝。 |
|
||||
|
||||
## 五、样板关与制作验收
|
||||
|
||||
### 024 · 晨露叶桥 · 给下一层留一格
|
||||
|
||||
- 两格碗。左侧金甲压绿线,右侧金乙单独露头。两枚金针都要等绿叶搭桥才开放。
|
||||
- 参考走法为取金甲 → 取绿 → 织绿叶搭桥 → 取金乙 → 送双金。可分送或串双球。
|
||||
- 若先取两根金线,两格全满且金针仍锁。撤回最后一次取线,腾出一格抽绿。已在浏览器预览验证满碗、撤销和通关。
|
||||
|
||||
### 030 · 荷塘夜灯 · 两座桥先开哪一座
|
||||
|
||||
- 两格碗。三组旧线为金甲压绿、粉压蓝、浅杏压金乙。绿叶与蓝纹分别打开两座桥。
|
||||
- 先拆左金时可接着抽绿开一座桥,先拆右粉时可接着抽蓝开另一座桥。先织开的桥和手里暂存的线不同。
|
||||
- 蓝纹开放第一处金灯,绿叶开放粉花与浅杏花,浅杏花再开放最后一处金灯。该关有两种通过审计的起手,浏览器预览已走出三星。
|
||||
|
||||
以下 039、055、076、100 是后续灰盒样板。039 具有原型折线路径,其他样板具有离散状态参考解。正式地图、触控和成品质感随制作验证。
|
||||
|
||||
### 039 · 三巢让路 · 两笔和省线的取舍
|
||||
|
||||
- **供线** 两格。金左、金右、绿三团均露头。绣面三巢、两枚金针、一枚绿针,不交叉,最多三笔。
|
||||
- **灰盒坐标** 沿用现有 600 × 616 绣面坐标。左、中、右巢分别为 (130,468)、(300,505)、(470,468)。金左、绿、金右球在 (152,384)、(300,462)、(448,384)。左金、绿、右金针在 (142,251)、(300,185)、(454,251),各针位半径 26。测试用线预算为 16.8 游戏内厘米。
|
||||
- **三笔参考解** 左右两巢分别送金球,绿线中巢直达。约 7.6 游戏内厘米。
|
||||
- **两笔参考解** 两格都收金球,左巢串双金。参考路径为左巢 → 左金球 → 右金球 → 右金针 → 左金针。再取绿球,中巢绕左侧外圈到绿针,途经 (176,480)、(133,488)、(107,472)、(88,416)、(84,299)、(105,217)、(171,182)。约 15.4 游戏内厘米。
|
||||
- **验证用途** 原型的两套折线路径已通过引擎几何检查。横向金线和直行绿线互相挡路,互换原路径顺序一样无法通行。正式制作时试做更接近的耗线差,用独立的「少笔」徽记确认玩家是否愿意规划第二种走法。 [不交叉判定](../assets/scripts/core/RouteEngine.ts)
|
||||
|
||||
### 055 · 一封蓝信 · 两种蓝线的用途
|
||||
|
||||
- **供线** 两格。旧布甲有两列(粉 → 绿)和(白)。旧布乙一列(金 → 蓝)。蓝缸只能染白线一次。
|
||||
- **绣面** 绿叶可先绣。完成后开放粉瓣和蓝水纹。水纹开放金岸,金岸开放蓝云纹。
|
||||
- **开局** 先取粉和绿,织绿叶,再用粉织花瓣放空托盘。
|
||||
- **用原色绣水纹** 拆金露蓝,用蓝线完成水纹,再用金线完成金岸。最后把白线染蓝绣云纹。
|
||||
- **用染色绣水纹** 把白线染蓝完成水纹,再取金线织金岸。取旧布乙露出的原色蓝线织云纹。
|
||||
- **灰盒要求** 把一枚蓝针布置在靠近染缸的位置,另一枚靠近原色供线点。选择哪种蓝线先织水纹,会改变后续织云纹的路线。用两个完整方案验盘。
|
||||
|
||||
### 076 · 晴川与暮川 · 拆同一块料,织出两幅画
|
||||
|
||||
- **供线** 两格。旧布甲(绿 → 粉),旧布乙(金 → 蓝)。
|
||||
- **公共针位** 绿叶 → 蓝色水纹。晴稿专属金桥在水纹后开放。暮稿专属粉花在绿叶后开放。
|
||||
- **晴稿参考解** 织绿叶后先取金、再取蓝。蓝线织水纹,暂存的金球织桥,完成晴稿。
|
||||
- **暮稿参考解** 织绿叶后取粉,完成暮稿的第一枚专属针。再抽金取蓝,织水纹即可。金球留在托盘,仍可收工。
|
||||
- **灰盒要求** 两稿轮廓进关即能预览,第一枚专属针定稿,撤回该笔能回到未选状态。真机验收时,两稿都需能完整通关并各自入柜。调整绣面时让金桥与粉花占用不同位置,玩家的路线和终局画面都能辨认出分支。
|
||||
|
||||
### 100 · 拆百线,织一卷 · 三片旧料,两种最终解
|
||||
|
||||
- **供线** 两格,共九团。旧料甲(粉甲 → 绿甲 → 蓝甲),旧料乙(金甲 → 白 → 金乙),旧料丙(蓝乙 → 绿乙 → 粉乙)。旧料丙的夹子由第一枚绿叶打开。限次蓝缸可将白球染成蓝色一次。
|
||||
- **绣面阶段一** 绿叶先绣,完成后开西桥、松开旧料丙,并开放粉灯和蓝溪。蓝溪完成开放金廊。
|
||||
- **绣面阶段二** 金廊 → 蓝星 → 绿湾 → 粉翼 → 金窗 → 蓝月。绿湾完成开东桥。蓝星和蓝月都可以分配到染出的蓝或旧料丙的原色蓝。
|
||||
- **共同开局** 取粉甲,再取绿甲织绿叶,用掉暂存粉甲织粉灯。取蓝甲织蓝溪,取金甲织金廊。
|
||||
- **先染白** 取白线染蓝,织蓝星。取蓝乙暂存,取绿乙织绿湾。取粉乙织粉翼,取金乙织金窗,最后把暂存的原色蓝线送入蓝月。
|
||||
- **先用原色** 取蓝乙织蓝星,接着取绿乙织绿湾、取粉乙织粉翼。白线和金乙同时临存,先用金乙织金窗,再把白线染蓝织蓝月。
|
||||
- **终局节奏** 三片旧料齐备时不立即堆满绣面。用西桥、东桥和最后一段画卷作为三个容易辨认的阶段,分别给出成画反馈。两种蓝线顺序都要经过几何验关,再确定最终耗线与耗时。
|
||||
|
||||
### 逐关交付与验收
|
||||
|
||||
| 项目 | 交付内容 |
|
||||
| --- | --- |
|
||||
| 旧料与供线 | 标明线色、压层、开夹前置、对应线碗或供线点。 |
|
||||
| 绣面与机关 | 标明必做针位、专属针位、锁、桥、针门、染缸次数与可走空间。 |
|
||||
| 通关路径 | 记录开局、抽取顺序、可用线碗、蚁巢与落针路径。D4 以上检查合理起手以及它们对后续状态的影响。双画关各验一套完整解。 |
|
||||
| 撤销 | 验证恢复旧线遮挡、已占用槽位、线球、针位与机关。分支和染色关核对是否恢复成画分支、染色次数与旧夹。 |
|
||||
| 手机试玩 | 看 001 的首轮抽线是否容易发现,024 卡住时能否理解腾格,039 是否看得懂让路,055 能否区分两种蓝线来源,076 的两稿是否可分别完成,100 的阶段目标是否足够清楚。 |
|
||||
| 难度回测 | 记录相邻关的首通时间、撤销次数、路线失败和耗线,优先区分规划难度与手指遮挡。第 7 关应有清楚的节奏回落。 |
|
||||
|
||||
**制作顺序** 001–030 为当前首审内容。下一批先以 039、055 验证多巢与染色,再铺 031–070。同步用 076 与 100 验证双稿、旧夹与终局依赖,再展开 071–100。
|
||||
|
||||
## 六、二轮评审与灰盒方案
|
||||
|
||||
### 6.1 现有难度主要来自容量和锁
|
||||
|
||||
现有 30 关全部存在单球单笔的三星参考解。脚本会尝试绕水的折线,所以部分关已经有路径选择,但验关尚未覆盖串双球、多巢和不交叉。固定的第一个空碗分配规则也很少让玩家通过取料选择出发位置。020、026 等关的基础压力来自能否保住一个空碗。[关卡配置](../assets/scripts/core/ReleaseLevels.ts) · [现有验关脚本](../tools/audit-release.mjs)
|
||||
|
||||
| 关卡 | 当前双碗下两次连续抽线后无解 | 只增加到三碗后两次连续抽线后无解 | 参考线长 / 三星阈值 |
|
||||
| --- | --- | --- | --- |
|
||||
| 020 风铃穿针盒 | 6 / 8 | 0 / 8 | 20.23 / 23.10 cm |
|
||||
| 024 晨露叶桥 | 2 / 3 | 0 / 3 | 11.05 / 11.80 cm |
|
||||
| 026 水田双桥 | 6 / 8 | 0 / 8 | 19.83 / 23.10 cm |
|
||||
| 030 荷塘夜灯 | 7 / 9 | 1 / 9 | 26.70 / 27.72 cm |
|
||||
|
||||
按**有顺序且合法**的头两次抽线枚举,判断继续抽取和同色落针能否完成。模型只考虑供线、容量和针位依赖。线长来自当前验关脚本的候选走法。真实玩家选择概率、手指误差和改图后的几何可达性留待试玩。010 到 011 在标定上由 D3 回到 D1,章均值的上涨不能代表进章那一关的体感。需要实测的是玩家何时察觉碗位变少,以及 016 以后撤销次数是否偏高。
|
||||
|
||||
### 6.2 三格基础碗配合交叉压层
|
||||
|
||||
用 026 做三组对照,分别跑当前双碗、原盘面三碗、三碗加交叉压层。三碗通过验收后,作为下一版主线的统一基础容量。像 024 这样以双碗为核心的题,需要补压层或针位依赖后再迁移。
|
||||
|
||||
- **026 的交叉压层样板。** 保留左粉压绿、右金压蓝。浅杏旧线由左粉和右金共同压住。抽走粉、金后,第三格可取绿或蓝,分别先开一座桥。若提前抽浅杏,三团暂时都没有可达的同色针,需要撤回这一次。离散验算中,4 种合法的前两次抽线组合都有后续解,8 种合法的连续三抽组合有 2 种卡住。下一步检查交叉处能否看清两根上层线,以及左右起手的完整拖线路径。
|
||||
- **碗位与路线。** 从 031 起试左、右线源优先落到同侧空碗,同侧占用时按固定顺序落到共用空碗。点取前高亮将落入的位置,让玩家能预判路线,同时保留同一线源连续出两团的能力。
|
||||
- **卡住时的反馈。** 当前满碗卡住时已有变色和撤销提示。下一版让碗边轻脉冲,并突出撤销按钮。确认撤回一步能恢复下一步操作时,再提示「撤一步可继续」。
|
||||
- **加碗与评分。** 激励视频继续留待后续。若三碗定型,再测试 3→4。基础容量的完整解和三星阈值独立验收。加碗记录可用于「无辅助」徽记,主线进度照常。
|
||||
|
||||
### 6.3 调整机制出场和章节节奏
|
||||
|
||||
以现有的三组工艺、章名和代表作组织内容。下面是下一版机制安排,具体档位根据灰盒和试玩重标。
|
||||
|
||||
| 章节 | 下一版样板与改动 |
|
||||
| --- | --- |
|
||||
| 1 初拆旧围巾 | 001–003 学单线、压层、串双球。004 加异色压层,005 单练浅水洼,006 加一把位置清楚的花锁。 |
|
||||
| 2 两格针线盒 | 016 教双重开锁,020 以花锁链、腾格和同色顺序收尾。桥从 020 移到第三章。若确认统一三碗,同步调整章名和委托文案。 |
|
||||
| 3 叶桥与花锁 | 021 直接练两缕线搭一桥,022 加压层,023 做桥与锁联动。026 做交叉压层,030 回收双桥与花锁。 |
|
||||
| 4 蚂蚁分线 | 031 单练双巢,033 用宽通道教给下一笔让路,039 比较两套不交叉路线。036 的单向针门移到第七章。 |
|
||||
| 5 染坊余线 | 单白线染色 → 限次同染 → 半途换色。章末再叠加搭桥与多层取线。 |
|
||||
| 6 拼布来信 | 051 织好左侧布角,打开右片旧夹,立刻看到新画能改变旧料。055 比较原蓝和染蓝的路线,060 让夹与两侧料共同决定收尾。 |
|
||||
| 7 留一条路 | 集中训练单向针门、必经扣和异色实体球。每种先单独出现,再用已学的不交叉组合。 |
|
||||
| 8 一布两绣 | 开局明牌翻页选稿,首次专属落针前可切换。任一稿通关推进主线,另一稿保留为复玩内容,两稿齐全可得双生画框。多出的线用收线动画取回。 |
|
||||
| 9 新针开旧夹 | 从第六章单夹升级为双夹互锁和交叉压层。最多同时展开两片旧料,第三片以夹住的折叠态等待展开。090 先验分段回退。 |
|
||||
| 10 百针长卷 | 100 以西桥和东桥作为分段回退节点。完成阶段时记录线层、线碗、针位和机关状态,后续失败可退回最近的完成节点。 |
|
||||
|
||||
中后期第 7 关保留喘息用途。先试一关 4 缕露头线、宽通道、可连续串双球的短作品,观察放松感和完成时长,再决定哪些章节适合采用。同章其他短作品仍可用两三缕线。
|
||||
|
||||
### 6.4 让三星可重复,并把走线纳入验收
|
||||
|
||||
- **前中期少量关奖励串双球。** 先找分送与串送两套手指可复现的完成路径。在串送确实省线的样板上,才让它成为拿三星的优势。039 的原型中,三笔约 7.6 cm,两笔约 15.4 cm。两笔的价值在少调度和给另一条线留路,可单独试「少笔」收集目标。
|
||||
- **后期按可复现的路线标定。** 用实用路线和数次触屏试走确定手指余量。030 的参考解距三星上限约 1.02 cm,先用它测六笔累积误差。后期长关优先保证合理路线能拿三星,省线纪录留给复玩。029 和 030 分别记录首次落针用时、强制撤销和触控失败,把规则读错与拖线失手分开看。
|
||||
- **先补审计再铺不交叉。** 候选需能串双球、从不同巢出发、保留同一目标的不同通道。加入不交叉后,同样的已完成针位与碗内状态可能留下不同的可走空间,审计还要保存已铺线路或通道占用。039 要验两笔、三笔两条完整路线,以及同一碗和巢口重复经过的判定。
|
||||
- **样板推进顺序。** 先做 026 的容量与压层对照,再做 033/039 的让路,接着用 051 验证新针开旧夹。三组通过后,把早期教学和相邻章末按表重排,再调整 071–100 的双稿与阶段机制。
|
||||
@@ -0,0 +1,222 @@
|
||||
# 《蚂蚁织画》拆旧织新 · 章节与 100 关图案设定
|
||||
|
||||
**首审范围** 已实装 001–030。关名、针位和难度以[研发文档](蚂蚁织画-游戏设计与研发文档.md)及 [ReleaseLevels.ts](../assets/scripts/core/ReleaseLevels.ts) 为准。下文保留逐关美术设定,031–100 用于后续开发。
|
||||
|
||||
**日期** 2026 年 11 月 25 日
|
||||
**规模** 10 章,每章 10 关。共 100 关、110 种可完成图稿,第 8 章每关两稿。
|
||||
**用途** 为关卡、美术和展柜编排提供同一套题材与落针区设计。逐关编号对应原难度曲线,实际坐标在灰盒阶段确定。 [100 关设定与难度曲线](/Users/1993.x/.codex/visualizations/2026/11/24/01a20d8a-7a5e-7320-8a90-d1b3a7b16b9e/蚂蚁织画-拆旧织新-100关关卡设定与难度曲线.md)
|
||||
|
||||
## 一、三组工艺和第十章的用法
|
||||
|
||||
| 章节 | 定下的工艺 | 画面做法 | 章内变化 |
|
||||
|---|---|---|---|
|
||||
| 1–3 | **暖亚麻植物绣** | 象牙亚麻、哑光棉线、长短针与叶脉针。细线形成图案主体。 | 从一根线的小花到风铃、舟和荷塘。姜黄、豆沙粉、灰绿作为主要颜色。 |
|
||||
| 4–6 | **奶油布贴绣** | 奶油黄、浅杏桃、雾蓝的薄棉、细灯芯绒与斜纹布。每片剪裁布有自己的边缘和细缝边。 | 小鸟使用布片轮廓,花窗使用几何切片,家书使用信封、邮票与圆印形状。 |
|
||||
| 7–9 | **月色轻纱绣** | 雾蓝或浅灰紫底,半透欧根纱、小米珠、珠白描边。两层薄纱重叠处显示深浅。 | 风筝长尾、晨昏双稿、旅行挂饰分别采用舒展、左右分景和小件组合。 |
|
||||
| 10 | **百针长卷** | 在暖亚麻底上用少量布贴和薄纱层,把前三组工艺织进同一卷。 | 前三段分别回收植物、窗景、夜色纹样,最后组成完整新画。 |
|
||||
|
||||
[三组材质定稿参考与原图](/Users/1993.x/development/mayi_codex/docs/art-review/chapter-styles/revised-materials/后两组材质修订.md)
|
||||
|
||||
**关卡图案与针位。** 下表的「落针区」列出玩家织出的部分。底稿可以预先有浅绣轮廓、现成的花心、枝干和物件骨架。一枚针可完成一个完整片区。薄纱作品在对局中给针位加清楚的描边,通关展示再恢复真实透光感。夹子、锁扣、针门使用统一的机制图标。
|
||||
|
||||
**颜色标记。** 金、绿、粉、蓝、紫、米、棕、珊瑚分别指游戏已有的目标色。浅杏、姜黄和灰绿等属于美术表现,可在同色范围内变化。白线仍按关卡规则染成目标色。已有详细样板的指定色与区域按其设定执行。
|
||||
|
||||
**收藏与制作。** 每张成品有独立剪影,普通关优先复用针迹和布料。第 7 关做短构图,单看成品也完整。第 10、20……100 关各有章末代表作,其中第 80 关两稿分别输出,100 关规划合计 11 张高精章末收藏稿。第 8 章的两稿共享公共区域,专属剪影、画面重心或留白方向随图稿变化。
|
||||
|
||||
## 二、逐章与逐关图案
|
||||
|
||||
### 第 1 章 · 初拆旧围巾 · 001–010
|
||||
|
||||
**旧物与委托** 把阿婆的围巾边角拆出金黄、灰绿和豆沙粉,织成能放在窗边的花册。
|
||||
**章末藏品** 《窗边向日葵》。从第一关的小花心长成一朵完整向日葵,底部有一段与旧围巾相同的针迹。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 001 | 一粒金绒 | 金色绒花心为唯一针位。现成浅轮廓围住花心,亮起时成为一枚向日葵小章。 |
|
||||
| 002 | 花边采样 | 左侧粉色波浪花边,右侧金色缀线。像同一围巾的角标。 |
|
||||
| 003 | 双瓣金盏 | 金色左右大瓣,公用小花心。左右轮廓宽,适合看串双球。 |
|
||||
| 004 | 一瓣一叶 | 左金瓣、右绿叶,二者朝向相反。轮廓清楚,分别使用花瓣纹和叶纹。 |
|
||||
| 005 | 叶中的小金芽 | 绿叶在下,金色芽在上。两块之间留窄白,能看清下一团线的用途。 |
|
||||
| 006 | 并肩雏菊 | 左右两朵小花各有独立可绣的花瓣或叶区,构图分开放在对局两侧。 |
|
||||
| 007 | 午后茶花 | 浅粉、深粉同属粉色目标,两块宽花瓣展开,预绣枝梗形成一枝侧开的茶花。 |
|
||||
| 008 | 水边金芽 | 金色芽和绿叶沿水岸上下分开。水纹为盘面留白,完成后形成岸边小景。 |
|
||||
| 009 | 双向日葵别针 | 两枚金色小花盘与一片绿叶组成新图。双金区并列,叶区靠近中间。 |
|
||||
| 010 | 窗边向日葵 | 两组金瓣、一片绿叶、一片粉绣的围巾边。绿叶完成后再补被锁金瓣,最终显出整朵花。 |
|
||||
|
||||
### 第 2 章 · 两格针线盒 · 011–020
|
||||
|
||||
**旧物与委托** 将旧针线袋的花边拆成一串风铃。小作品偏生活物件,延续植物绣的细棉线。
|
||||
**章末藏品** 《针线盒风铃》。两枚铃片、叶形铃结和小挂环是本章收束。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 011 | 两枚风铃坠 | 两枚不同色的宽坠片分置两边,丝结预绣,让玩家看到两次落针各腾一格。 |
|
||||
| 012 | 三色挂结 | 三枚独立的铃舌,沿高低错落排开。三处都能先绣。 |
|
||||
| 013 | 夹着小花的书签 | 绿叶在下、粉花中段、金边在上,图案自下而上现形。 |
|
||||
| 014 | 双金铃片 | 两枚金铃左右展开,绿挂结居中。为双金串球做出清楚的对称目标。 |
|
||||
| 015 | 枝下星坠 | 绿枝做第一针,金星和粉坠放在枝下两侧,绿线解锁的关系易读。 |
|
||||
| 016 | 三节铃绳 | 绿结、粉色挂绳、金铃身顺着垂直方向依次展开。 |
|
||||
| 017 | 两瓣余香 | 两片不同明度的粉瓣组成小香包挂件。口袋轮廓和短穗为底稿。 |
|
||||
| 018 | 两边铃声 | 两枚绿结分处两端,各对应一枚粉铃或金铃。各侧的依赖关系在图案上成对出现。 |
|
||||
| 019 | 小花线轴 | 双金花瓣、花蕊和叶结按关卡线色取区,圆角线轴骨架预绣,画面中能看出双金组合。 |
|
||||
| 020 | 针线盒风铃 | 两枚铃片、绿结与挂环构成整幅。金铃旁的铜扣以机制图标显示,成品中作为极小装饰。 |
|
||||
|
||||
### 第 3 章 · 叶桥与花锁 · 021–030
|
||||
|
||||
**旧物与委托** 旧荷包拆成一组池边小景。叶、桥和花苞同时是可识别的机关形状。
|
||||
**章末藏品** 《荷塘夜灯》。暖亚麻上绣金灯与荷花,留两处青绿的水路。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 021 | 露珠与小荷 | 绿叶先显影,开放上方粉花苞,背景的露珠保持小而轻。 |
|
||||
| 022 | 金蕊睡莲 | 下方绿叶先绣,上方金蕊随后开放。花冠轮廓为浅预绣。 |
|
||||
| 023 | 荷叶渡 | 绿荷叶下接桥面,金色小篷船隔水停在另一侧。桥开时绿叶和水路变化同时可见。 |
|
||||
| 024 | 晨露叶桥 | 左右两组金花落针区以水路分开,中间绿叶完成后开桥并解锁双金。 |
|
||||
| 025 | 双叶金盏 | 左绿叶对应左金花、右绿叶对应右金花,两组配对轮廓保持清楚。 |
|
||||
| 026 | 水田双桥 | 两段桥叶与相应的岸花分属不同区域,其中一根桥叶线在旧料里被粉线压住,绣面上用两组不同的叶形标出两条路径。 |
|
||||
| 027 | 扁舟靠岸 | 一枚舟身、一段近岸水纹,两团线能完成,小范围留白。 |
|
||||
| 028 | 荷茎上的两瓣 | 两个同色花瓣区共享预绣荷茎,分别留出一早一晚可进入的模板空间。 |
|
||||
| 029 | 并蒂荷与叶桥 | 一枚花托负责解锁花瓣,另一枚绿叶负责搭桥。通关显出高低两株荷花。 |
|
||||
| 030 | 荷塘夜灯 | 暖亚麻上有两组桥叶、两侧荷花和小金灯。桥和前置花叶是玩法区,水纹与灯影统一在通关后显出。 |
|
||||
|
||||
### 第 4 章 · 蚂蚁分线 · 031–040
|
||||
|
||||
**旧物与委托** 一张浅色旧窗帘,改成能别在窗边的布贴鸟。布片对应鸟翼和枝叶,便于理解双巢分工。
|
||||
**章末藏品** 《穿窗百鸟》。两组错落的鸟翼围着一扇留白窗,章末形成整扇窗景。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 031 | 窗边一双燕 | 两处独立小燕布片,左右各一枚宽针,便于分别从最近的巢开局。 |
|
||||
| 032 | 隔水金翅 | 一枚金色大鸟翼在水洼对侧,两巢均可拾到金球,花窗的一角只做底稿。 |
|
||||
| 033 | 叶舟送燕 | 绿布叶承担搭桥,粉色燕翼在对岸。下方的宽布桥与上方绕行路径分区。 |
|
||||
| 034 | 共枝的粉雀 | 左右两枚杏粉鸟翼组成一对鸟,可分送也可串双球。 |
|
||||
| 035 | 归燕换枝 | 两枚同色鸟身分居上下枝,一枚布片显影后露出通向下一枚的枝路。 |
|
||||
| 036 | 向东的折翅 | 两处布翼朝同一方向。中间窗格只有一个顺向门,统一的箭头机制图标贴近窗格。 |
|
||||
| 037 | 枝头双鸟 | 两只短尾小雀各由一块大布片组成,两针即可显出完整双鸟。 |
|
||||
| 038 | 合翼留窗 | 中央留白是一扇窗,两块同色大翼可串绣,第三色小尾羽要经窗边走廊。 |
|
||||
| 039 | 三巢让路 | 左右两枚金翼、中央绿枝,共三域。沿用已验算的两金一绿位置关系。 |
|
||||
| 040 | 穿窗百鸟 | 左右各一组鸟翼,布片交会处保留一个窗洞。通关显影层补小鸟眼、窗棂与远端枝叶。 |
|
||||
|
||||
### 第 5 章 · 染坊余线 · 041–050
|
||||
|
||||
**旧物与委托** 米白旧布染出窗花,最后织成一扇可以挂在桌边的小花窗。
|
||||
**章末藏品** 《染坊花窗》。奶油黄框、杏桃花芯、雾蓝格窗,三种外围纹样让染色顺序在成品里看得见。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 041 | 蓝染窗片 | 单枚雾蓝方格布是唯一针位,窗沿浅预绣,先学白线入蓝缸。 |
|
||||
| 042 | 粉与另一格 | 固定粉色花片与待染色窗片分开。玩家从两个染缸和当前缺色选择。 |
|
||||
| 043 | 一对蓝格 | 两枚同蓝布格并排在窗框内,适合一次同染两团。 |
|
||||
| 044 | 等开的粉格 | 下方雾蓝窗格先落针,开放上方杏粉花格。 |
|
||||
| 045 | 金罗纹窗角 | 金色实布窗角和雾蓝薄布窗芯都明确。先用金的那一步让下层白线出现。 |
|
||||
| 046 | 一翼两色 | 两块相邻布翼分别承接覆染前后颜色。一笔落两针,成品沿中缝换色。 |
|
||||
| 047 | 晒在窗上的布 | 一蓝一待染窗片,两个近针位,连底稿上的晾线组成一张小晒布图。 |
|
||||
| 048 | 双层琉璃花 | 同一扇花窗里的两种布片纹理对照,两处待染目标分别有明确的色提示。 |
|
||||
| 049 | 窗影的双蓝 | 两处蓝区分别作为可开桥的近格、最终窗心水纹。原色或染出的蓝都能补位。 |
|
||||
| 050 | 染坊花窗 | 两块金黄窗框、必要的蓝窗纹与粉边。优先让金框打开可走区域,再用换色针完成粉边。 |
|
||||
|
||||
### 第 6 章 · 拼布来信 · 051–060
|
||||
|
||||
**旧物与委托** 两位家人寄来的旧布合成一封家书。左片以细灯芯绒为主,右片以薄棉和低对比细格为主。
|
||||
**章末藏品** 《把家书拼好》。两片料拼成信封,边缘以暖金缝线收尾,中央有一枚共同织成的圆印。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 051 | 两片布书签 | 左金色布条与右绿叶布贴组成书签。两片材料的厚度不同,目标区清晰分开。 |
|
||||
| 052 | 同色双邮票 | 浅灯芯绒粉和薄棉粉的两个邮票图案分别靠近两巢。同属粉针,来源与落点可交换。 |
|
||||
| 053 | 蓝色信封角 | 金色封印和蓝封角分为两个显影区。现成白底文纸衬出两种取得蓝线的办法。 |
|
||||
| 054 | 左右花封 | 两个同色花封分别连接左右开启区,保留中间一条给后针的清楚走廊。 |
|
||||
| 055 | 一封蓝信 | 绿叶先开粉瓣和蓝水纹,水纹开金岸,最后补蓝云纹,共五区。天然蓝和染蓝可互换。 |
|
||||
| 056 | 金边包角 | 信封上两枚同色金角独立落针,其中一枚接近当前可用区域,让先腾托盘格有对应图形。 |
|
||||
| 057 | 邮票花边 | 一枚树叶邮票和一枚小鸟邮票,分别填一个大形,两至三笔可完成。 |
|
||||
| 058 | 两头齐进 | 左侧叶桥和右侧信纸花边都是开局可绣区,通关时把两端接到一张小笺。 |
|
||||
| 059 | 借一抹蓝 | 两枚蓝布片形成信纸与云纹,旁边用同色纹样显示蓝色的两种来源。 |
|
||||
| 060 | 把家书拼好 | 中央是一枚共享封印,左右分别补成杏桃布角和雾蓝信纸边。章末展示两侧来源布的细纹。 |
|
||||
|
||||
### 第 7 章 · 留一条路 · 061–070
|
||||
|
||||
**旧物与委托** 拆旧风筝尾,改织一组天空小景。夜色采用雾蓝和灰紫,通行区以留白和描边示意。
|
||||
**章末藏品** 《星夜风筝》。半透双翼与长飘带横过一座桥,前后穿行在构图中有空间层次。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 061 | 初放纸鸢 | 一片纱翼与一段纱穗,分别沿左右开放走廊显影,顺便看清不交叉。 |
|
||||
| 062 | 结在风里的扣 | 两种颜色的风筝带分向两侧,都可从同一枚必经扣经过。扣点在飘带交会处。 |
|
||||
| 063 | 河口飞羽 | 一枚近岸纱羽与一枚彼岸尾羽间留双窄口,供玩家辨认先走哪条会占去另一条。 |
|
||||
| 064 | 顺风小燕 | 左右翼用不同雾色。顺向针门沿一条斜伸的绣线标明,任一符合方向的绣线都可穿过。 |
|
||||
| 065 | 桥前飘带 | 伸出远端的纱带需要一条窄路,异色实体球出现在第二条尾带区域的入口处。 |
|
||||
| 066 | 月下叶桥 | 绿针开桥,另一处纱翼可由内侧或外侧到达。把桥的两头留白,体现预留路线。 |
|
||||
| 067 | 风停时 | 两片近处的小风筝尾,绣好后组成一对细穗。短线也能看到叠纱完成的效果。 |
|
||||
| 068 | 另一条星轨 | 两处同色长星轨和一枚异色小星,交换星轨的球与目标能为小星保留入口。 |
|
||||
| 069 | 门外有颗星 | 主体由过门的纱带和门外的星片组成,门边留出清楚的备料提示区。 |
|
||||
| 070 | 星夜风筝 | 蓝翼、绿桥、粉尾和少量珠白星点组成终图。桥针、穿扣与粉尾通道各有清楚的视觉位置。 |
|
||||
|
||||
### 第 8 章 · 一布两绣 · 071–080
|
||||
|
||||
**旧物与委托** 拆一块旧桌布,交出想要的那一幅。章节陈列图稿翻页,先织哪处专属针位决定成品。
|
||||
**章末藏品** 《双面窗景》的《晨窗》和《雨窗》。同一框内分别构成朝阳和斜雨,画面重心明显不同。
|
||||
|
||||
| 关次 | 成品甲 / 成品乙 | 公共针位及分支落针 |
|
||||
|---|---|---|
|
||||
| 071 | 杏色山茶 / 粉纱铃兰 | 共用绿叶。金或杏色大瓣形成圆山茶,粉色垂瓣形成一簇小铃兰。 |
|
||||
| 072 | 放晴的伞 / 落雨的伞 | 共用伞柄或伞身轮廓。金色半圆伞面偏上,蓝色雨纹伞面向下延伸。 |
|
||||
| 073 | 晨鸟 / 夜鸟 | 共用预绣枝条。晨鸟是向左张开的浅色翼,夜鸟是向右收拢的雾紫纱翼。两巢分别靠近对应图稿。 |
|
||||
| 074 | 池上粉荷 / 桥边金影 | 共用绿叶桥。粉稿沿外侧开花,金稿在桥下织出一支向内的倒影。 |
|
||||
| 075 | 晨光花窗 / 傍晚花窗 | 共用窗轴和框线。白线染金后形成上半窗斜光,染粉后形成下半窗花帘。 |
|
||||
| 076 | 晴川金桥 / 暮川粉花 | 共用绿叶和蓝水纹。晴稿加金桥,暮稿加粉花。蓝压在金下,两稿按样板保留不同的取线用途。 |
|
||||
| 077 | 米白小灯 / 淡粉小灯 | 共用一笔灯架。米白稿完成一枚月牙灯腹,淡粉稿完成花边灯腹。同样保留短关节奏。 |
|
||||
| 078 | 金扇小花 / 粉纱侧花 | 共用细花茎。金稿开锁后形成向上展开的扇面,粉稿穿扣后形成偏向一侧的轻纱花。 |
|
||||
| 079 | 远山两峰 / 一脉长坡 | 共用低水纹。甲稿在两处独立落针织两峰,乙稿用成对针区串绣成连续长坡。 |
|
||||
| 080 | 晨窗 / 雨窗 | 共用雾蓝水纹与窗框。晨窗用扇形金光和向外伸展的花叶,雨窗用斜蓝雨线和灰紫纱帘。按两套机关与路径分别出图。 |
|
||||
|
||||
### 第 9 章 · 新针开旧夹 · 081–090
|
||||
|
||||
**旧物与委托** 旧行囊中有多片被布夹扣住的布料,改织成一组可收藏的旅行挂件。落针区和旧夹通过同一纹样编号识别。
|
||||
**章末藏品** 《寄回来的行囊》。行囊、车窗、桥和挂饰组成一幅旅行小画,旧夹用两种明确的纹样区分。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 081 | 叶形开夹牌 | 先织绿牌,松开旧料后织粉花。同一枚叶纹同时出现在针位和夹旁。 |
|
||||
| 082 | 雾蓝行李挂环 | 一枚可开夹的挂环及一枚独立布角装饰,画面上分开摆放,便于玩家比较先取哪团。 |
|
||||
| 083 | 雨和日两枚扣 | 两个可先绣的挂扣各开一片旧布,天晴扣做圆形,雨天扣做滴形。 |
|
||||
| 084 | 金色标签与车窗 | 蓝色车窗先打开侧边金色标签区域。标签是后一块大形,提示金球何时能用。 |
|
||||
| 085 | 夹后双彩带 | 先织绿结开夹,得到一股白线可染成两种色。两侧彩带的方向和目标色都可预览。 |
|
||||
| 086 | 越过小桥的挂饰 | 绿叶桥与对岸粉花挂件分居两侧。另一路可先送边缘带扣,安排好占路影响。 |
|
||||
| 087 | 旅行章 | 三个短针区组成山、水、票角。单一开夹前置挂在已学过的叶纹上。 |
|
||||
| 088 | 两层小布袋 | 旧夹打开后有两层料,完成新袋正面和一枚下层的珠白口袋扣,预判位留在布口。 |
|
||||
| 089 | 重开的旅行袋 | 中央挂牌和边缘耳片分别控制旧夹。两种线夹纹样在新旧区域中能对上。 |
|
||||
| 090 | 寄回来的行囊 | 左侧桥、中央车窗和右侧票袋作为三个读图区域。晚开的旧料补上最后一枚透纱小挂坠。 |
|
||||
|
||||
### 第 10 章 · 百针长卷 · 091–100
|
||||
|
||||
**旧物与委托** 从花册、拼布家书和旅行袋收回余线,合为一件共同的礼物。三种工艺各有一段画面。
|
||||
**章末藏品** 《百针长卷》。左段有亚麻花叶,中段有布贴窗桥,右段有轻纱月色。长卷在收藏页展开,对局保持三段清楚可读。
|
||||
|
||||
| 关次 | 成品图案 | 落针区与构图 |
|
||||
|---|---|---|
|
||||
| 091 | 卷头小花结 | 一枚棉线花结和一段布贴卷边,顺向穿门放在卷边走向上复习。 |
|
||||
| 092 | 并行的两枝金芽 | 一处是细棉线金芽,另一处是奶油布贴金芽。相同目标色,源头和出发巢不同。 |
|
||||
| 093 | 长卷对河 | 一侧绿叶开桥,另一侧的靠岸花开旧料,中间留河面让取线和开桥关系都能看到。 |
|
||||
| 094 | 染缸旁的晚蓝窗 | 金窗框先做,蓝色半透窗芯需要染色。可比较等桥开或从远巢绕缸。 |
|
||||
| 095 | 三鸟共一枝 | 三个起手方向对应三只不同姿态的鸟,中央只有一枚短路径必经扣。羽翼造型区分走廊。 |
|
||||
| 096 | 旧片在窗边相接 | 一处中央窗花同时开新绣面的锁和旧料线夹。另一处早绣的窗角作为近路策略。 |
|
||||
| 097 | 晚霞压边 | 三片短绣区组成晚霞边线,一段亚麻棉针和两段浅透纱,完成后可单独收藏为卷角。 |
|
||||
| 098 | 双桥春晚 | 两座桥上各有一处上色不同的桥叶和提示,沿水面从植物针脚过渡到轻纱。 |
|
||||
| 099 | 长卷最后一枚花扣 | 两段图案从左右接近,以一枚必经花扣相连。留一条开阔走廊给末笔。 |
|
||||
| 100 | 百针长卷 | 固定九区为绿叶、粉灯、蓝溪、金廊、蓝星、绿湾、粉翼、金窗和蓝月。西桥、东桥分别由绿叶、绿湾触发,蓝星与蓝月分别允许原蓝或染蓝。 |
|
||||
|
||||
## 三、美术交付和试制顺序
|
||||
|
||||
| 资源 | 先做什么 | 怎么复用 |
|
||||
|---|---|---|
|
||||
| 布面与针法 | 每组先做一块底布、一条可复用边、一组能看出工艺的针迹。 | 暖亚麻用细棉线,奶油组用薄棉和灯芯绒拼片,月色组用可叠两层的灰紫与珠白薄纱。 |
|
||||
| 通用片区 | 叶片、花瓣、布翼、窗框、飘带、邮票、挂扣与水纹,可以各做少量基本形。 | 每关至少改变一个主体轮廓、视线重心或布片组合。邻关能从缩略图里分出来。 |
|
||||
| 章末收藏图 | 先验证 010《窗边向日葵》、050《染坊花窗》、070《星夜风筝》。 | 三张分别作为三组的量产基准。后续优先完成各章代表作,080 给晨窗、雨窗各一幅。 |
|
||||
| 实机样板 | 001 验证单片也能成画,024 验证桥和叶不混,055 验证同色不同来源,076 验证双稿,100 验证多区域依然可读。 | 一份主图配可独立显影的区域数据。图稿和针位灰盒同时检查,小屏操作时主要路线应有足够空间。 |
|
||||
|
||||
### 原画、落针区和展柜怎么对应
|
||||
|
||||
- **原画**画出完整成品的剪影和统一材质。章末先看缩略图是否看得出对象,再补针脚细节。
|
||||
- **落针区**为每区标明对应部件和线色。布贴用布块边缘,轻纱用轮廓与叠层。借用叶、花托或灯环作为机关区时,图案位置跟关卡的先后关系一起复核。
|
||||
- **展柜**用编号和图案名管理,071–080 增加两个图稿标识,使同一关的两稿都能保存。章末代表作提供独立封面。普通关直接使用可复用片区组出来的成品。
|
||||
- **取舍标准**用三组样图做小范围试玩。请玩家挑一件最想绣的作品,以及一件最想存起来的成品。分别记录两项选择,随后调整章内题材分布和章末美术投入。
|
||||
@@ -1,8 +1,8 @@
|
||||
# 《蚂蚁织画》游戏设计与研发文档(持续更新版)
|
||||
|
||||
> **文档状态**:Living Document(随每次功能、美术、关卡与发版迭代同步维护)
|
||||
> **当前版本**:`v1.1.3`(微信小游戏备案提审收口版)
|
||||
> **最后更新**:`2026-11-24`
|
||||
> **当前版本**:`v1.2.0-dev`(已通过 Git 标签 `v1.1.3-beian` 冻结微信备案提审版,主仓合并推进「拆旧织新」玩法与验证样板)
|
||||
> **最后更新**:`2026-11-25`
|
||||
> **引擎与平台**:Cocos Creator `3.8.8`(TypeScript)|目标平台:微信小游戏 / H5 竖屏(`750×1334`)
|
||||
|
||||
---
|
||||
@@ -212,6 +212,7 @@
|
||||
|
||||
| 日期 | 版本 | 更新摘要 |
|
||||
| --- | --- | --- |
|
||||
| `2026-11-25` | `v1.2.0-dev` | **双仓合一 & 「拆旧织新」核心样板落地**:为 `v1.1.3` 原版 60 关建立首个 Git 提交并打标签 `v1.1.3-beian`(随时可一键检出提审原版);将「拆旧织新」30 关配置([ReleaseLevels.ts](file:///Users/1993.x/development/mayi_coco/assets/scripts/core/ReleaseLevels.ts))、100 关/10 章设计文档与三组材质样稿、交叉压层断口渲染与「新针开旧夹」机制、5 张验证样板([ValidationSamples.ts](file:///Users/1993.x/development/mayi_coco/assets/scripts/core/ValidationSamples.ts):`026A/026B/038A/039/051`)以及双审计脚本([audit-release.mjs](file:///Users/1993.x/development/mayi_coco/tools/audit-release.mjs)、[audit-samples.mjs](file:///Users/1993.x/development/mayi_coco/tools/audit-samples.mjs))统一整合进 `mayi_coco`,支持浏览器预览 `?sample=026b` 直达并一键切换对比。 |
|
||||
| `2026-11-25` | `v1.1.3` | **微信小游戏提审备案收口与全面屏间距精调**:移除「拆旧织新」番外原型(延后至 V1.2 正式版本),恢复委托信箱双卡舒朗排版;升级 [ScreenAdapter.ts](file:///Users/1993.x/development/mayi_coco/assets/scripts/ui/ScreenAdapter.ts) 按实际安全区高度(`safeHalfH / extraH`)动态顶底锚定,彻底消除真机全面屏顶部胶囊下方与底部手势条上方的大块空白,并将释放出的纵向空间均匀分配给大厅(绸带→章节签→10 关地图→信息签→主按钮)与对局页(顶栏→任务行→提示条→中央绣绷→底部针线盒),第 1 关信息签文案优化为「入门引导 · 完成即可满星 ★」。 |
|
||||
| `2026-11-24` | `v1.1.2` | **微信小游戏全机型界面适配 + 美术资源瘦身 65.7%**:新增 [ScreenAdapter.ts](file:///Users/1993.x/development/mayi_coco/assets/scripts/ui/ScreenAdapter.ts),竖屏手机切为 `FIXED_WIDTH` 全屏铺满(背景 Cover 缩放 + 3200×3200 全屏弹窗遮罩,彻底消除全面屏上下黑边),平板/横屏自动切 `FIXED_HEIGHT`;实时读取 `wx.getMenuButtonBoundingClientRect()` 与 `safeArea` 自动避让微信右上角胶囊、灵动岛与底部 Home 条;补齐微信相册权限拒绝后的 `wx.showModal` + `wx.openSetting` 恢复重存流程;全量 20 件美术资源压缩(PNG-8 透明索引 + Retina 适度裁齐 + 基线优化 JPG),总包体从 `2.55 MB` 降至 `0.88 MB`。 |
|
||||
| `2026-11-24` | `v1.1.1` | **产品评审 4 项必修收口**:① 修复 1 级提示跳过绕水拐点直线穿水洼 Bug(如第 19 关)并纳入 CI 第 8 项门禁;② 自动起手虚线引导收敛为仅前 3 关新手教学,第 4 关起不再剧透起手蚁巢与球;③ 按难度分级放宽教学/普通关三星手感余量(第 1 关完成即三星),章节星数门槛温和下调为 `[0, 12, 26, 44, 64, 86]` 防卡死第六章;④ 打通第 1 关「林阿婆委托 → 织画 → 入柜 → 立刻拆阅回信」首局闭环,通关页新增直达展柜/读回信入口。 |
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
#!/usr/bin/env node
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { registerHooks } from 'node:module';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
return nextResolve(/^\.\.?\//.test(specifier) && !/\.[a-z]+$/i.test(specifier) ? specifier + '.ts' : specifier, context);
|
||||
},
|
||||
load(url, context, nextLoad) {
|
||||
if (!url.endsWith('.ts')) return nextLoad(url, context);
|
||||
const source = readFileSync(fileURLToPath(url), 'utf8').replace(
|
||||
/import\s*\{[^}]*\}\s*from\s*['"]\.\/Types['"];?/g, '',
|
||||
);
|
||||
return { format: 'module-typescript', source, shortCircuit: true };
|
||||
},
|
||||
});
|
||||
|
||||
const { RELEASE_CHAPTERS, RELEASE_LEVELS, isReleaseStageOpen } = await import('../assets/scripts/core/ReleaseLevels.ts');
|
||||
const {
|
||||
availableTargets, checkSegmentBlock, createEmptyRoute, distance, interpolate,
|
||||
isTargetLocked, planStops, prepareRouteForRun, segmentCost, totalLength,
|
||||
} = await import('../assets/scripts/core/RouteEngine.ts');
|
||||
|
||||
function traceRoute(level, lines, points, ballIds, targetIds) {
|
||||
const route = createEmptyRoute(false, points[0]);
|
||||
for (let i = 1; i < points.length; i++) {
|
||||
const parts = Math.max(1, Math.ceil(distance(points[i - 1], points[i]) / 6));
|
||||
for (let j = 1; j <= parts; j++) {
|
||||
const from = route.points.at(-1);
|
||||
const to = interpolate(points[i - 1], points[i], j / parts);
|
||||
const length = distance(from, to);
|
||||
if (length < 1.5) continue;
|
||||
if (checkSegmentBlock(level, lines, route, from, to, length)) return null;
|
||||
const start = route.len;
|
||||
route.len += length;
|
||||
route.cost += segmentCost(level, from, to, length);
|
||||
route.points.push(to);
|
||||
route.cum.push(route.len);
|
||||
route.costCum.push(route.cost);
|
||||
planStops(level, lines, route, from, to, start, length);
|
||||
}
|
||||
}
|
||||
if (
|
||||
route.picks.length !== ballIds.length ||
|
||||
route.deliveries.length !== targetIds.length ||
|
||||
ballIds.some((id, idx) => route.picks[idx]?.ball.id !== id) ||
|
||||
targetIds.some((id, idx) => route.deliveries[idx]?.target.id !== id)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
prepareRouteForRun(route, 0);
|
||||
for (const stop of route.deliveries) stop.arrivedAt = 1;
|
||||
route.finished = true;
|
||||
return route;
|
||||
}
|
||||
|
||||
function findRoute(level, lines, ball, target) {
|
||||
const nest = level.nests[0];
|
||||
const prefix = [nest, ball];
|
||||
const candidates = [[...prefix, target]];
|
||||
if (level.ponds.length) {
|
||||
const near = Math.max(...level.ponds.map(pond => pond.y + pond.ry)) + 12;
|
||||
const far = Math.min(...level.ponds.map(pond => pond.y - pond.ry)) - 12;
|
||||
for (const x of [124, 155, 176, 295, 310, 425, 451, 480]) {
|
||||
candidates.push([...prefix, { x, y: near }, { x, y: far }, target]);
|
||||
}
|
||||
}
|
||||
let best = null;
|
||||
for (const points of candidates) {
|
||||
const route = traceRoute(level, lines, points, [ball.id], [target.id]);
|
||||
if (route && (!best || route.cost < best.route.cost)) {
|
||||
best = { route, points: points.map(p => [p.x, p.y]) };
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
function findChainedRoute(level, lines, ball1, ball2, target1, target2) {
|
||||
const nest = level.nests[0];
|
||||
const candidates = [[nest, ball1, ball2, target1, target2]];
|
||||
if (level.ponds.length) {
|
||||
const near = Math.max(...level.ponds.map(pond => pond.y + pond.ry)) + 12;
|
||||
const far = Math.min(...level.ponds.map(pond => pond.y - pond.ry)) - 12;
|
||||
for (const x of [124, 155, 176, 295, 310, 425, 451, 480]) {
|
||||
candidates.push([nest, ball1, ball2, { x, y: near }, { x, y: far }, target1, target2]);
|
||||
}
|
||||
}
|
||||
let best = null;
|
||||
for (const points of candidates) {
|
||||
const route = traceRoute(level, lines, points, [ball1.id, ball2.id], [target1.id, target2.id]);
|
||||
if (route && (!best || route.cost < best.route.cost)) {
|
||||
best = { route, points: points.map(p => [p.x, p.y]) };
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
function solve(blueprint, forcedFirst, allowChain = false) {
|
||||
const { strands, slots } = blueprint.unspool;
|
||||
const strandById = new Map(strands.map((strand, i) => [strand.id, { ...strand, ballId: i + 100 }]));
|
||||
const bestByState = new Map();
|
||||
let best = null;
|
||||
function visit(removed, occupancy, lines, actions) {
|
||||
const cost = totalLength(lines);
|
||||
if (best && cost >= best.cost) return;
|
||||
const pending = availableTargets(blueprint, lines);
|
||||
if (!pending.length) {
|
||||
best = { actions, cost, strokes: lines.length };
|
||||
return;
|
||||
}
|
||||
const key = JSON.stringify([Array.from(removed).sort(), occupancy, pending.map(t => t.id)]);
|
||||
if (cost >= (bestByState.get(key) ?? Infinity)) return;
|
||||
bestByState.set(key, cost);
|
||||
const balls = occupancy.map((id, slot) => {
|
||||
if (!id) return null;
|
||||
const strand = strandById.get(id);
|
||||
return { id: strand.ballId, color: strand.color, ...slots[slot] };
|
||||
});
|
||||
const level = { ...blueprint, balls: balls.filter(Boolean) };
|
||||
|
||||
if (allowChain) {
|
||||
for (let s1 = 0; s1 < balls.length; s1++) {
|
||||
const b1 = balls[s1];
|
||||
if (!b1) continue;
|
||||
for (let s2 = 0; s2 < balls.length; s2++) {
|
||||
if (s1 === s2) continue;
|
||||
const b2 = balls[s2];
|
||||
if (!b2 || b2.color !== b1.color) continue;
|
||||
const sameColorOpen = pending.filter(t => t.color === b1.color && !isTargetLocked(level, t.id, lines));
|
||||
if (sameColorOpen.length < 2) continue;
|
||||
for (let i = 0; i < sameColorOpen.length; i++) {
|
||||
for (let j = 0; j < sameColorOpen.length; j++) {
|
||||
if (i === j) continue;
|
||||
const t1 = sameColorOpen[i];
|
||||
const t2 = sameColorOpen[j];
|
||||
const traced = findChainedRoute(level, lines, b1, b2, t1, t2);
|
||||
if (!traced) continue;
|
||||
const next = [...occupancy];
|
||||
next[s1] = null;
|
||||
next[s2] = null;
|
||||
visit(
|
||||
removed,
|
||||
next,
|
||||
[...lines, traced.route],
|
||||
[...actions, { stitch: [t1.id, t2.id], points: traced.points }],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let slot = 0; slot < balls.length; slot++) {
|
||||
const ball = balls[slot];
|
||||
if (!ball) continue;
|
||||
for (const target of pending) {
|
||||
if (ball.color !== target.color || isTargetLocked(level, target.id, lines)) continue;
|
||||
const traced = findRoute(level, lines, ball, target);
|
||||
if (!traced) continue;
|
||||
const next = [...occupancy];
|
||||
next[slot] = null;
|
||||
visit(removed, next, [...lines, traced.route], [...actions, { stitch: target.id, points: traced.points }]);
|
||||
}
|
||||
}
|
||||
|
||||
const free = occupancy.indexOf(null);
|
||||
if (free === -1) return;
|
||||
for (const strand of strands) {
|
||||
if (removed.has(strand.id) || strand.coveredBy.some(id => !removed.has(id))) continue;
|
||||
if (forcedFirst && actions.length === 0 && strand.id !== forcedFirst) continue;
|
||||
const next = [...occupancy];
|
||||
next[free] = strand.id;
|
||||
visit(new Set([...removed, strand.id]), next, lines, [...actions, { pull: strand.id }]);
|
||||
}
|
||||
}
|
||||
visit(new Set(), slots.map(() => null), [], []);
|
||||
return best;
|
||||
}
|
||||
|
||||
function measureOpeningFillDeadlocks(blueprint) {
|
||||
const { strands, slots } = blueprint.unspool;
|
||||
const k = slots.length;
|
||||
const openTargetColors = new Set(
|
||||
blueprint.targets.filter(t => !isTargetLocked(blueprint, t.id, [])).map(t => t.color),
|
||||
);
|
||||
let total = 0;
|
||||
let dead = 0;
|
||||
function dfs(removed, pulledColors) {
|
||||
if (pulledColors.length === k) {
|
||||
total++;
|
||||
if (!pulledColors.some(c => openTargetColors.has(c))) dead++;
|
||||
return;
|
||||
}
|
||||
const exposed = strands.filter(s => !removed.has(s.id) && s.coveredBy.every(cid => removed.has(cid)));
|
||||
for (const s of exposed) {
|
||||
const next = new Set(removed);
|
||||
next.add(s.id);
|
||||
dfs(next, [...pulledColors, s.color]);
|
||||
}
|
||||
}
|
||||
dfs(new Set(), []);
|
||||
return { k, total, dead };
|
||||
}
|
||||
|
||||
assert.equal(RELEASE_LEVELS.length, 30);
|
||||
assert.deepEqual(RELEASE_CHAPTERS.map(chapter => chapter.count), [10, 10, 10]);
|
||||
assert.equal(isReleaseStageOpen(0, () => false), true);
|
||||
assert.equal(isReleaseStageOpen(1, () => false), false);
|
||||
assert.equal(isReleaseStageOpen(10, level => level.id === RELEASE_LEVELS[9].id), true);
|
||||
assert.equal(isReleaseStageOpen(30, () => true), false);
|
||||
|
||||
const cm = v => (v / 100).toFixed(2);
|
||||
const reportRows = [];
|
||||
const solutions = RELEASE_LEVELS.map((level, index) => {
|
||||
const { strands, slots } = level.unspool;
|
||||
assert.equal(slots.length, index < 10 ? 3 : 2);
|
||||
assert.equal(strands.length, level.targets.length);
|
||||
const visible = strands.filter(strand => strand.coveredBy.length === 0);
|
||||
const starts = visible.map(strand => ({ id: strand.id, solution: solve(level, strand.id, false) })).filter(entry => entry.solution);
|
||||
assert(starts.length, `关卡 ${index + 1} ${level.name} 无参考通路`);
|
||||
if (level.difficulty === 'D4') assert(starts.length >= 2, `关卡 ${index + 1} 缺少第二种起手`);
|
||||
const reference = starts.map(entry => entry.solution).sort((a, b) => a.cost - b.cost)[0];
|
||||
assert(reference.cost <= level.threeStar, `关卡 ${index + 1} 缺少三星参考走法`);
|
||||
const chained = solve(level, null, true);
|
||||
const margin = level.threeStar - reference.cost;
|
||||
const perStroke = margin / Math.max(1, reference.strokes);
|
||||
const chainSave = chained ? reference.cost - chained.cost : 0;
|
||||
const opening = measureOpeningFillDeadlocks(level);
|
||||
const tightFlag = perStroke < 40 ? ' ⚠过紧' : '';
|
||||
const chainText = chainSave > 5 ? ` · 串双球省 ${cm(chainSave)}cm(${chained.strokes}笔)` : '';
|
||||
const deadText = opening.dead > 0 ? ` · 满${opening.k}抽死锁 ${opening.dead}/${opening.total}` : '';
|
||||
console.error(
|
||||
`${String(index + 1).padStart(3, '0')} ${level.name} ${level.difficulty} · ${strands.length}缕/${slots.length}碗 · ${starts.length}起手 · ` +
|
||||
`1球 ${cm(reference.cost)}cm / 3★ ${cm(level.threeStar)}cm (余 +${cm(margin)}cm, +${cm(perStroke)}cm/笔${tightFlag})${chainText}${deadText}`,
|
||||
);
|
||||
reportRows.push({
|
||||
stage: index + 1,
|
||||
name: level.name,
|
||||
difficulty: level.difficulty,
|
||||
strands: strands.length,
|
||||
slots: slots.length,
|
||||
starts: starts.length,
|
||||
singleCost: reference.cost,
|
||||
singleStrokes: reference.strokes,
|
||||
chainedCost: chained?.cost ?? reference.cost,
|
||||
chainedStrokes: chained?.strokes ?? reference.strokes,
|
||||
threeStar: level.threeStar,
|
||||
margin,
|
||||
perStroke,
|
||||
openingDead: opening.dead,
|
||||
openingTotal: opening.total,
|
||||
});
|
||||
return reference;
|
||||
});
|
||||
|
||||
if (process.argv.includes('--json')) {
|
||||
console.log(JSON.stringify(solutions));
|
||||
} else if (process.argv.includes('--report-json')) {
|
||||
console.log(JSON.stringify(reportRows, null, 2));
|
||||
} else {
|
||||
const tight = reportRows.filter(r => r.perStroke < 45).sort((a, b) => a.perStroke - b.perStroke);
|
||||
const chainUseful = reportRows.filter(r => r.singleCost - r.chainedCost > 5);
|
||||
console.log('首期 30 关均通过抽线层级、线碗容量、三星路线和解锁验证。');
|
||||
console.log(`串双球可省线关卡:${chainUseful.length}/30 关(${chainUseful.map(r => String(r.stage).padStart(3, '0')).join(', ')})`);
|
||||
console.log(
|
||||
`单笔三星余量 < 0.45cm 预警(共 ${tight.length} 关):` +
|
||||
(tight.length ? tight.map(r => `${String(r.stage).padStart(3, '0')} ${r.name}(+${cm(r.margin)}cm / +${cm(r.perStroke)}cm每笔)`).join(';') : '无'),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
#!/usr/bin/env node
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { registerHooks } from 'node:module';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
registerHooks({
|
||||
resolve(specifier, context, nextResolve) {
|
||||
return nextResolve(/^\.\.?\//.test(specifier) && !/\.[a-z]+$/i.test(specifier) ? specifier + '.ts' : specifier, context);
|
||||
},
|
||||
load(url, context, nextLoad) {
|
||||
if (!url.endsWith('.ts')) return nextLoad(url, context);
|
||||
const source = readFileSync(fileURLToPath(url), 'utf8').replace(
|
||||
/import\s+(?:type\s+)?\{[^}]*\}\s*from\s*['"]\.\/Types['"];?/g,
|
||||
'',
|
||||
);
|
||||
return { format: 'module-typescript', source, shortCircuit: true };
|
||||
},
|
||||
});
|
||||
|
||||
const { VALIDATION_SAMPLES } = await import('../assets/scripts/core/ValidationSamples.ts');
|
||||
const {
|
||||
availableTargets,
|
||||
checkSegmentBlock,
|
||||
createEmptyRoute,
|
||||
distance,
|
||||
interpolate,
|
||||
isClipUnlocked,
|
||||
isStrandExposed,
|
||||
isTargetLocked,
|
||||
planStops,
|
||||
prepareRouteForRun,
|
||||
segmentCost,
|
||||
totalLength,
|
||||
} = await import('../assets/scripts/core/RouteEngine.ts');
|
||||
|
||||
function traceRoute(level, lines, points, ballIds, targetIds) {
|
||||
const route = createEmptyRoute(false, points[0]);
|
||||
for (let i = 1; i < points.length; i++) {
|
||||
const parts = Math.max(1, Math.ceil(distance(points[i - 1], points[i]) / 6));
|
||||
for (let j = 1; j <= parts; j++) {
|
||||
const from = route.points.at(-1);
|
||||
const to = interpolate(points[i - 1], points[i], j / parts);
|
||||
const length = distance(from, to);
|
||||
if (length < 1.5) continue;
|
||||
if (checkSegmentBlock(level, lines, route, from, to, length)) return null;
|
||||
const start = route.len;
|
||||
route.len += length;
|
||||
route.cost += segmentCost(level, from, to, length);
|
||||
route.points.push(to);
|
||||
route.cum.push(route.len);
|
||||
route.costCum.push(route.cost);
|
||||
planStops(level, lines, route, from, to, start, length);
|
||||
}
|
||||
}
|
||||
if (
|
||||
route.picks.length !== ballIds.length ||
|
||||
route.deliveries.length !== targetIds.length ||
|
||||
ballIds.some((id, idx) => route.picks[idx]?.ball.id !== id) ||
|
||||
targetIds.some((id, idx) => route.deliveries[idx]?.target.id !== id)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
prepareRouteForRun(route, 0);
|
||||
for (const stop of route.deliveries) stop.arrivedAt = 1;
|
||||
route.finished = true;
|
||||
return route;
|
||||
}
|
||||
|
||||
function candidateDetours(level) {
|
||||
const pts = [];
|
||||
if (level.ponds.length) {
|
||||
const near = Math.max(...level.ponds.map(p => p.y + p.ry)) + 12;
|
||||
const far = Math.min(...level.ponds.map(p => p.y - p.ry)) - 12;
|
||||
for (const x of [124, 155, 176, 295, 310, 425, 451, 480]) {
|
||||
pts.push([{ x, y: near }, { x, y: far }]);
|
||||
}
|
||||
}
|
||||
if (level.noCross) {
|
||||
// 两侧与顶部外绕走廊,用于验证不交叉让路路径
|
||||
pts.push(
|
||||
[{ x: 112, y: 458 }, { x: 84, y: 318 }, { x: 132, y: 186 }],
|
||||
[{ x: 488, y: 458 }, { x: 516, y: 318 }, { x: 468, y: 186 }],
|
||||
[{ x: 108, y: 340 }, { x: 146, y: 158 }, { x: 244, y: 118 }],
|
||||
[{ x: 492, y: 340 }, { x: 454, y: 158 }, { x: 356, y: 118 }],
|
||||
[{ x: 472, y: 298 }, { x: 422, y: 132 }, { x: 266, y: 134 }],
|
||||
[{ x: 128, y: 298 }, { x: 178, y: 132 }, { x: 334, y: 134 }],
|
||||
);
|
||||
}
|
||||
return pts;
|
||||
}
|
||||
|
||||
function findSingleRoute(level, lines, ball, target) {
|
||||
const detours = candidateDetours(level);
|
||||
let best = null;
|
||||
for (const nest of level.nests) {
|
||||
const candidates = [[nest, ball, target]];
|
||||
for (const mid of detours) {
|
||||
candidates.push([nest, ball, ...mid, target]);
|
||||
}
|
||||
for (const points of candidates) {
|
||||
const route = traceRoute(level, lines, points, [ball.id], [target.id]);
|
||||
if (route && (!best || route.cost < best.route.cost)) {
|
||||
best = { route, points: points.map(p => [p.x, p.y]) };
|
||||
}
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
function findChainRoute(level, lines, b1, b2, t1, t2) {
|
||||
const detours = candidateDetours(level);
|
||||
let best = null;
|
||||
for (const nest of level.nests) {
|
||||
const candidates = [[nest, b1, b2, t1, t2]];
|
||||
for (const mid of detours) {
|
||||
candidates.push([nest, b1, b2, ...mid, t1, t2]);
|
||||
}
|
||||
for (const points of candidates) {
|
||||
const route = traceRoute(level, lines, points, [b1.id, b2.id], [t1.id, t2.id]);
|
||||
if (route && (!best || route.cost < best.route.cost)) {
|
||||
best = { route, points: points.map(p => [p.x, p.y]) };
|
||||
}
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
function solveSample(blueprint, { allowChain = true, forcedFirst = null, maxStrokes = null } = {}) {
|
||||
const unspool = blueprint.unspool;
|
||||
const { strands, slots } = unspool;
|
||||
const capacity = unspool.capacity ?? slots.length;
|
||||
const strandById = new Map(strands.map((s, i) => [s.id, { ...s, ballId: i + 100 }]));
|
||||
const bestByState = new Map();
|
||||
let best = null;
|
||||
|
||||
function visit(removed, occupancy, lines, actions) {
|
||||
const cost = totalLength(lines);
|
||||
if (best && cost >= best.cost) return;
|
||||
if (maxStrokes !== null && lines.length > maxStrokes) return;
|
||||
if (blueprint.maxDispatches && lines.length > blueprint.maxDispatches) return;
|
||||
|
||||
const pending = availableTargets(blueprint, lines);
|
||||
if (!pending.length) {
|
||||
best = { actions, cost, strokes: lines.length };
|
||||
return;
|
||||
}
|
||||
|
||||
const key = JSON.stringify([Array.from(removed).sort(), occupancy, pending.map(t => t.id), lines.length]);
|
||||
if (cost >= (bestByState.get(key) ?? Infinity)) return;
|
||||
bestByState.set(key, cost);
|
||||
|
||||
const balls = occupancy.map((id, slot) => {
|
||||
if (!id) return null;
|
||||
const strand = strandById.get(id);
|
||||
return { id: strand.ballId, color: strand.color, ...slots[slot] };
|
||||
});
|
||||
const level = { ...blueprint, balls: balls.filter(Boolean) };
|
||||
|
||||
if (allowChain) {
|
||||
for (let s1 = 0; s1 < balls.length; s1++) {
|
||||
const b1 = balls[s1];
|
||||
if (!b1) continue;
|
||||
for (let s2 = 0; s2 < balls.length; s2++) {
|
||||
if (s1 === s2) continue;
|
||||
const b2 = balls[s2];
|
||||
if (!b2 || b2.color !== b1.color) continue;
|
||||
const openSame = pending.filter(t => t.color === b1.color && !isTargetLocked(level, t.id, lines));
|
||||
if (openSame.length < 2) continue;
|
||||
for (let i = 0; i < openSame.length; i++) {
|
||||
for (let j = 0; j < openSame.length; j++) {
|
||||
if (i === j) continue;
|
||||
const t1 = openSame[i];
|
||||
const t2 = openSame[j];
|
||||
const traced = findChainRoute(level, lines, b1, b2, t1, t2);
|
||||
if (!traced) continue;
|
||||
const next = [...occupancy];
|
||||
next[s1] = null;
|
||||
next[s2] = null;
|
||||
visit(removed, next, [...lines, traced.route], [...actions, { stitch: [t1.id, t2.id] }]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let slot = 0; slot < balls.length; slot++) {
|
||||
const ball = balls[slot];
|
||||
if (!ball) continue;
|
||||
for (const target of pending) {
|
||||
if (ball.color !== target.color || isTargetLocked(level, target.id, lines)) continue;
|
||||
const traced = findSingleRoute(level, lines, ball, target);
|
||||
if (!traced) continue;
|
||||
const next = [...occupancy];
|
||||
next[slot] = null;
|
||||
visit(removed, next, [...lines, traced.route], [...actions, { stitch: target.id }]);
|
||||
}
|
||||
}
|
||||
|
||||
const occupiedCount = occupancy.filter(Boolean).length;
|
||||
if (occupiedCount >= capacity) return;
|
||||
for (const strand of strands) {
|
||||
if (!isStrandExposed(unspool, strand, removed, lines)) continue;
|
||||
if (forcedFirst && actions.length === 0 && strand.id !== forcedFirst) continue;
|
||||
const targetSlot = strand.slotIndex !== undefined && occupancy[strand.slotIndex] === null
|
||||
? strand.slotIndex
|
||||
: occupancy.indexOf(null);
|
||||
if (targetSlot === -1) continue;
|
||||
const next = [...occupancy];
|
||||
next[targetSlot] = strand.id;
|
||||
const nextRem = new Set(removed);
|
||||
nextRem.add(strand.id);
|
||||
visit(nextRem, next, lines, [...actions, { pull: strand.id }]);
|
||||
}
|
||||
}
|
||||
|
||||
visit(new Set(), slots.map(() => null), [], []);
|
||||
return best;
|
||||
}
|
||||
|
||||
function measureOpeningFillDeadlocks(blueprint) {
|
||||
const unspool = blueprint.unspool;
|
||||
const k = unspool.capacity ?? unspool.slots.length;
|
||||
const openColors = new Set(blueprint.targets.filter(t => !isTargetLocked(blueprint, t.id, [])).map(t => t.color));
|
||||
let total = 0;
|
||||
let dead = 0;
|
||||
function dfs(removed, pulledColors) {
|
||||
if (pulledColors.length === k) {
|
||||
total++;
|
||||
if (!pulledColors.some(c => openColors.has(c))) dead++;
|
||||
return;
|
||||
}
|
||||
for (const s of unspool.strands) {
|
||||
if (!isStrandExposed(unspool, s, removed, [])) continue;
|
||||
const next = new Set(removed);
|
||||
next.add(s.id);
|
||||
dfs(next, [...pulledColors, s.color]);
|
||||
}
|
||||
}
|
||||
dfs(new Set(), []);
|
||||
return { k, total, dead };
|
||||
}
|
||||
|
||||
const cm = v => (v / 100).toFixed(2);
|
||||
|
||||
for (const entry of VALIDATION_SAMPLES) {
|
||||
const lv = entry.level;
|
||||
const unspool = lv.unspool;
|
||||
const exposed = unspool.strands.filter(s => isStrandExposed(unspool, s, new Set(), []));
|
||||
const single = solveSample(lv, { allowChain: false });
|
||||
const optimal = solveSample(lv, { allowChain: true });
|
||||
assert(optimal, `样板 ${entry.key} 无解`);
|
||||
const opening = measureOpeningFillDeadlocks(lv);
|
||||
console.log(
|
||||
`[${entry.key}] ${entry.headerTitle} · 容量 ${unspool.capacity ?? unspool.slots.length} · ` +
|
||||
`最优 ${cm(optimal.cost)}cm(${optimal.strokes}笔)` +
|
||||
(single ? ` | 单球 ${cm(single.cost)}cm(${single.strokes}笔)` : '') +
|
||||
` | 3★ ${cm(lv.threeStar)}cm` +
|
||||
(opening.total ? ` | 满${opening.k}抽死锁 ${opening.dead}/${opening.total}` : ''),
|
||||
);
|
||||
|
||||
// 针对每张样板的核心假设跑专项断言
|
||||
if (entry.key === '026b') {
|
||||
const startE = solveSample(lv, { forcedFirst: 'unspool-release-26-e' });
|
||||
const startA = solveSample(lv, { forcedFirst: 'unspool-release-26-a' });
|
||||
const startC = solveSample(lv, { forcedFirst: 'unspool-release-26-c' });
|
||||
assert(startE && startA && startC, '026B 应支持先拆中拱 e 或配中拱的左右起手');
|
||||
assert(opening.dead > 0 && opening.dead < opening.total, '026B 3 碗交叉压层应既保留死锁张力又不过度卡死');
|
||||
console.log(` ↳ 026B 交叉压层核验:先抽e=${cm(startE.cost)}cm, 先抽a=${cm(startA.cost)}cm, 先抽c=${cm(startC.cost)}cm, 满3抽死锁=${opening.dead}/${opening.total}`);
|
||||
}
|
||||
|
||||
if (entry.key === '039') {
|
||||
const threeStroke = solveSample(lv, { allowChain: false, maxStrokes: 3 });
|
||||
const twoStroke = solveSample(lv, { allowChain: true, maxStrokes: 2 });
|
||||
assert(threeStroke, '039 缺少 3 笔分送解');
|
||||
assert(twoStroke, '039 缺少 2 笔串双金外绕解');
|
||||
assert(twoStroke.cost <= lv.threeStar, `039 两笔外绕解 (${cm(twoStroke.cost)}cm) 超出三星线 (${cm(lv.threeStar)}cm)`);
|
||||
console.log(
|
||||
` ↳ 039 双解核验:3笔分送=${cm(threeStroke.cost)}cm vs 2笔串双金让路=${cm(twoStroke.cost)}cm ` +
|
||||
`(差值 +${cm(twoStroke.cost - threeStroke.cost)}cm, 均 ≤ 三星 ${cm(lv.threeStar)}cm)`,
|
||||
);
|
||||
}
|
||||
|
||||
if (entry.key === '051') {
|
||||
const clipFirst = solveSample(lv, { allowChain: true, forcedFirst: 's51-green' });
|
||||
const naiveGoldFirst = solveSample(lv, { allowChain: false, forcedFirst: 's51-gold-a' });
|
||||
assert(clipFirst, '051 先绣绿叶开夹路径无解');
|
||||
assert(naiveGoldFirst, '051 先拆左片金甲朴素路径也应可通关');
|
||||
assert(clipFirst.strokes <= 3, `051 先开夹应可 3 笔成画,当前 ${clipFirst.strokes} 笔`);
|
||||
assert(clipFirst.cost <= lv.threeStar, `051 先开夹 (${cm(clipFirst.cost)}cm) 应稳拿三星 (${cm(lv.threeStar)}cm)`);
|
||||
assert(naiveGoldFirst.cost > lv.threeStar, `051 朴素分送 (${cm(naiveGoldFirst.cost)}cm) 应高于三星线以凸显改序收益`);
|
||||
const clipDef = unspool.clips[0];
|
||||
assert.equal(isClipUnlocked(clipDef, []), false);
|
||||
console.log(
|
||||
` ↳ 051 开夹改序核验:先开夹=${cm(clipFirst.cost)}cm(${clipFirst.strokes}笔, 3★) vs 朴素分送=${cm(naiveGoldFirst.cost)}cm(${naiveGoldFirst.strokes}笔), ` +
|
||||
`改序省线 ${cm(naiveGoldFirst.cost - clipFirst.cost)}cm!`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('全部 5 张验证样板(026A / 026B / 038A / 039 / 051)均通过几何、压层、木夹与策略分叉审计!');
|
||||
Reference in new issue
Block a user