# Macchina Italiana – Pizzeria | Coding LLM handoff

Build or extend the included offline Canvas 2D game. Run it by extracting the kit and opening index.html. Preserve its four horizontal counters and the reference character’s swept hair, amber aviators, moustache and striped jacket. All gameplay art is included, with clean alpha and fixed origins.

## Asset contract
* art/player.png contains ten animation rows. art/customers.png contains 24 animation rows (eight per customer, in the order Lina, Bruno, Nico). Each row has eight 48 × 48 frames. Frame 0 starts at the upper left. All character cells share their transparent padding and nominal foot baseline at y=45. The labeled guide PNGs are for humans.
* art/atlas.json names every animation as actor/action, and provides sheet, row, frame count, playback rate and loop flag. art/atlas.js contains the same data as a classic script for offline file:// use. Include it before game.js. Look up animation names, never infer a row from a filename.
* To animate, reset elapsed time when entering a state. Compute tick=floor(elapsedSeconds*fps). Use tick%count for loops and min(tick,count-1) for one-shots. Draw (48*frame,48*row,48,48) from the specified PNG. Round destination coordinates and turn off interpolation.
* art/pizzeria-assets.png contains 32 reusable 32 × 32 prop cells on an eight-column grid. atlas.props maps each name to [sx,sy,sw,sh]. These include counter end caps, the repeatable middle, leg, floor, awning, brick, wainscot, two oven-fire frames, entrance, hanging lamp, plant, menu, sign, tickets, ingredients, plate stack, four pizza frames, four empty plate frames and four break frames. The table guides list every cell.
* art/pizzeria-four-counters.png is the assembled 384 × 232 background. Draw at (0,0). For a custom room, tile the floor, add the service wall and awning, then place one door and one oven per row. Row anchors are 40,91,142,193. At each anchor y, place ten 32px counter pieces starting at (15,y-2): left end, eight middle pieces and right end. Draw legs behind the top. The oven sits at (351,y-6).
* Render customers at (customerX-3,y-21), scaled to 42 × 42. After the customers, redraw the background rectangle (15,y+3,320,20) at its original location so the counter hides the lower body. Projectiles draw at (itemX,y-8), 32 × 32. Render the server at (315,interpolatedLaneY-24), scaled to 46 × 46. The server faces left; approaching customers face right and departing customers face left. All movement is measured in logical canvas pixels.

## Implement the arcade loop
1. Begin with three lives. Admit customers through the left doors. Each places an order, walks toward the right end of their counter and becomes impatient near the oven.
2. Up and Down switch lanes. Animate the server moving between neighboring counters; keep the logical target lane distinct from the interpolated position. Space sends one pizza left after arrival. A tap on another lane selects it and queues a serve; dedicated buttons also support lane moves without serving.
3. Check same-lane swept collisions. The first waiting customer hit receives the pizza (+100), eats, sends back a plate, and walks out to the left. Spawn the plate exactly once as the return animation ends. A returning plate travels right. The server must be at that station when it arrives (+25).
4. A missed plate, wasted pizza, or customer reaching the service end costs one life. Clear active customers and projectiles on a loss. Show the failure reason and use the loss pose on game over. Advance one shift per eight successful deliveries, increasing customer pressure. Pause freezes positions, timers and spawn clocks. Restart resets all transient state.
5. Use the included game.js as the working implementation. For a different renderer, retain the collision rules, frame metadata and desk geometry. Use delta time with a cap for long frames; preserve the source aspect ratio, pixelated scaling and accessible keyboard/touch controls.

## Acceptance
Verify one delivery followed by one catch gives 125. Check that two customers in one lane receive one pizza apiece, a pizza never scores across lanes, and a missed plate costs exactly one life. Test all four desk positions, interrupted lane changes, pause, restart and offline loading. Preview every animation strip left to right before changing its timing.

## Poster and sound
The opening screen uses art/title-poster.webp with the title and Start shift button as live HTML. audio/macchina-italiana-remastered.mp3 is the original supplied track. Start playback on the first Start shift gesture, loop during play, and pause it with the simulation. Sound on/off controls the track, short effects and voices together. sound.js plays a slide on each successful throw and a ceramic click on a catch. The fourth delivery and every sixteenth delivery thereafter trigger a short synthesized “Pizza!” call. Every eighth delivery completes a shift and triggers “Bravo!” with a brief music-volume dip. Voice samples are bundled WAVs for offline playback.

## Cast artwork
The character generator uses four transparent portrait pieces under source/parts. Keep those beside source/build.py when rebuilding the atlases with Pillow. The server, Lina, Bruno, and Nico use individual body outlines, wardrobe details, and stride lengths. art/cast-preview.png shows an enlarged sample from the gameplay sheets.

## Terminal lettering and service gestures
fonts/terminal.css embeds the game’s display and reading faces. Use Pizzeria Terminal for the cover title, scoreboard, actions and canvas notices, and Pizzeria Mono for longer instructions. Both run offline. fonts/LICENSE.txt accompanies the font data. The room sign and counter numbers use a 5-row bitmap alphabet. Customers now have individual ordering gestures, draw the pizza toward themselves on receipt, lift a slice for a bite, then push the empty plate forward before release.
