跪拜 Guibai
← All articles
Frontend

No Manual Images for 103 Mini-Games: Automating Screenshots, Covers, Packaging, and Store Submission

By shuangyueliao ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

When the same game must exist as a TapTap H5 package, a source bundle for HuZhan, and a Xianyu chat-file product, manual asset work multiplies per store. This pipeline collapses that into one single-file ZIP and a few scripts, making store compliance a compile-time step instead of a Photoshop marathon.

Summary

Store publishing for 103 AI-coded mini-games is a four-layer pipeline. Headless Chrome captures gameplay screenshots with a virtual-time budget and injected test hooks that steer each game into a photogenic state. Cover cards are plain HTML templates; the same markup renders the five cover sizes TapTap, GameDistribution, GameMonetize, HuZhan, and Xianyu each demand, with only a game name, selling point, and dominant color swapped per title. Every game is forced into a single index.html using Canvas-drawn graphics and WebAudio sound, so one ZIP uploads everywhere, and SDKs are conditioned to load only when the hostname matches a platform domain.

On the submission side, DataTransfer injection fills file inputs, with a direct fetch POST as the fallback for components like Dropzone.js that ignore synthetic events. Three rejections yielded hard rules: TapTap's first-release quota (one submission per 24 hours, three per 168), Xianyu's emoji ban in descriptions, and HuZhan's refusal to allow bundled game packages. GameMonetize rejected the AI-generated games outright on quality. The current state is three live TapTap titles plus source-code sales, with a planned follow-up covering ad-SDK hooks and CrazyGames' 1,000-play ad threshold.

Takeaways
— TapTap requires a 1:1 icon, at least three screenshots, an H5 ZIP under 5MB, a privacy-policy link, age rating, and AI-content declaration.
— GameDistribution demands five cover sizes — 512×512, 200×120, 1280×720, 1280×550 — plus a 512×384 icon and human QA.
— Headless Chrome enforces a 500px minimum window width; smaller sizes come from scaling with sips or ffmpeg, not from resizing the window.
— A 4,000ms virtual-time budget lets a Canvas game finish initial rendering before the screenshot fires.
— In-game test hooks like window.__tr expose score and state, letting the screenshot script jump to an obstacle- or combo-filled scene.
— Cover cards built in HTML from one template output all required sizes by changing CSS, keeping storefront style uniform.
— Forcing every game into a single index.html with no external assets makes one ZIP valid for TapTap, GD, GM, HuZhan, and Xianyu.
— Platform SDKs load conditionally by hostname, so the same ZIP is a clean standalone on GitHub Pages or local servers.
— DataTransfer injection sets file inputs, but Dropzone.js ignores synthetic events; direct fetch POST FormData to the upload endpoint is the reliable workaround.
— TapTap's first-release quota allows one submission per 24 hours and three per 168 hours; staggering submissions avoids lockout.
— Xianyu rejects emoji like ✔ and ✅ in descriptions; √ and · pass.
— HuZhan refuses bundled multi-game packages but Xianyu expects them, so the same inventory needs opposite product structuring.
Conclusions

The test hook is a triple investment: the same window.__tr mechanism that produces attractive gameplay screenshots also drives automated tests and debugging, so store-readiness has near-zero marginal cost once games ship with that hook.

The single-file constraint turns packaging into a trivial operation and lets one artifact serve as an H5 build, a source bundle, and a direct-play link; the only remaining platform-specific work is a conditional SDK loader.

Store policies can directly contradict each other: HuZhan bans multi-game bundles while Xianyu requires them, so a universal ZIP still demands per-platform product structuring.

UI automation hits a wall at the component layer: DataTransfer injection works on raw inputs but fails on Dropzone.js, and the robust route is bypassing the UI and POSTing to the backend endpoint.

Concepts & terms
headless Chrome
A command-line Chrome that renders web pages without a visible window, allowing scripted screenshots at exact pixel dimensions.
virtual-time-budget
A Chromium flag that advances virtual time so animations and initial renders complete before a screenshot is taken, preventing blank canvases.
DataTransfer injection
A technique to programmatically assign files to an <input type='file'> by creating a DataTransfer object, replacing the input's file list, and dispatching a change event.
test hook
A small in-game API (for example window.__tr) that lets automation set score, state, or scene, enabling screenshots and tests to hit a specific visual moment.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗