题目一个字不改,换掉四个角色(或整片山景),让学生在画面上看到自己学校的校服。
Leave the questions alone and swap the four characters — or the whole landscape — so students see their own school on screen.
要跑三行指令,但不必看懂程序码。电脑要有 Python 3(Mac 内建)与 Pillow:pip3 install pillow numpy
Three commands, no code reading. You need Python 3 (built into macOS) and Pillow: pip3 install pillow numpy
现在的四个角色只差在发型(短发/马尾/短鲍伯/平头)。要几个就生几张,每张一排五个姿势。把下面的提示语复制给 ChatGPT Image 或类似工具。
The current four differ only in hairstyle. Generate one sheet per character, five poses in a row. Copy the prompt below into ChatGPT Image or similar.
Pixel-art character sheet, one row of five poses, side view, facing right. The five poses, left to right: 1. standing still 2. walking, left leg forward 3. walking, right leg forward 4. cheering with both arms raised, jumping 5. stumbling backwards, arms out, mouth open Character: a secondary school student in a school PE uniform — navy blue and white polo shirt with a collar, black shorts, white sneakers. Short black hair. CRITICAL requirements: - Solid pure magenta background, hex #FF00FF, nothing else in the background. - The character must be ONE connected silhouette: hair merged into the head, no background-coloured line, gap, seam or outline between body parts, no floating pieces. Check the neck, waist and knees especially. - All five poses at the SAME scale and standing on the SAME ground line. - Thick black outlines, flat colours, no gradients, no shadows, no text.
洋红背景不是随便挑的。角色身上不会出现这个颜色,去背时才能干净地键掉;从白色背景里分白球鞋和高光要难得多。「一个完整相连的整体」也一定要写 —— AI 常在脖子、腰、膝盖画出背景色的细缝,去背后角色就断成好几块。
The magenta is deliberate: nothing on the character is that colour, so it keys out cleanly — far easier than separating white shoes and highlights from a white background. The "one connected silhouette" line matters too: generated art loves to draw thin background-coloured seams at the neck, waist and knees, which leave the character in pieces once keyed.
把生成的图放进 art/,档名照旧(avatar-1-… 到 avatar-4-…),然后:
Drop your sheets into art/ keeping the filenames (avatar-1-… through avatar-4-…), then:
python3 tools/build-avatars.py python3 tools/embed-avatars.py python3 tools/build-sls.py
第一行去背、缩放、拼成一张贴图;第二行贴回 game.html;第三行重建 SLS 版。跑完打开 game.html 看看。
The first keys, scales and stitches the sheet; the second pastes it back into game.html; the third rebuilds the SLS build. Then open game.html and look.
四张图共用同一个缩放比例,所以学生换发型时角色不会忽大忽小。这一点是脚本处理好的,你不必管。
All four are scaled by one shared factor, so switching hairstyle never changes how big the character is. The script handles that.
山景不是图档,是程式画出来的 SVG —— 山形、配色、云、太阳全部写在 game.html 里 SCENE-START 那一段。改完跑 python3 tools/build-scene.py,落地页会跟着换。
The scenery is generated SVG, not an image file: hills, palette, clouds and sun all live in the SCENE-START block of game.html. Edit there, run python3 tools/build-scene.py, and the landing page follows.
| 山形 | FARn MIDn NEARn |
每个点是 [横向比例, 纵向比例],0 是上/左,1 是下/右 |
| 配色 | sky far mid near |
渐层的两个 stop-color |
| 旗子位置 | SUMMIT | 小路的终点也跟着它 |
| 太阳位置 | SUN | 刻意跟旗子拉开,免得两团黄糊在一起 |
| 小路 | TRAILn | 人物沿这条线走,改了路人就跟着改 |
山景是按框的形状现画的,不是固定比例的图。投影机上是一条细长带,手机上接近方形 —— 同一组座标,两边都不会被裁掉。所以改座标时用比例(0–1),不要用像素。
The scenery is generated to fit its measured box, so the same coordinates work on a projector's wide ribbon and a phone's near-square frame. Keep edits in fractions (0–1), never pixels.