DEV Community

Cover image for Graveyard Shift, A Haunted Arcade
Victor Lehr
Victor Lehr

Posted on Edited on

Graveyard Shift, A Haunted Arcade

This post is part of my submission to the Kiroween 2026 hackathon.

Graveyard Shift banner

Play it: https://playgraveyardshift.vercel.app
Code: https://github.com/vlww/Graveyard-Shift

There's a specific feeling you get in an empty arcade at night: rows of dead machines, one tube still humming, and corners that are a little too dark. For Kiroween's Costume Contest category, I wanted to put that feeling in a browser tab.

The result is Graveyard Shift: a Galaga-style shooter played on a realistic 3D arcade machine, the last one still running in an abandoned arcade at 3 a.m. Here's how I built it, and how Kiro's spec-driven workflow kept a very visual project from turning into a mess.


Inspiration

One rule: the darkness is afraid of light

Most retro web games put pixel art in a rectangle and stop there. I wanted the screen to be a physical object in a room, and the only real light source. Once the screen is the light, everything happening in the game spills into the world around it.

That gave me a design rule I kept coming back to:

Every spooky thing in the room has to tell the player something.

That's the Costume Contest brief in one sentence: spooky design that enhances the app's function.

Graveyard Shift: the last working machine glowing in a row of dead arcade cabinets


Built with Kiro

How I worked with Kiro: numbers, pictures and a memory of mistakes

This is the part I'd most like other people to steal.

1. A visual target first

Before writing any project code, I made a quick throwaway mockup (with an AI assistant) to answer one question: is this even worth building? It was, so I took reference screenshots from it. None of that mockup's code went into the project. Kiro built everything from scratch.

2. A design brief, not a prompt

Instead of "make a spooky arcade game", I wrote a long design brief in docs/ with concrete numbers:

  • the cabinet's side-profile coordinates
  • light intensities and angles
  • shader settings and camera positions
  • game timings and scoring

It also had a "Known pitfalls" section: every bug I'd already hit while prototyping.

3. Brief → requirements → design → tasks

In the Kiro IDE, I pointed a new spec at the brief (#docs/design-brief.md) and attached the reference screenshots. Kiro chose a design-first flow: it wrote design.md, then requirements.md (which filled in the "Validates: Requirement X.Y" links on each task), then tasks.md. I reviewed each one before approving it.

I asked for the tasks in a specific order: pure game logic and property tests first, rendering second, with a visual checkpoint against the reference screenshots at the end of each visual task.

tasks.md open in Kiro, with completed tasks and their requirement links

4. Playtest → new brief → spec update → code

This is where the spec workflow really paid off. After each playtest, I didn't fire off a string of fix-it prompts. I wrote a new brief, and Kiro updated the requirements, design and tasks before touching any code. Four rounds:

  1. The base game: the machine, CRT, lighting and the shooter.
  2. "The Arcade Is Watching": creeping darkness, a figure in the dark, night-shift mode, a title screen, a help button on the machine, a sticky-note high-score table, positional audio.
  3. Playtest fixes: the glow was too strong, the kill flash too harsh, and a halo bug (more on that below).
  4. Polish: a smoother title, the control-panel layout, typing initials directly, one-key replay.

Because every change went through the spec first, the reason behind each system was written down. Kiro wasn't guessing what I meant three sessions later.

5. Steering docs

I generated the foundation steering files and then edited them:

  • product.md: the creative rules ("the darkness fears light", "spooky effects must affect gameplay", "original art only")
  • tech.md: Vite + TypeScript, Three.js pinned to an exact version, Vitest + fast-check
  • structure.md: src/game/ is pure TypeScript, with no DOM and no Three.js

That last rule made the biggest difference. Kiro kept the game logic separate from rendering through every round without me having to repeat it, and that's what made real testing possible.

6. A scoped hook

One agent hook: when a file in src/game/ is saved, run the tests and fix failures. I limited it to that folder on purpose. A hook that fires on every shader tweak just burns credits.

7. Property-based tests

The brief listed correctness properties up front, and Kiro implemented them with fast-check. Instead of checking a few examples, each test throws thousands of random game states at a rule:

  • the score never decreases during a game
  • lives never go negative, and the game ends exactly when they hit zero
  • the player stays on screen, and there are never more than 3 bolts
  • the creeping darkness never drops below its minimum for your remaining lives
  • brighter light never makes the darkness grow faster than less light would

That last one is my favorite: my core design rule, as an actual test. The project ended up with 540+ tests, 140+ of them property-based.

// Simplified example of the idea (not the exact project code)
fc.assert(fc.property(arbCreepState, fc.float({ min: 0, max: 1 }), fc.float({ min: 0, max: 1 }),
  (state, dim, bright) => {
    fc.pre(bright > dim);
    const a = stepCreep(state, DT, { luminance: dim });
    const b = stepCreep(state, DT, { luminance: bright });
    return b.creep <= a.creep; // the darkness is afraid of light
  }));
Enter fullscreen mode Exit fullscreen mode

The costume

The techniques behind the look

A machine made entirely in code

There are no 3D models and no image files. Each cabinet starts as a flat side profile that's extruded into 3D, then gets T-molding edges, bevels, a recessed bezel and a slightly bulged screen. Every texture (the marquee, side art, control panel, checkered floor, plaster wall, coin slots) is drawn on a canvas when the page loads. Even the sound is synthesized with the Web Audio API.

The CRT

The game itself is a tiny 320×240 canvas, used as the texture on the screen and run through a custom shader:

  • barrel distortion: bending the picture like curved glass
  • 240 scanlines that fade with distance (using fwidth) so they don't shimmer
  • an RGB aperture mask: red, green and blue stripes like a real tube
  • phosphor bleed, flicker, a rolling band, and a power-on animation that opens from a single line

Close-up of the CRT: curved glass, scanlines and the NIGHT 1 banner

The screen lights the room

My favorite trick, and it's cheap. Every frame:

// Simplified: shrink the game frame, average it, light the room with it
tiny.drawImage(gameCanvas, 0, 0, 8, 6);
const px = tinyCtx.getImageData(0, 0, 8, 6).data;
// convert sRGB → linear, average, normalize by the brightest channel,
// then drive the screen's area light, spotlight and edge lights
Enter fullscreen mode Exit fullscreen mode

Explosions flash across the floor. Getting hit triggers a brownout, where every light tied to the screen sags together. You can feel the game's state in the room.

Every scare is information

  • A ghost face in the glass fades in when an enemy dives at you. It's your warning.
  • The brownout is how you know you were hit, with no pop-up text.
  • The black tendrils creeping over the walls are your health bar. They're added to the existing wall and floor materials with Three.js's onBeforeCompile, so they still receive real light and shadow. They avoid the screen's light, and creep closer as you lose lives.

Black tendrils creeping across the floor toward the machines on the last life

An interface that lives in the room

  • Help is a button on the machine. Press ? and the instructions appear on the CRT itself.
  • When my friends played, they kept clicking the 3D joystick with their mouse. Now the game notices, and after a few clicks shows "PLAY WITH YOUR KEYBOARD!"
  • The sound comes from the cabinet's speaker (HRTF panning, with the listener following the camera). Step back, and it gets quieter and more echoey.
  • High scores are a sticky note taped to the machine. Type your initials, and they're written on in handwriting.

The handwritten high-score sticky note taped to the cabinet

And if you play between midnight and 5 a.m., your shift begins… I'll let you find out.


Challenges

Things that went wrong (and became spec rules)

  • One NaN pixel blacked out the screen. A single invalid value from a shader got spread by the bloom pass into a huge black void. Fix: guard every shader that feeds bloom. It went straight into the brief's pitfalls list, and never came back.
  • A floor too dark to light. My first floor was so dark that neither the screen nor the moonlight showed on it. Realism needed a mid-dark floor, not a black one.
  • A glow that showed too much. Kiro built a glow around the screen from a blurred copy of the game image, so enemies appeared smeared on the bezel. The fix was one precise spec line: never sample the game texture outside the screen.
  • Too much bloom. Letters lost their edges. I added highlight compression in the CRT and raised the bloom threshold. Most of my playtest fixes were about turning things down.

What I learned

What I learned

  • Specs work for creative projects when you give them concrete targets. Exact numbers and reference images beat adjectives every time.
  • A "Known pitfalls" section works like memory. Once a bug is written into the spec, it doesn't happen again, even across sessions.
  • Pure logic plus property tests let you go wild on the visuals. I could pile on shaders and atmosphere without worrying about breaking the game underneath.
  • In horror, restraint wins.

What's next

Try it

Play it here: https://playgraveyardshift.vercel.app (desktop, keyboard, sound on). Try to beat 49,450 on the sticky note.

The full source, including the .kiro specs, steering and hooks, is on GitHub: https://github.com/vlww/Graveyard-Shift

Built with Kiro for the Kiroween 2026 hackathon. Don't let the lights go out. 🕯️

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.