题目一题都不改,只把主角换成你们学校的校服、你们的吉祥物。学生看到画面里穿的是自己的校服,投入感完全不一样。
Leave every question as it is and swap the character for your school's uniform or your mascot. Students engage differently when the figure on screen is wearing what they wear.
游戏用的是一张五格的横排图:站立、走路A、走路B、跳跃、摔落。你要做的就是同样五个动作的新图。
The game uses one image with five frames in a row: stand, walk-A, walk-B, jump, fall. Your job is to make the same five poses.
打开会画图的 AI(ChatGPT 的图像功能、Gemini 等),把下面这段贴进去。一次画一张,画完再接着要下一个动作,五个动作的大小才会一致。
Open an AI that generates images (ChatGPT's image tool, Gemini, …) and paste the prompt below. Do one pose per message, asking for the next pose in the same chat, so all five come out at the same scale.
请画一个 2D 游戏角色,侧面朝右,全身,画面里只有这一个角色。 背景:纯洋红色 #FF00FF,铺满整张画布。不要阴影、不要渐层、不要地面、不要边框、不要文字、不要浮水印。画面里除了角色以外什么都不要。 角色:一名十五岁的新加坡中学生,短发整齐、符合仪容规范(不遮眉、不盖耳、不及衣领)。 制服:(请改成你们学校的:例如「深蓝色运动上衣,两侧白色,左胸有小圆形校徽;黑色运动短裤;白色运动鞋、白色短袜」) 画风:扁平色块的卡通像素风。用色简单、边缘干净利落,不要抗锯齿、不要柔边、不要渐层、不要发光。 【最重要】角色必须是一个完整相连的整体:头发要和头连在一起、脖子连着上衣、上衣连着短裤、短裤连着大腿、腿连着鞋子。绝对不要在身体部位之间画出背景色、洋红色、白色或透明的细线、缝隙或轮廓。不要有任何悬空、断开的部件。 动作:站立,双脚平放在一条看不见的地面上,双手自然垂在身体两侧。 画面比例:直式 4:5。角色约占画面高度的 85%,居中,四周留一点均匀的空白,双脚接近画面底部。
Create a 2D game character sprite, side view facing right, full body, single character only. BACKGROUND: solid pure magenta #FF00FF filling the entire canvas. No shadow, no gradient, no ground line, no border, no text, no watermark. Nothing in the frame except the character. CHARACTER: a 15-year-old Singaporean secondary school student with short, neat hair cut to school grooming standards — above the eyebrows, above the ears, clear of the collar. UNIFORM: (describe your own school's — e.g. "navy-blue PE polo with white side panels and a small round badge on the left chest; black PE shorts; white sports shoes and white ankle socks") STYLE: flat cel-shaded cartoon with a chunky pixel-art look. Limited flat colour palette, hard crisp edges, NO anti-aliasing, NO soft or blurred edges, NO gradients, NO glow. CRITICAL: the character must be ONE single connected silhouette. Hair merged into the head, neck joined to the shirt, shirt to the shorts, shorts to the thighs, legs to the shoes. Never draw a background-coloured, magenta, white or transparent line, gap or outline between body parts. No floating or detached pieces. POSE: standing idle, both feet flat on an invisible ground line, arms relaxed at the sides. FRAMING: portrait 4:5. The character fills about 85% of the frame height, centred, with a small even margin, feet near the bottom.
每次都加上这句:「同一个角色、同样画风、同样洋红背景、同样 4:5 构图,人物高度与脚底位置完全一致」,然后描述动作:
Each time, add: "same character, same style, same magenta background, same 4:5 framing, identical character height and feet baseline", then describe the pose:
看到这几种情况就重画:身体里透出洋红色、头发和头分开、人物周围有一圈光晕或轮廓、脚下有影子、五张图人物忽大忽小。
Regenerate if you see: magenta showing through the body, hair sitting apart from the head, a halo or outline around the figure, a drop shadow, or the character changing size between poses.
在 Claude 或 ChatGPT 里上传五张图 + game.html,贴上这段:
In Claude or ChatGPT, upload the five images plus game.html and paste this:
我上传了五张角色图(顺序:站立、走路A、走路B、跳跃、摔落,背景都是洋红 #FF00FF),以及游戏档案 game.html。
请用 Python(PIL + numpy)把这五张图做成游戏用的贴图,并换进 game.html 里。请照下面的做法:
一、去背:用色键判断背景,而不是用边界填充 ——
r-g>45 且 b-g>45 且 g<140 的像素视为背景,alpha 设 0。
(这样连被轮廓围住的洋红色小块,例如两脚之间、膝盖下方,也会一并清掉。)
二、缩图前先把角色的颜色向外扩散几个像素(把透明区域填上最近的角色颜色),
否则缩图时会把洋红混进边缘,出现粉红色光晕。
颜色与 alpha 两个通道分开用 LANCZOS 缩放,再合并。
三、五格用【同一个缩放比例】,不要各自缩放到填满格子 ——
以最高的那一张决定比例(最高的姿势约占 150 像素),其余四张照同一比例缩。
每格 128×160,角色水平置中,脚底对齐同一条基线(约 y=158)。
横向拼成一张 640×160 的图。
四、把这张图转成 base64,替换 game.html 里 sprite.src 的那一长串(只替换这一串,其他一个字都别动)。
五、交件前请检查并告诉我:
· 每一格里角色的连通区块数量(理想是 1 块;若某格有好几块,代表身体断开了,请告诉我是哪一格)
· 五格的高度比例是否一致
· 最后把改好的 game.html 存成档案让我下载。
I've attached five character images (in order: stand, walk-A, walk-B, jump, fall — all on a magenta #FF00FF background) and the game file game.html.
Please use Python (PIL + numpy) to turn them into the game's sprite sheet and swap it into game.html. Do it like this:
1. KEY OUT THE BACKGROUND with a colour test rather than a border flood-fill:
treat a pixel as background when r-g>45 and b-g>45 and g<140, and set its alpha to 0.
(This also clears magenta trapped inside the outline — between the ankles, under a bent knee.)
2. BEFORE RESIZING, bleed the character's colours a few pixels outward into the transparent area,
otherwise the resize mixes magenta into the edges and leaves a pink halo.
Resize the colour and alpha channels separately with LANCZOS, then merge them.
3. Use ONE SHARED SCALE for all five frames — do not resize each to fill its cell.
Take the scale from the tallest pose (about 150px tall) and apply it to all five.
Each cell is 128×160, character centred horizontally, all feet on the same baseline (about y=158).
Stitch the five cells into a single 640×160 image.
4. Base64-encode that image and replace the long string in sprite.src inside game.html.
Change nothing else in the file.
5. Before handing it back, check and report:
· the number of connected components in each frame (1 is ideal; more than one means the body
is broken into pieces — tell me which frame)
· whether the five frames came out at consistent heights
· then save the modified game.html as a file I can download.
想知道这一整套是怎么做出来的(含 Python 脚本):docs/sprite-pipeline.md。
Want the whole method with the Python scripts: docs/sprite-pipeline.md.