@zseven-w/dsh-game-studio 0.1.0-rc.6 → 0.1.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -4
- package/README.zh.md +5 -4
- package/lib/index.js +148 -6
- package/lib/mcp-server.js +1074 -21
- package/package.json +2 -1
- package/plugins/game-studio/plugin.json +1 -1
- package/plugins/game-studio/scripts/mcp-server.mjs +1074 -21
- package/plugins/game-studio/skills/game-studio/SKILL.md +4 -2
- package/plugins/game-studio/template/collector/game.js +5 -1
- package/plugins/game-studio/template/voxel/game.js +2 -1
- package/scripts/install-hosts.mjs +1 -0
- package/skills/game-studio/SKILL.md +4 -2
- package/template/collector/game.js +5 -1
- package/template/voxel/game.js +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-game-studio",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.7",
|
|
4
4
|
"description": "DSH Game Studio — build 2D/3D web games, run headless Chrome playtests (Web & WeChat Mini Game capsule simulation), generate transparent AI art, export < 4 MB WeChat Mini Games, and publish to GitHub Pages",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ZSeven-W"
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<strong>Describe a small game in one sentence — play it in the <a href="https://github.com/deepseek-ai/deepseek-harness">DeepSeek Harness</a> sidebar or build it in Codex / Claude Code / Antigravity, swap in AI art, and ship to Web, GitHub Pages, or WeChat Mini Games (< 4 MB).</strong><br />
|
|
9
|
-
<sub>
|
|
9
|
+
<sub>16 agent tools • DSH + Codex + Claude Code + Antigravity • 2D and 3D voxel templates • OpenAI or Codex art • TapTap H5 / WeChat / Web device simulator & playtests • WeChat Mini Game export & CLI upload • GitHub Pages</sub>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
-
<sub>Package: <code>@zseven-w/dsh-game-studio</code> · Current plugin release: <code>0.1.0-rc.
|
|
17
|
+
<sub>Package: <code>@zseven-w/dsh-game-studio</code> · Current plugin release: <code>0.1.0-rc.7</code> · Tested with DSH <code>0.2.1-rc.5</code> & Codex / Claude Code MCP</sub><br />
|
|
18
18
|
🎮 <a href="https://finiking.github.io/dsh-games/wall/"><strong>Live Demo Game Wall (10 playable 2D & 3D games)</strong></a> · 📖 <a href="./INSTALL.md"><strong>Multi-Host Setup (DSH / Codex / Claude / AGY)</strong></a>
|
|
19
19
|
</p>
|
|
20
20
|
|
|
@@ -80,7 +80,8 @@ Measured in a real DSH with DeepSeek-V4.1-Flash, each game made from one sentenc
|
|
|
80
80
|
| --- | --- |
|
|
81
81
|
| `game_studio_create` | Create a playable game from the `collector` (2D) or `voxel` (3D) template, build it and show it in the sidebar. Takes the title, an art style, `orientation` (portrait or landscape) and `slots` — the game's own art slots, named in the user's language. |
|
|
82
82
|
| `game_studio_build` | Rebuild after editing `game.json` or `game.js`, refresh the preview and save a version with a short note. |
|
|
83
|
-
| `game_studio_playtest` | Play the latest code headlessly (phone-shaped portrait or
|
|
83
|
+
| `game_studio_playtest` | Play the latest code headlessly (phone-shaped portrait or landscape) and report phases, best score, hearts, fps, errors and screenshots; pass `platform: "wechat"` for WeChat capsule & single-WebGL checks or `platform: "taptap"` for TapTap H5 Dynamic Island + capsule (`y=88..115pt`), `window.tap.*`, HUD gap readout, and iOS dual-event touch verification; `characters: true` returns close-ups only. |
|
|
84
|
+
| `game_studio_preview` | Open the interactive **Game Simulator** (TapTap iOS / TapTap Android / WeChat iOS / Mobile Web presets) natively in Antigravity's side pane (`ui://dsh-game-studio/simulator.html`) and via a local loopback URL, with auto-fit scaling, safe-area guides, live FPS/gap/error telemetry, iOS dual-event self-test, and mock rewarded-ad callbacks. |
|
|
84
85
|
| `game_studio_generate_asset` | Generate 1–4 candidate images for one slot with `openai` or `codex`, optionally following a reference picture. Asks for approval before spending. Codex runs in the background. |
|
|
85
86
|
| `game_studio_apply_asset` | Put a candidate into the game by its number, rebuild and refresh. |
|
|
86
87
|
| `game_studio_revert_asset` | Go back to a slot's previous art. |
|
|
@@ -136,7 +137,7 @@ dsh web
|
|
|
136
137
|
git clone https://github.com/ZSeven-W/dsh-game-studio.git
|
|
137
138
|
cd dsh-game-studio
|
|
138
139
|
npm install
|
|
139
|
-
npm run setup # Codex (registers plugin + verifies all
|
|
140
|
+
npm run setup # Codex (registers plugin + verifies all 16 tools via codex app-server)
|
|
140
141
|
npm run setup:claude # Claude Code
|
|
141
142
|
npm run setup:agy # Antigravity
|
|
142
143
|
npm run setup:all # All hosts at once
|
package/README.zh.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<strong>一句话描述一个小游戏 —— 在 <a href="https://github.com/deepseek-ai/deepseek-harness">DeepSeek Harness</a> 对话侧栏里直接玩,或在 Codex / Claude Code / Antigravity 中创作,换上 AI 美术,一键导出单文件 HTML、发布 GitHub Pages 或打包上架微信小游戏(< 4 MB)。</strong><br />
|
|
9
|
-
<sub>
|
|
9
|
+
<sub>16 个 agent 工具 • 支持 DSH + Codex + Claude Code + Antigravity • 2D 与 3D 体素模板 • OpenAI 或 Codex 生图 • TapTap H5 / 微信 / Web 真机模拟器与自动试玩 • 微信小游戏一键导出与 CLI 上传 • GitHub Pages</sub>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
-
<sub>包名:<code>@zseven-w/dsh-game-studio</code> · 当前插件版本:<code>0.1.0-rc.
|
|
17
|
+
<sub>包名:<code>@zseven-w/dsh-game-studio</code> · 当前插件版本:<code>0.1.0-rc.7</code> · 已在 DSH <code>0.2.1-rc.5</code> 及 Codex / Claude Code MCP 测试</sub><br />
|
|
18
18
|
🎮 <a href="https://finiking.github.io/dsh-games/wall/"><strong>在线试玩游戏墙(10 款实测 2D/3D 小游戏)</strong></a> · 📖 <a href="./INSTALL.md"><strong>多端安装指南(DSH / Codex / Claude / AGY)</strong></a>
|
|
19
19
|
</p>
|
|
20
20
|
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
| --- | --- |
|
|
81
81
|
| `game_studio_create` | 从 `collector`(2D)或 `voxel`(3D)模板创建能玩的游戏,构建并显示在侧栏。参数包括标题、美术风格、`orientation`(竖屏或横屏)和 `slots`:游戏自己的美术槽位,用用户的语言命名。 |
|
|
82
82
|
| `game_studio_build` | 改完 `game.json` 或 `game.js` 后重新构建、刷新预览,并附一句说明存成一个版本。 |
|
|
83
|
-
| `game_studio_playtest` | 无界面地玩最新代码(手机竖屏或横屏),报告阶段、最高分、剩余生命、帧率、错误和截图;传 `platform: "wechat"`
|
|
83
|
+
| `game_studio_playtest` | 无界面地玩最新代码(手机竖屏或横屏),报告阶段、最高分、剩余生命、帧率、错误和截图;传 `platform: "wechat"` 可模拟微信胶囊安全区与单 WebGL 校验;传 `platform: "taptap"` 可模拟 TapTap iOS 灵动岛 + 胶囊(`y=88..115pt`)、`window.tap.*`、顶栏间距读数与 iOS 双事件点滑自检;`characters: true` 只返回角色特写。 |
|
|
84
|
+
| `game_studio_preview` | 唤起交互式 **真机调试模拟器**(支持 `TapTap iOS / TapTap Android / 微信 iOS / Web 手机`),在 Antigravity 侧边栏以原生 MCP App(`Game Simulator`)打开并返回本地链接,自带自适应缩放、安全区标线、实时 FPS/间距/报错遥测、iOS 双事件自检与激励视频模拟回调。 |
|
|
84
85
|
| `game_studio_generate_asset` | 用 `openai` 或 `codex` 给一个槽位生成 1–4 张候选图,可选参考图。花钱前先审批;Codex 在后台运行。 |
|
|
85
86
|
| `game_studio_apply_asset` | 按编号把候选图放进游戏,重新构建并刷新。 |
|
|
86
87
|
| `game_studio_revert_asset` | 把某个槽位恢复成上一张美术。 |
|
|
@@ -136,7 +137,7 @@ dsh web
|
|
|
136
137
|
git clone https://github.com/ZSeven-W/dsh-game-studio.git
|
|
137
138
|
cd dsh-game-studio
|
|
138
139
|
npm install
|
|
139
|
-
npm run setup # 一键注册到 Codex 并通过 codex app-server 验证全部
|
|
140
|
+
npm run setup # 一键注册到 Codex 并通过 codex app-server 验证全部 16 个工具
|
|
140
141
|
npm run setup:claude # 安装到 Claude Code
|
|
141
142
|
npm run setup:agy # 安装到 Antigravity
|
|
142
143
|
npm run setup:all # 一次性安装到全部宿主
|
package/lib/index.js
CHANGED
|
@@ -4844,17 +4844,23 @@ import { extname as extname4, join as join12 } from "node:path";
|
|
|
4844
4844
|
import { pathToFileURL } from "node:url";
|
|
4845
4845
|
var RENDERS_CONTRACT = 'Sidebar thumbnails and playtest close-ups of characters drawn in code come from game.js: window.__renderSlots(size) returns { <slot>: "data:image/png;base64,\u2026" } for slots that still hold template art (transparent PNG, size\xD7size, one character centred), and once after load the game posts { source: "dsh-game-studio", type: "renders", renders: __renderSlots(256) } to window.parent. The voxel template builds both from MODELS; the collector template from drawCharacter(g, slot, size), the one function that draws each character for both the game and the close-ups, so a character drawn in code belongs there. A game without them shows the slot files (assets/\u2026) in the sidebar, which is right when you drew the characters into those files.';
|
|
4846
4846
|
var GAME_STATE_CONTRACT = `The playtest autopilot reads window.__gameState(), which must return { phase: "title" | "playing" | "won" | "lost", score, hearts, fps, hero: { x, y }, pickups: [{ x, y }], enemies: [{ x, y }], world: { w, h } } (positions in one world space; add heroOnScreen: false while the hero is out of view). It starts the round with a tap (phone) or Enter (desktop) and steers with the arrow keys. Keep this function when you rewrite game.js. A game not played by steering one hero with the arrow keys (grid, cards, aiming, rhythm, building, management) should also define window.__autoplay(state): during a playtest it is called about 10 times a second with the current __gameState() and makes one sensible move through the game's own functions (a valid swap, the first playable card, a shot at the hoop), so the playtest can play the real loop; players never trigger it, so it needs no rule or menu switch. Without it the autopilot only holds arrow keys toward the nearest pickup. Every keyboard action (steering, jump, dash, skills, cards) must also work by touch on phones: give active skills or jump/dash on-screen touch buttons bound to pointerdown (with stopPropagation), and track virtual joystick / button pointers by pointerId so one thumb can steer while the other taps a skill.`;
|
|
4847
|
-
var PLAYTEST_PLATFORMS = ["web", "wechat"];
|
|
4847
|
+
var PLAYTEST_PLATFORMS = ["web", "wechat", "taptap"];
|
|
4848
4848
|
var KEEP_RUNS = 5;
|
|
4849
4849
|
var VIEWPORTS = {
|
|
4850
4850
|
portrait: { width: 390, height: 844, touch: true },
|
|
4851
4851
|
landscape: { width: 960, height: 540, touch: false },
|
|
4852
|
-
wechatLandscape: { width: 844, height: 390, touch: true }
|
|
4852
|
+
wechatLandscape: { width: 844, height: 390, touch: true },
|
|
4853
|
+
taptapPortrait: { width: 393, height: 852, touch: true },
|
|
4854
|
+
taptapLandscape: { width: 852, height: 393, touch: true }
|
|
4853
4855
|
};
|
|
4854
4856
|
var WX_CAPSULES = {
|
|
4855
4857
|
portrait: { top: 51, bottom: 83, left: 291, right: 378, width: 87, height: 32 },
|
|
4856
4858
|
landscape: { top: 12, bottom: 44, left: 745, right: 832, width: 87, height: 32 }
|
|
4857
4859
|
};
|
|
4860
|
+
var TAPTAP_CAPSULES = {
|
|
4861
|
+
portrait: { top: 88, bottom: 115, left: 294, right: 381, width: 87, height: 27 },
|
|
4862
|
+
landscape: { top: 12, bottom: 40, left: 753, right: 840, width: 87, height: 28 }
|
|
4863
|
+
};
|
|
4858
4864
|
var KEYS = { up: "ArrowUp", down: "ArrowDown", left: "ArrowLeft", right: "ArrowRight" };
|
|
4859
4865
|
async function loadPlaywrightCore() {
|
|
4860
4866
|
try {
|
|
@@ -4959,8 +4965,8 @@ async function playtest(dir, options = {}) {
|
|
|
4959
4965
|
const gameFile = join12(runDir, "game.html");
|
|
4960
4966
|
await writeFile5(gameFile, html);
|
|
4961
4967
|
const landscape = options.portrait === void 0 ? manifest.orientation === "landscape" : options.portrait === false;
|
|
4962
|
-
const viewport = platform === "wechat" ? landscape ? VIEWPORTS.wechatLandscape : VIEWPORTS.portrait : landscape ? VIEWPORTS.landscape : VIEWPORTS.portrait;
|
|
4963
|
-
const capsuleRect = platform === "wechat" ? landscape ? WX_CAPSULES.landscape : WX_CAPSULES.portrait : void 0;
|
|
4968
|
+
const viewport = platform === "wechat" ? landscape ? VIEWPORTS.wechatLandscape : VIEWPORTS.portrait : platform === "taptap" ? landscape ? VIEWPORTS.taptapLandscape : VIEWPORTS.taptapPortrait : landscape ? VIEWPORTS.landscape : VIEWPORTS.portrait;
|
|
4969
|
+
const capsuleRect = platform === "wechat" ? landscape ? WX_CAPSULES.landscape : WX_CAPSULES.portrait : platform === "taptap" ? landscape ? TAPTAP_CAPSULES.landscape : TAPTAP_CAPSULES.portrait : void 0;
|
|
4964
4970
|
const report = {
|
|
4965
4971
|
runDir,
|
|
4966
4972
|
browser: "",
|
|
@@ -5140,6 +5146,103 @@ async function playtest(dir, options = {}) {
|
|
|
5140
5146
|
(document.body || document.documentElement).appendChild(pill);
|
|
5141
5147
|
});
|
|
5142
5148
|
}, { vw: viewport.width, vh: viewport.height, cap: capsuleRect });
|
|
5149
|
+
} else if (platform === "taptap" && capsuleRect) {
|
|
5150
|
+
await context.addInitScript(({ vw, vh, cap }) => {
|
|
5151
|
+
const isPortrait = vh > vw;
|
|
5152
|
+
const safeTop = isPortrait ? 59 : 0;
|
|
5153
|
+
const safeBottom = isPortrait ? 34 : 21;
|
|
5154
|
+
const topHudY = cap.bottom + 8;
|
|
5155
|
+
const safeArea = {
|
|
5156
|
+
top: safeTop,
|
|
5157
|
+
bottom: vh - safeBottom,
|
|
5158
|
+
left: 0,
|
|
5159
|
+
right: vw,
|
|
5160
|
+
width: vw,
|
|
5161
|
+
height: vh - safeTop - safeBottom,
|
|
5162
|
+
capsule: { ...cap },
|
|
5163
|
+
topHudY,
|
|
5164
|
+
bottomInset: safeBottom
|
|
5165
|
+
};
|
|
5166
|
+
window.__taptap__ = true;
|
|
5167
|
+
window.__taptapSafeArea = safeArea;
|
|
5168
|
+
const sysInfo = {
|
|
5169
|
+
platform: "ios",
|
|
5170
|
+
brand: "iPhone",
|
|
5171
|
+
model: "iPhone 15 Pro",
|
|
5172
|
+
windowWidth: vw,
|
|
5173
|
+
windowHeight: vh,
|
|
5174
|
+
screenWidth: vw,
|
|
5175
|
+
screenHeight: vh,
|
|
5176
|
+
pixelRatio: 2,
|
|
5177
|
+
statusBarHeight: safeTop,
|
|
5178
|
+
safeArea
|
|
5179
|
+
};
|
|
5180
|
+
window.tap = {
|
|
5181
|
+
getSystemInfoSync: () => ({ ...sysInfo }),
|
|
5182
|
+
getMenuButtonBoundingClientRect: () => ({ ...cap }),
|
|
5183
|
+
vibrateShort: () => {
|
|
5184
|
+
},
|
|
5185
|
+
createRewardedVideoAd: () => {
|
|
5186
|
+
let onCloseCb = null;
|
|
5187
|
+
return {
|
|
5188
|
+
load: () => Promise.resolve(),
|
|
5189
|
+
show: () => {
|
|
5190
|
+
setTimeout(() => {
|
|
5191
|
+
onCloseCb?.({ isEnded: true });
|
|
5192
|
+
}, 30);
|
|
5193
|
+
return Promise.resolve();
|
|
5194
|
+
},
|
|
5195
|
+
onLoad: () => {
|
|
5196
|
+
},
|
|
5197
|
+
offLoad: () => {
|
|
5198
|
+
},
|
|
5199
|
+
onError: () => {
|
|
5200
|
+
},
|
|
5201
|
+
offError: () => {
|
|
5202
|
+
},
|
|
5203
|
+
onClose: (fn) => {
|
|
5204
|
+
onCloseCb = fn;
|
|
5205
|
+
},
|
|
5206
|
+
offClose: () => {
|
|
5207
|
+
onCloseCb = null;
|
|
5208
|
+
}
|
|
5209
|
+
};
|
|
5210
|
+
}
|
|
5211
|
+
};
|
|
5212
|
+
let gameVal;
|
|
5213
|
+
Object.defineProperty(window, "GAME", {
|
|
5214
|
+
configurable: true,
|
|
5215
|
+
get() {
|
|
5216
|
+
return gameVal;
|
|
5217
|
+
},
|
|
5218
|
+
set(next) {
|
|
5219
|
+
if (next && typeof next === "object") {
|
|
5220
|
+
next.safeTopInset = topHudY;
|
|
5221
|
+
next.safeBottomInset = safeBottom;
|
|
5222
|
+
next.safeArea = safeArea;
|
|
5223
|
+
}
|
|
5224
|
+
gameVal = next;
|
|
5225
|
+
}
|
|
5226
|
+
});
|
|
5227
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
5228
|
+
const root = document.body || document.documentElement;
|
|
5229
|
+
if (isPortrait) {
|
|
5230
|
+
const island = document.createElement("div");
|
|
5231
|
+
island.id = "__dsh-taptap-island-overlay";
|
|
5232
|
+
island.style.cssText = "position:fixed;top:11px;left:50%;transform:translateX(-50%);width:122px;height:35px;border-radius:20px;background:#000;pointer-events:none;z-index:2147483647;";
|
|
5233
|
+
root.appendChild(island);
|
|
5234
|
+
const homeBar = document.createElement("div");
|
|
5235
|
+
homeBar.id = "__dsh-taptap-home-overlay";
|
|
5236
|
+
homeBar.style.cssText = "position:fixed;bottom:8px;left:50%;transform:translateX(-50%);width:134px;height:5px;border-radius:3px;background:rgba(20,20,20,0.42);pointer-events:none;z-index:2147483647;";
|
|
5237
|
+
root.appendChild(homeBar);
|
|
5238
|
+
}
|
|
5239
|
+
const pill = document.createElement("div");
|
|
5240
|
+
pill.id = "__dsh-taptap-capsule-overlay";
|
|
5241
|
+
pill.style.cssText = `position:fixed;left:${cap.left}px;top:${cap.top}px;width:${cap.width}px;height:${cap.height}px;border-radius:16px;background:rgba(45,45,50,0.56);border:0.5px solid rgba(255,255,255,0.34);display:flex;align-items:center;justify-content:space-around;box-sizing:border-box;padding:0 9px;pointer-events:none;z-index:2147483647;color:#fff;font:700 13px/1 -apple-system,sans-serif;`;
|
|
5242
|
+
pill.innerHTML = '<span style="letter-spacing:1.5px">\u2022\u2022\u2022</span><span style="width:1px;height:14px;background:rgba(255,255,255,0.28)"></span><span style="font-size:15px">\u25CE</span>';
|
|
5243
|
+
root.appendChild(pill);
|
|
5244
|
+
});
|
|
5245
|
+
}, { vw: viewport.width, vh: viewport.height, cap: capsuleRect });
|
|
5143
5246
|
}
|
|
5144
5247
|
const page = await context.newPage();
|
|
5145
5248
|
page.setDefaultTimeout(15e3);
|
|
@@ -5317,6 +5420,43 @@ async function playtest(dir, options = {}) {
|
|
|
5317
5420
|
);
|
|
5318
5421
|
}
|
|
5319
5422
|
}
|
|
5423
|
+
if (platform === "taptap" && capsuleRect) {
|
|
5424
|
+
if (typeof state.topY === "number" && Number.isFinite(state.topY)) {
|
|
5425
|
+
report.topHudY = Math.round(state.topY);
|
|
5426
|
+
report.capsuleGap = Math.round(state.topY - capsuleRect.bottom);
|
|
5427
|
+
if (report.capsuleGap < 4) {
|
|
5428
|
+
report.notes.push(
|
|
5429
|
+
`TapTap HUD collision warning: topY=${report.topHudY}pt crowds or overlaps the TapTap capsule bottom y=${capsuleRect.bottom}pt (gap ${report.capsuleGap}pt < 4pt).`
|
|
5430
|
+
);
|
|
5431
|
+
}
|
|
5432
|
+
}
|
|
5433
|
+
const errBefore = report.errors.length;
|
|
5434
|
+
const touchOk = await page.evaluate(`(() => {
|
|
5435
|
+
const cv = document.querySelector('canvas');
|
|
5436
|
+
if (!cv) return true;
|
|
5437
|
+
const r = cv.getBoundingClientRect();
|
|
5438
|
+
const cx = Math.round(r.left + r.width * 0.5);
|
|
5439
|
+
const cy = Math.round(r.top + r.height * 0.52);
|
|
5440
|
+
cv.dispatchEvent(new PointerEvent('pointerdown', { pointerId: 99, pointerType: 'touch', isPrimary: true, clientX: cx, clientY: cy, bubbles: true, cancelable: true }));
|
|
5441
|
+
const t0 = { identifier: 0, clientX: cx, clientY: cy, pageX: cx, pageY: cy };
|
|
5442
|
+
const ts = new Event('touchstart', { bubbles: true, cancelable: true });
|
|
5443
|
+
ts.touches = [t0]; ts.changedTouches = [t0]; ts.targetTouches = [t0];
|
|
5444
|
+
cv.dispatchEvent(ts);
|
|
5445
|
+
const t1 = { identifier: 0, clientX: cx + 76, clientY: cy + 10, pageX: cx + 76, pageY: cy + 10 };
|
|
5446
|
+
const tm = new Event('touchmove', { bubbles: true, cancelable: true });
|
|
5447
|
+
tm.touches = [t1]; tm.changedTouches = [t1]; tm.targetTouches = [t1];
|
|
5448
|
+
cv.dispatchEvent(tm);
|
|
5449
|
+
const te = new Event('touchend', { bubbles: true, cancelable: true });
|
|
5450
|
+
te.touches = []; te.changedTouches = [t1]; te.targetTouches = [];
|
|
5451
|
+
cv.dispatchEvent(te);
|
|
5452
|
+
window.dispatchEvent(new PointerEvent('pointerup', { pointerId: 99, pointerType: 'touch', isPrimary: true, clientX: cx + 76, clientY: cy + 10, bubbles: true }));
|
|
5453
|
+
return true;
|
|
5454
|
+
})()`).catch(() => false);
|
|
5455
|
+
report.iosDualTouchPassed = touchOk && report.errors.length === errBefore;
|
|
5456
|
+
if (!report.iosDualTouchPassed) {
|
|
5457
|
+
report.notes.push("TapTap iOS dual-event (pointerdown + touchstart -> touchmove -> touchend) check raised a runtime error.");
|
|
5458
|
+
}
|
|
5459
|
+
}
|
|
5320
5460
|
report.finalPhase = state.phase;
|
|
5321
5461
|
if (typeof state.hearts === "number") report.hearts = state.hearts;
|
|
5322
5462
|
if (fps.length > 0) report.fps = { min: Math.min(...fps), avg: Math.round(fps.reduce((a, b) => a + b, 0) / fps.length) };
|
|
@@ -5361,8 +5501,10 @@ ${report.errors.slice(0, 10).map((e) => ` - ${e}`).join("\n")}`] : [],
|
|
|
5361
5501
|
`Images: ${report.shots.map((s) => s.file).join(", ")}`
|
|
5362
5502
|
].join("\n");
|
|
5363
5503
|
}
|
|
5504
|
+
const platformTag = report.platform === "wechat" ? " (WeChat Mini Game simulation)" : report.platform === "taptap" ? " (TapTap H5 simulation)" : "";
|
|
5505
|
+
const capsuleLabel = report.platform === "taptap" ? "TapTap capsule" : "WeChat capsule";
|
|
5364
5506
|
const lines = [
|
|
5365
|
-
`Playtest in ${report.browser}${
|
|
5507
|
+
`Playtest in ${report.browser}${platformTag}, ${report.viewport.width}\xD7${report.viewport.height}${report.viewport.touch ? " touch, screenshots at 2\xD7 pixels" : ""}` + (report.capsuleRect ? `, ${capsuleLabel} at (${report.capsuleRect.left},${report.capsuleRect.top})-(${report.capsuleRect.right},${report.capsuleRect.bottom}) \u2014 keep top-right buttons below y=${report.capsuleRect.bottom + 8}` : "") + (report.capsuleGap !== void 0 ? ` (measured topY=${report.topHudY}pt, gap ${report.capsuleGap >= 0 ? "+" : ""}${report.capsuleGap}pt)` : "") + (report.iosDualTouchPassed !== void 0 ? `; iOS dual-event touch: ${report.iosDualTouchPassed ? "passed" : "failed"}` : "") + (Object.keys(report.rules).length > 0 ? `, rules for this run only: ${JSON.stringify(report.rules)}` : "") + (report.autoplay === "game" ? "; played by the game's own window.__autoplay" : "; played by arrow keys toward the nearest pickup"),
|
|
5366
5508
|
`Phases: ${report.phases.map((p) => `${p.phase}@${p.at}s`).join(" \u2192 ") || "none"}; final: ${report.finalPhase}`,
|
|
5367
5509
|
`Best score: ${report.bestScore}${report.hearts !== void 0 ? `; hearts left: ${report.hearts}` : ""}` + (report.fps ? `; fps min ${report.fps.min}, avg ${report.fps.avg}` : "")
|
|
5368
5510
|
];
|
|
@@ -7489,7 +7631,7 @@ function apply(ctx, config = {}) {
|
|
|
7489
7631
|
seconds: { type: "integer", description: "How long the autopilot plays, 1-60. Default 15." },
|
|
7490
7632
|
rules: { type: "string", description: 'JSON object of rule overrides from game.json for this run only, e.g. {"duration": 3}.' },
|
|
7491
7633
|
portrait: { type: "boolean", description: 'true plays on a phone-shaped 390\xD7844 touch screen, false at 960\xD7540 landscape. Default follows "orientation" in game.json (portrait unless it says landscape); set that instead of passing this every time.' },
|
|
7492
|
-
platform: { type: "string", enum: PLAYTEST_PLATFORMS, description: `Runtime to simulate: "web" (default)
|
|
7634
|
+
platform: { type: "string", enum: PLAYTEST_PLATFORMS, description: `Runtime to simulate: "web" (default), "wechat" (injects wx.* APIs, single-WebGL check, and renders WeChat's top-right capsule on screenshots), or "taptap" (injects window.tap.* APIs, renders iPhone Dynamic Island + TapTap capsule y=88..115pt, checks HUD gap, and runs an iOS WKWebView dual-event touch check).` }
|
|
7493
7635
|
},
|
|
7494
7636
|
timeoutMs: 18e4,
|
|
7495
7637
|
output: {
|