Haunt Sweet Home! – a dollhouse ghost-haunting game in three.js (~230 KB, mobile)

Hi everyone! Just in time for Halloween, I made a small game where you play a bedsheet ghost and scare a family out of their house before dawn.

:play_button: Play (free, desktop and mobile): Haunt Sweet Home! – Play free online | Glowbit Games

The house is a cut-away dollhouse, so you can see every room at once. Tap a glowing icon to fly over and haunt that object: the TV fills with static, the fridge slams, the piano plays itself, the mirror writes GET OUT. Fill each resident’s fear bar and they run out screaming. Scaring people while they are together gives group scares and combos, and people who flee in panic scare everyone they run past.

Some technical bits

  • Render-free simulation: the house layout (rooms, doors, stairs, an attic ladder, activity spots) and the night simulation (routines, sleep, fear and fatigue, panic spreading, pets, ghost hunters, powers, scoring) are plain TypeScript with no three.js. That let me write unit tests and run a headless bot that plays every night in Node. The star goals come from those runs.
  • Per-room lighting: each room shares one set of uniforms (warm self-light, a multiplier for blackouts and frost, a flash for lightning and scares) injected into MeshStandardMaterial with onBeforeCompile. A power like “Lights Out” darkens one room, the cold spot tints it blue, and possessed objects get a green rim glow.
  • Procedural furniture: all 34 haunted objects and the room decor are built from primitives at load. Static decor is merged per room, and haunted objects stay as small animated groups.
  • Residents are instanced cartoon people with a few poses (walk, sleep, cower, run). Ghost hunters carry additive cone meshes as flashlights; if the beam stays on the ghost, it gets zapped.
  • Look: moonlit night with a cool directional light, warm window glow, fog, lightning flashes, bats, and postprocessing bloom, vignette and tone mapping. Portrait phones get a closer camera that follows the ghost.
  • No assets: everything is generated, including the sound. Web Audio makes the creaks, slams, flushes and cartoon screams (sawtooth voices through formant filters), plus a generative theremin tune for each house. The whole game is about 230 KB gzipped.

Stack: three.js r186, TypeScript, Vite, postprocessing.

Happy Halloween, and I’d love to hear how it runs on your devices!