# Prompts do jogo: Claude Opus 5.5 + Higgsfield MCP

Na ordem em que foram usados no vídeo. Um prompt por vez, e gerar e implementar sempre em passos separados. Todo prompt de implementação termina pedindo o arquivo: se o chat ficar pesado, abra outro e anexe o último HTML.

Material do vídeo e do post: https://kc1t.com/pt-br/logs/claude-opus-55-jogo

## Antes de começar

1. Selecione o Claude Opus 5.5 no seletor de modelo.
2. Conecte a Higgsfield: https://higgsfield.ai/mcp, Connect, escolha o Claude e faça login.
3. O prompt 1 (a cavaleira, sem MCP) está no arquivo `prompt-cavaleira-pixel-art.md`.

## Prompt 2: As regras da Higgsfield e a imagem de referência

Antes: libere o domínio `d8j0ntlcm91z4.cloudfront.net` em Configurações, Capacidades, senão a imagem gera mas o Claude não consegue baixar.

```
I just connected Higgsfield. From now on Higgsfield only generates raw assets and you write all
the code.
Rules for every Higgsfield step: use the exact result URL the tool returns and never guess one,
save each file in your working directory right after it is generated, and list its path and size.
If a file does not come through, stop and tell me instead of improvising or rebuilding it from
memory.

First step: generate the image below with generate_image, model gpt_image_2_5, quality high,
resolution 2k, aspect ratio 16:9, using the prompt exactly as written. Do not write code yet.

Pixel art, crisp hard-edged pixels, limited palette (~32 colours), no anti-aliasing blur, looks
like a real in-game screenshot of an indie 2D metroidvania.
Scene: a vast underground hall of a buried kingdom beneath a flower field. Huge ruined gothic
stone arches in the background fading into glowing violet and soft gold mist, a beam of warm light
falling from a crack in the ceiling where flowers and roots hang down. Mid-ground: broken columns,
fallen banners, glowing pale flowers growing between the stones. Foreground: dark silhouettes of
crystal shards and flower stems framing the bottom edge, floating pollen and petal particles
drifting.
Ground: a flat cobblestone walkway across the lower third, readable as the playable floor.
Character: Alethe, a SMALL knight standing in the centre on the walkway, about 1/9 of the image
height, side view facing right: dark bob haircut, silver plate armor, flowing white cape, sword
held low. She must be clearly readable despite being small, with a subtle rim light from the warm
beam.
No text, no UI, no HUD, no logos.
```

## Prompt 3: O jogo, montado a partir da imagem

```
Use the image you just generated with Higgsfield as the reference for the level. Look at it first
and write a short breakdown: the depth layers from back to front, where the light comes from, the
main shapes and a palette taken from it. Then build a scene that looks like that image, entirely in
code. Match the image, not a generic cathedral.

Turn Alethe into a playable 2D side-scroller set in that place, in a new single HTML file, reusing
the techniques from the knight: palette-indexed framebuffer at 320x180, integer scaling, outline and
rim light passes, dithering for light and mist, pooled particles, zero allocation inside the loop.

- Parallax layers taken from the image, with the walkway as the ground (a height map, so obstacles
and ramps work). Leave the farthest layer as an image slot (drag and drop, a FUNDO button or B, and
an × to go back), converted to the game palette with dithering. Draw it in code until an image is
loaded.
- Alethe small, about 20 px tall, same look as the knight you made: dark bob, silver armor, white
cape with verlet physics, sword.
- Controls: A/D to move, W to jump, J to attack (2-hit combo with a smear arc), K to dash with
afterimages. Coyote time, jump buffer, small hit-stop.
- Light and life from the image: god rays, drifting mist, falling petals, glowing flowers.
- No sound yet. We add audio in a later step.

When done, screenshot the game next to the reference image, list what does not match and fix it
until it reads as the same place. Test a run, jump, dash and attack across the level, fix anything
that blocks the path, and give me the file.
```

## Plano B do prompt 3: cenário travado camada por camada

Se o cenário ficar longe demais da imagem, use esta versão no lugar do prompt 3. Ela descreve o cenário inteiro com números.

```
Use the image you just generated with Higgsfield as the visual reference for this level: match its
composition, the beam of light in the center, the violet and gold mist, the ruined arches, statues,
banners and flowers, and the stone walkway as the floor. Where the reference and the spec below
disagree on a number, follow the spec; everywhere else, make it look as close to the reference as
you can.

Now turn Alethe into a playable 2D side-scroller set in the buried cathedral from the reference image, in a new single self-contained HTML file. Same engine style as the knight: palette-indexed framebuffer, integer scaling, outline and rim passes, pooled particles, zero allocation inside the loop. Follow this spec exactly: every number is intentional.

RENDERING
- Logical 320x180, level width 640. Uint8Array framebuffer of palette indices, converted through a Uint32 lookup table, putImageData to an offscreen canvas, drawImage onto a fullscreen canvas at the largest integer scale that fits window size x devicePixelRatio, centered on black, no smoothing, image-rendering: pixelated. Screen shake moves the camera 1 px horizontally and offsets the blit vertically.
- Fixed 60 Hz update with an accumulator, requestAnimationFrame render. A seeded PRNG (mulberry32, seed 7331) for everything baked at init, so the level is identical on every load. Ordered 4x4 Bayer dithering helper bay(x, y) in 0..1.
- Vignette baked once: d = ((x-160)/175)² + ((y-86)/118)² + bay·0.22; d > 0.82 darkens each pixel one step through a DARK table, d > 1.08 two steps.

PALETTE (exactly these 46 colors, by index)
0-9 haze, dark to light: #15142c #1f2044 #2a2a52 #37345d #463e68 #564a78 #6a5785 #806690 #977697 #b28a9a
10-14 indigo stone: #141327 #1e1c37 #2b2849 #3e3862 #574c7e
15-20 light and vines: #fff1cf #f6d4a1 #e3b38f #c9967f #7a5a6e #4a3a58
21-24 plum banners and gold sigil: #2c1636 #46204c #652d62 #e8bf86
25-28 flowers: #fffbf2 #ece2f6 #bca8e8 #8d78d0
29-32 hair and skin: #2a1c18 #4a3226 #f2cda6 #c9967c
33-36 armor: #eef3fb #aeb9cd #707e98 #3f4764
37-39 cape: #f3eee4 #c9bdd6 #8e84ad
40-45 mauve haze and blade: #a17a8c #c0979c #b98a7f #fffefa #d9b7a8 #8d6c87
Also build a DARK table (each color one step darker in its own ramp) and a LIGHT table (one step lighter) for the vignette and the light rays.

LAYERS (baked once, 255 = transparent; parallax offsets from the camera: L0 0.1, L1 0.3, L2 0.6, L3 1.0, L4 1.3)
L0, 352 wide, the far background (this is also the image slot, see BACKGROUND): a vertical haze ramp (brightness 0.3 to 0.85 down to y 140, fading a little below) plus a central light shaft around x 176 whose width grows with y (30 + 0.55y), mapped through the ramp 1,2,3,4,5,6,7,8,9,16,15 with Bayer dither. Side walls for x < 118 and x > 236 from y 40 to 150 in color 4 (5 on the top rows), with pointed windows every 16 px (glowing 7/8 from y 62 to 100, dimmer 6 from 108 to 138). Five backlit towers in the light at x 150, 164, 178, 190, 202 with tops at 70, 50, 38, 56, 74 and widths 7, 9, 8, 7, 6, pointed caps, color 7 with window ticks.
L1, 416 wide: ten gothic spires rising out of the mist (x, top, width): 34,104,7 · 52,118,4 · 96,112,5 · 134,122,3 · 150,110,6 · 270,114,5 · 290,124,3 · 318,104,7 · 338,118,4 · 384,110,5. Pointed tops, body 5 with the side toward x 208 lit (6, edge 41 when near the light, 7 otherwise), little buttresses on both sides. A separate tileable fog layer: rolling banks with tops at 126 ± sines, a second bank at 146, three low banks near 160-174, colors 9/8/7/6 from the top edge down, plus a thin dithered mist band around y 112. The fog scrolls slowly on its own (+0.05 px per tick) and is recolored warm (16, 44, 41, 40) within 70 px of the light column.
L2, 512 wide: two dark vaulted arches at 46-118 and 394-470 (top 18, spring 64) with ribs; solid dark walls at x < 16 and x ≥ 502 down to y 136; four great pillars (x, width) 16,30 · 118,22 · 372,22 · 470,32 with 7-row stone courses, lit on the side facing x 256, moldings at y 60 and 118; four torn plum banners with a gold circle-and-cross sigil at (21,16,20x78), (121,40,16x70), (375,40,16x64), (476,16,20x82); a hazy hooded praying statue at x 428 (y 28 to 136) in colors 4-8; a big crowned stone head resting at (84, 112), 32x40 ellipse lit from the right, eyes, nose, a crown of 5 spikes; rubble blocks and 40 small flowers around it; 18 hanging vines from the top between x 166 and 350 (longer near the center) with pale flowers, 12 more vines on the pillars; four ruined wall segments with flowers on top at (156,16,104), (176,10,112), (334,18,100), (300,8,116). Flowers are 5-px plus shapes with a light center; some glow and register a twinkle point.
L3, 640 wide, the world plane: the stone bridge deck from y 132 to 148 (top row 14, then 13, brick courses 12/13 with mortar 10 every 10 px, a dark line at 141, lower courses 11 with seams every 16 px), lit gold (15/16/17) within 80 px of x 320 on the top rows. Below it, from 149 to 180, bridge piers every 64 px with pointed arch openings 45 px wide, so the fog shows through. Solid obstacles that raise the height map: rubble blocks at 96-121 (top 126), 146-169 (top 120), 606-639 (top 112); a broken pillar at 198-217 with a jagged top around 96; a fallen column from (462,145) to (604,108), 14 px thick with ring bands every 24 px, that works as a walkable ramp; a round column capital at (603,100); a small banner at (566,104,18x36). 12 vines dropping from the bridge edge, 60 flower tufts on the stones, 20 glowing flowers along the ramp. The height map starts at 132 for every column and every solid pixel lowers it to that pixel's y; the first and last 3 columns are walls.
L4, 736 wide, foreground: two groups of dark crystal shards at x 0-96 and 630-736 (9 shards each, 14 to 44 px tall, 5 to 14 wide, leaning), colors 0/1 with a 2 edge and a 3 rim, pale flowers and dark leaves among them.
22 interactive flower clusters standing on the bridge at x 26, 58, 84, 132, 186, 232, 262, 290, 312, 346, 380, 410, 436, 486, 516, 540, 570, 596, 624, 208, 110, 158: 3 flowers each, stems 2 to 5 px, heads 25/26/27. They sway, lean away when she walks through them, drop petals, and get cut (stems only for 300 ticks, 16 petals) when hit by the sword. Even-index clusters are drawn behind her, odd in front.

KNIGHT RIG (small in-game Alethe, about 20 px tall, drawn into a local 48x48 buffer with the feet at (24, 42), facing right, mirrored by direction)
- Legs: two 6 px segments (thigh and shin) from the hip at pHip, angles fT/fS (front) and bT/bS (back); 2 px wide (color 34 with 35 behind for the front leg, 35/36 for the back leg); bright knee on the front leg; a 4 px dark sabaton.
- pHip is -12 in the air, -10 while dashing, otherwise minus the taller of the two legs (6·cos thigh + 6·cos shin).
- Torso from pHip-8 to pHip, 5 px wide, leaning with pLean toward the top: columns 36, 35, 34, 34, 33; a brown belt row at pHip-1 with a gold buckle; tassets on the hip row; a white specular pixel.
- Neck 3 px above the torso. Head: a 7x7 bob with the corners cut, hair 29, face in the lower right (skin 31 with a 32 shade column), fringe pixels, highlight pixels 30 on top, and 2 hair pixels flying behind while running, dashing or in the air.
- Arms: two 4 px segments each (upper and fore) with angles fU/fF (front) and bU/bF (back), same 2-tone limb style.
- Sword from the front hand at angle pSw: gold pommel, brown grip, a 5 px crossguard (gold center, 17 sides), a 12 px blade (43 core, 34 edge, 33 tip).
- Pauldron: 3x3 on the front shoulder.
- Cape: a 9-point verlet chain with 2.1 px segments, anchored at the upper back, gravity 0.13, damping 0.9, a light wind, 4 constraint iterations, always kept behind the body and above the ground. Drawn as circles growing from 1 to 3 px radius, 37 with 38/39 shading on the underside and every third segment.
- Outline: empty pixels touching the sprite become ink (0). Rim light: outline pixels on the side facing x 320 turn 16 (strong), 17 (medium) or 7 (weak) depending on how close she is to the light column; the top edge also catches 17/7 when she is close.
Poses per state (angles in radians; the drawn pose updates every tick from these targets):
IDLE: legs 0.14/0.02 and -0.14/-0.02, arms 0.25/0.75 and -0.12/0.15, sword 0.8, 1 px breathing every 30 ticks.
RUN: 8-step cycle from runPh, thigh ±0.8, shin bends back 1.05 on the rear half, arms swing opposite, sword -1.25, lean 1.
JUMP: 0.95/0.1 and -0.2/-0.75, arms -0.35/0.25 and -0.9/-0.4, sword -1.5.
FALL: 0.35/0.15 and -0.22/-0.35, arms 1.1/1.7 and -1.4/-1.0, sword -1.25.
LAND (8 ticks): 0.85/-0.5 and 0.3/-0.95, arms 0.5/1.0 and -0.3/0.2, sword 0.95, lean 1.
DASH: 0.95/0.35 and -1.0/-0.6, arms -1.1/-0.9 and -1.3/-1.1, sword -1.55, lean 3.
ATTACK 1 (overhead): wind-up (ticks 1-5) sword 3.9, front arm 2.7/3.3; strike (6-10) sword 1.0, arm 1.35/1.15, lean 2; follow-through sword 0.9.
ATTACK 2 (rising): wind-up sword 0.35, arm 0.5/0.4; strike sword 2.8, arm 2.25/2.7; follow-through sword 2.4.

MOVEMENT AND COMBAT
- Spawn at x 262 on the bridge, facing right, camera at 102.
- Acceleration 0.34 on the ground and 0.24 in the air, max speed 1.75, friction 0.68 on the ground and 0.93 in the air. Jump velocity -4.35, gravity 0.22 (0.5 while rising without holding jump, variable height), max fall 5. Jump buffer 7 ticks, coyote time 6 ticks.
- Horizontal collision against the height map: a step up of more than 5 px is a wall; she snaps down onto ground within 5 px. Ground at x is the minimum height in x-3..x+3.
- Dash: 11 ticks at 3.7 px per tick, no gravity, an afterimage every 3 ticks (5 ghosts fading over 14 ticks, dithered, colors 7/8), leaves at 1.7; recharges on landing.
- Attack: 22 ticks. The hit lands on tick 7: cuts flowers within 13 px in front, sparks and a stone sound when the sword hits a wall, hit-stop 4 ticks and a 6 tick screen shake. A white-to-gold smear arc (radius 13 to 17, angles 3.9→1.0 for the first swing and 0.35→2.8 for the second) fades over 9 ticks. Pressing attack after tick 7 queues the second swing, which starts after tick 13; the combo alternates.
- Dust puffs on jump, landing (from a fall faster than 2.4) and every run step.
- Camera eases toward x - 160 + 24·direction at 0.08 per tick, clamped to the level.

PARTICLES (one pool of 512)
- Petals (type 1): drift down with a sine flutter, 1 or 2 px wide, land on the height map and stay there.
- Light motes (type 2): 35% chance per tick near the light column, rising slowly and twinkling 15/16/17.
- Dust (type 3): short puffs in stone colors 14/13/12.
- Sparks (type 4): gravity, 43/16/17 with a trail.
- Ambient petals fall from the ceiling between x 210 and 430.
- Twinkle points registered on glowing flowers blink as 15 with a small plus when brightest.

LIGHT
Animated god rays from the light column at x 256 of L2: a cone that widens downward to y 132, with slowly moving bands (sin of the angle times 26, drifting over time), dithered, brightening the pixels under it one step through the LIGHT table.

RENDER ORDER
L0, L1, fog, L2, rays, L3, twinkles, back flower clusters, dash ghosts, knight, smear, front flower clusters, particles, L4, hint text, vignette.

BACKGROUND IMAGE SLOT
L0 can be replaced by an image: drag and drop onto the canvas, a FUNDO button in the top right (or the B key), and an × next to it to go back to the drawn L0. The image is halved repeatedly with high-quality smoothing until close, scaled to cover 352x180, then every pixel is Bayer-dithered and mapped to the nearest color among palette indices 0-18, 40, 41, 42, 44, 45 with a perceptual distance (weights 0.3 red, 0.59 green, 0.11 blue, plus a red-green term). Save the chosen image in localStorage so it survives a reload, and keep a BG_EMBED constant where an image can be embedded.

UI
- A pixel font (3x5 glyphs) drawn with a 1 px shadow. Hint line centered at the top: "A D ANDAR  W PULAR  J ATACAR  K DASH  M SOM  B FUNDO", blinking for the first 4 seconds and until the first input.
- Keys: A/D or arrows to move; W, up, space or Z to jump; J or X to attack; K, Shift or C to dash.
- On-screen touch pads, shown only on touch devices: ◀ ▶ bottom left, DASH, ATACAR, PULAR bottom right.

Test with a scripted run, jump, dash and attack combo across the whole level, including climbing the fallen column, and fix anything that blocks the path or looks wrong. Then give me the file.
```

## Prompt 4: O fundo (rode num chat separado)

Rode num chat novo: ajustar a imagem aqui não relê a conversa inteira do jogo. Depois cole a imagem no chat do jogo junto com o prompt 5.

```
Agora escreve o melhor prompt pra camada de fundo do jogo, pensando no que o seu motor precisa, e
gera com a Higgsfield (generate_image, gpt_image_2_5, quality high, 2k, 21:9). Usa estas regras:
- Uma catedral gótica subterrânea enorme e simétrica, vista de frente, com um feixe de luz dourada
caindo bem no centro exato, porque os raios animados e a luz de contorno da Alethe supõem a luz
no meio.
- Ao fundo, pináculos saindo da névoa, janelas góticas acesas nas paredes laterais e uma ponte
em arcos distante, tudo se dissolvendo em névoa violeta e lilás.
- Nada em primeiro plano: pilares, ponte jogável, estandartes, estátuas e trepadeiras já vêm das
camadas do código.
- Prompt negativo: characters, people, text, UI, foreground pillars, bridge, banners, statues,
hanging vines, frame, border, watermark, photorealism, 3D render, blur, high contrast.
Me mostra a imagem. Ainda não mexe no jogo.
```

## Prompt 5: O fundo dentro do jogo

```
Coloca essa imagem no fundo do jogo e embute ela no arquivo, no BG_EMBED. Mas tem que fazer
sentido perante o ambiente: adapte as cores e o cenário do jogo que você fez pra ela e tira do
código o que a imagem já mostra, pra não duplicar. Depois me passa o arquivo.
```

## Prompt 6: Gerar o som

```
Agora o som, passo a passo pra não quebrar. Lê o references/game-audio.md com
get_workflow_bundle_file (workflow "website-builder-flow") e segue ele. Gera com generate_audio:
- mirelo_text_to_audio, um som isolado cada, 1s: corte de espada, espada batendo na pedra,
rosnado de criatura de pedra, passo de armadura na pedra.
- mirelo_text_to_audio, 8s em loop: ambiente de catedral subterrânea, cachoeira distante, vento
leve e eco.
- sonilo_music, 40s: tema de exploração calmo e melancólico, harpa solo e cordas suaves com um
coral distante, lento, tom menor, instrumental.
Me mostra os áudios pra eu ouvir. Ainda não mexe no jogo.
```

## Prompt 7: Colocar o som no jogo

O preview do claude.ai não toca som. Baixe o HTML e abra no navegador pra ouvir.

```
Coloca no jogo pra eu ver como fica. Carrega os áudios direto pela URL pública da Higgsfield em
vez de colar base64 no arquivo, que quebra pelo tamanho. Corte no ataque, passo no andar, pedra ao
bater a espada, ambiente e música em loop, tudo começando na primeira tecla, M pra mudo. Testa e
me passa o arquivo.
```

## Prompt 8: Gerar o inimigo

```
Agora o inimigo, o Gosmo: uma criatura pequena de pedra violeta rachada, coberta de flores claras
e trepadeiras, com um olho dourado brilhante.
1. Gera a imagem-chave dele com generate_image, modelo flux_2: corpo inteiro, de lado virado pra
esquerda, pixel art nítida, margem em volta, fundo magenta puro chapado.
2. Anima com generate_video (Seedance) a partir dela, câmera totalmente parada, fundo magenta
parado: um clipe parado respirando e um andando no lugar, sem virar de lado.
Me mostra a imagem e os clipes. Ainda não mexe no jogo.
```

## Prompt 9: Colocar o inimigo no jogo

```
Coloca o Gosmo no jogo: extrai 4 quadros do clipe parado e 8 do andando, tira o magenta, remove
pixels soltos e fecha buracos, alinha pelo pé e reduz pra 30x44 com 32 cores. Ele tem que ter
destaque, mas continuar um pouco menor que a Alethe. Coloca 3 na ponte: patrulham, perseguem quando
ela chega perto, avisam antes de atacar, recuam e piscam quando levam dano. Vida da Alethe no HUD.
Adiciona um botão MATAR ao lado do FUNDO e a tecla G, que matam o próximo Gosmo vivo, pra eu testar
rápido. Testa uma luta inteira e me passa o arquivo.
```

## Prompt 10: A morte do inimigo

```
Agora a morte dele, na mesma resolução. Gera com a Higgsfield uma imagem-chave do começo da morte
(o Gosmo inteiro, rachaduras abrindo, olho apagando, uma ou duas flores surgindo), fundo magenta,
e anima com Seedance, câmera parada, ele desmoronando e as flores brotando no lugar. Extrai de 4 a
6 quadros, limpa igual ao andar e troca a explosão atual por essa animação. Me passa o arquivo.
```

## Prompt 11: Passada final

```
Joga a fase inteira: explora, luta com os 3 inimigos, morre uma vez e ganha uma vez. Corrige o que
estiver quebrado ou o que parecer colado em vez de parte do mesmo mundo. Depois me passa o arquivo
final e um relatório: créditos da Higgsfield por etapa, o que teve que refazer e por quê.
```
