Inspiration
Horror games usually ask for a download, a console or a whole evening. Horror in a browser is usually a jump scare with nothing to solve. Escape-room puzzles have the opposite problem: they are often unfair, and the answer depends on guessing what the designer meant.
I wanted something in between: a horror game you can start in a browser tab in seconds, on a laptop or on a phone, that looks and sounds like a film, with riddles that always play fair. Every answer should follow from clues you can find and read in the room, and the scares should never hide a clue.
What it does
The Cursed House is a cinematic horror game that runs in your browser. Arjun's grandfather vanished from a haunted bungalow thirty years ago, and his treasure is still inside. You walk Arjun into the house, room by room. Each room asks you one riddle at a time. Answer right and the lights blink and the next riddle is asked. Answer wrong and the witch comes for him.
Play anywhere: laptop or phone
- No install. Open the link in a modern browser and play (Chrome or Edge recommended on a laptop, Chrome on Android).
- On a laptop or desktop, use the mouse and keyboard.
- On a phone or tablet, hold it sideways and play by touch. The first tap puts the game in full screen and turns it sideways (Android Chrome). On an iPhone, Safari can't hide its bars, but Add to Home Screen opens the game full screen. If you hold the phone upright, the game asks you to turn it.
- The interface is sized for every screen: a browser check measures text size and fit on five laptop sizes, two phones and a tablet.
Play as a guest, or register to keep your progress
- PLAY AS GUEST starts straight away, with no account. A guest game is not saved: a reload starts again at Level 1, Stage 1, and guests are not on the leaderboard.
- To track your progress, register with just a username and a password (6 or more characters). There is no email and no personal data. Your level, your stage, your treasures and your best times are saved online, so you can sign in from any device, a laptop or a phone, and carry on where you left off.
- At sign-up the game shows a one-time recovery code. If you forget your password, FORGOT PASSWORD sets a new one with your username and that code.
- A guest can choose SAVE MY PROGRESS at any time to turn the guest game into an account, with everything won so far.
- Registered players appear on the shared LEADERBOARD, ranked by levels cleared, then by the total of each level's best time, then by deaths.
- Passwords are never stored, only a salted hash. A wrong name and a wrong password get the same answer, and repeated wrong tries lock the account for a few minutes. In the sign-in box, a wrong password shakes it with a thud; the second wrong try shakes it and closes it.
The journey
- The entry screen. A ghost bride holds up a board: CLICK ANYWHERE TO ENTER. That one tap unlocks sound for the whole visit (browsers keep pages silent until you tap).
- The title card. THE CURSED HOUSE types itself one letter at a time in dripping blood, each letter struck by a real typewriter key, over a painted graveyard under a blood moon. A hand claws up out of a grave to the sound of digging dirt, a witch on her broom crosses the sky and back, bats wheel round the moon, and lightning strikes with the thunder on the last letter.
- The bungalow at night. A painted scene brought to life: storm clouds rolling across the full moon, rain, ground fog, bats, lightning lit by a real thunder recording, distant wolf howls, an upstairs window where a figure appears, flickering jack-o'-lanterns, and a black cat whose eyes blink. Arjun stands on the path in his fedora and long coat, holding a lantern.
- ENTER THE BUNGALOW. The camera pushes in while Arjun walks up the path. The door creaks open in step with the recording, a pumpkin's flame dies as he passes and catches again, and he steps inside. The doors slam behind him, a voice whispers "Welcome back… I've waited", and a witch laughs while the lights stutter.
- The rooms. The first stage's title bleeds onto the screen, and the house asks its first question.
Three rooms, fifteen riddles
Each level is one room with five stages, and each level awards a treasure:
- Level 1, the Grand Hall (the Collector's Gold Watch): portraits that blink only while you look away, a stopped clock and the candles still burning, letters scratched round the hall, two portraits that swap places in the dark, and a page of the journal circled in blood.
- Level 2, the Library of Whispers (the Raven Codex): red books to count, a word written backwards in the dust on a mirror, a whispering book, books that fall in the dark, and a cabinet opened by four signs in the right order.
- Level 3, the Crypt Beneath (the Heart of the House): brass plates with dates of birth and death, a bell to count, upside-down letters glowing in the wet floor, the order of the dead, and a sealed door.
A fourth level, the Attic, is coming.
How a stage works
- The house asks one question in plain English. It stays on screen until the stage ends (on a phone it folds to one line).
- The answer is hidden in the room. Look around, click or tap portraits and objects to inspect them, read the journal, and carry the candle into dark corners: its light follows the mouse or your finger.
- Some clues are heard: a bell rings, a book falls, a candle is snuffed, a whisper names a book. Every one of them is also written on screen at the same moment.
- Every stage has a few traps: clues that look right but give a wrong answer, such as a reflected flame or an echo of the bell.
- You have 3 minutes. In the last 30 seconds a heartbeat starts.
- You have one chance. You can open the answer panel, look at your answer and step back to the room. Once you press YES, there is no going back.
- Every attempt is different: a random seed picks the hidden values, so memorising answers doesn't help.
- On a first visit, Grandfather's ghost points out the candle and the ANSWER button. Stages where tiny letters hide round the hall offer a one-time hint showing every place to look.
Winning and losing
- A right answer: the lights blink three times, and the next stage is asked in the same room, with no page change. Stage 5 wins the room's treasure, and the treasure card leads straight into the next room.
- A wrong answer, or running out of time: the witch drops in front of Arjun, he screams, the screen goes black, out of the dark she has him, and the glass shatters across the screen, spattered with blood. GAME OVER then shows the right answer and why, with a tip. A death restarts the level from its Stage 1; levels already cleared stay cleared.
Sound
- Every sound is a real recording: thunder, wolves, a creaking door, a church bell, a typewriter, a witch's laugh.
- Picture and sound are driven by the same audio clock: the lightning is lit by the loudness of the thunder, the door opens with the energy of its creak, and the witch's drop lands on her laugh.
- Music plays quietly under every stage. It dips under every clue and goes silent before the witch's laugh, so it never covers anything you need to hear. A music switch at the bottom left turns it off without touching any other sound.
- Every click on something that does something strikes one typewriter key.
Controls
- Desktop: click or
Eto inspect,Cto carry the candle,Ato answer,Jfor the journal,Escto step back. - Phone or tablet: tap to inspect, tap the candle and drag to carry it, and tap ANSWER.
What makes it different
- Fair by proof. A solver that reads only what the room shows (never the stored answer) proves, over 1,000 seeds for each of the 15 riddles, that there is exactly one answer, and that taking away any single clue breaks it. That is 15,000 generated riddles checked on every test run.
- Nothing hidden behind sound or darkness. Every heard clue is also shown, and the candle lights every dark corner.
- Accessible. Subtitles for every clue sound, full keyboard controls, touch controls on phones, the operating system's "reduce motion" setting respected, and the music can be turned off.
- Paintings brought to life. Each scene is one painting animated in a shader (drifting storm clouds, steady candlelight, fog), with a 3D Arjun placed into it, and portraits that blink only when you look away.
How I built it
The whole game was built in the Kiro IDE, from a one-page plan and my feedback, one request at a time. I supplied the paintings (generated with ChatGPT), played every build and said what was wrong. Kiro's agent wrote the code, ran the checks, and drove a real browser to prove its own work before reporting.
- Specs decided each feature before any code: six specs, each with requirements, a design (including the correctness properties the tests must prove) and tasks. When I changed my mind, the spec changed first, and the code and tests followed.
- Steering turned my feedback into standing rules, so nothing had to be said twice: realism over cartoon shapes, sound in sync with the picture, fair puzzles, plain English, and firelight that never "waves".
- Agent hooks type-check every save, make sure every new asset gets a licence credit, guard edits to the scene and shader files, and build the game after every finished spec task.
- A custom agent audits every asset's licence before a submission.
- MCP servers gave the agent the AWS documentation while planning the deployment, and a Playwright browser it can drive.
- Tests: 182 Vitest tests, including fast-check property tests and the 15,000-riddle seed sweep, plus 17 Playwright browser checks. The browser checks capture frames at exact moments (0.02 s after a thunder clap, the frame the witch hits the glass) and log the audio clock next to the visual values. They also cover phones: full screen, touch, a slowed-down CPU, and sound under the browser's real autoplay rule.
Stack: React 19, TypeScript and Vite; plain Three.js with GLSL shaders for the painted scenes and the 3D Arjun; the Web Audio API for all sound. Accounts and the leaderboard run on AWS: an API Gateway HTTP API, one Lambda function and one DynamoDB table, with the site hosted on Amplify.
Challenges I ran into
- "It looks cartoon." My first scenes were built from 3D shapes, and I rejected them again and again. The fix was to animate painted scenes in shaders instead, and to put one shared 3D Arjun into each painting.
- Lamplight that waved. Moving noise on the lights looked like water. Now every flame is one light level that flickers as a whole.
- Keeping sound and picture in sync. Timers drift; the audio clock does not. Every scare is now scheduled on the audio clock, and the browser checks log both side by side to prove they agree.
- A door recording full of knocks. Kiro measured the recording's loudness, found the knocks, and cut them out when the clip loads.
- Phones. Phones went silent because browsers block sound until a tap, and the usual checks switch that rule off. A check under the real rule caught it, and one tap now gives sound all the way into the hall. The title card also froze for 4.4 s on a slowed phone; that work is now done in advance and baked into images.
Accomplishments that I'm proud of
- Fifteen riddles that are provably fair, checked on every test run.
- A property-based test that caught a real bug the example tests missed: a save whose death count was
Infinity. - One continuous world: every scene change is a cinematic transition, and Arjun always looks the same.
- It plays the same on a laptop and on a phone.
- Every image and sound is licensed and credited, with an automatic audit.
What I learned
Spec-driven development kept a large creative project coherent. Writing the requirements and correctness properties first made changes of mind cheap: update the spec, and the code and tests follow. Steering was the biggest surprise: each piece of feedback had to be given only once. And for a game that depends on how it looks and sounds, a test that only checks the code isn't enough: the agent had to see the frames and measure the sound.
What's next for The Cursed House
More levels and stages (the Attic is next), more riddle types, and more rooms of the house to explore.
Built With
- amazon-api-gateway
- amazon-dynamodb
- aws-amplify
- aws-cloudformation
- aws-lambda
- css3
- fast-check
- glsl
- html5
- kiro
- node.js
- playwright
- react
- three.js
- typescript
- vite
- vitest
- web-audio-api
- webgl