I am going to explore the project structure to see existing files and setup before building our 3D Horror Game.
I am going to check the package.json file to see what libraries are installed so we can plan our 3D Horror game dependencies.
I will now install three, @types/three, and lucide-react to give our 3D Horror game realistic 3D graphics, collision mechanics, lighting, audio effects, and rich HUD interface icons.
I am going to generate a cinematic horror background image for our title screen and main narrative menu using AI image generation.
I am going to generate a horror creature concept art image for the monster anomaly "The Weeping Stalkers" and visual insanity hallucinations in our game.
I am going to generate an immersive, realistic old handwritten asylum diary page image to enhance the story exploration and document reader features.
I am going to update index.html to give our website an appropriate horror game title, custom meta description, and ensure fonts and styling look dark and atmospheric.
I will now check src/index.css to see the current Tailwind setup and base styles.
I am going to update src/index.css to define our custom horror font families (Creepster, Special Elite, JetBrains Mono), animated horror scanlines, analog monitor vignette, heartbeat ECG pulse animation, and cinematic shadow effects.
I will now create src/types/game.ts to define TypeScript interfaces and types for game states, items, puzzle mechanics, monster AI, sanity stats, story documents, and player settings.
I will now create src/services/soundEngine.ts to implement a procedural Web Audio API Synthesizer that generates realistic horror ambiance, jumpscares, heartbeats, flashlight clicks, footsteps, door locks, and radio static without requiring external sound files.
I am going to create src/data/storyData.ts containing our story chapters, interactive lore documents, audio tape frequency transcripts, objectives, keypad passcodes, items, and ending descriptions.
I am going to create src/components/TitleScreen.tsx, providing a horror-themed interactive title screen with chapter chapter selection, difficulty toggles (Narrative Explorer vs Survival vs Nightmare), tutorial instructions, and lore codex navigation.
I am going to create src/components/HUD.tsx, which implements our game's Heads-Up Display with real-time health & sanity monitors, flashlight battery gauges, inventory hotbar, radio tuner modal, interaction crosshair, and optional virtual touch controls.
I am going to fix the minor TypeScript lint warnings in src/components/HUD.tsx by removing unused imports and utilizing onInteract when clicking the active target banner.
I will now wire up the onInteract prop to the central target tooltip button and remove the unused array index i in src/components/HUD.tsx.
I will now remove the unused parameter i in the inventory.map statement in src/components/HUD.tsx.
I will now wire up onInteract so players can directly click the interaction prompt box in src/components/HUD.tsx.
I am going to create src/components/DocumentReader.tsx to provide an interactive examination menu for recovered hospital journals, autopsy reports, and audio tape broadcasts with simulated subtitle playback.
I am going to create src/components/KeypadModal.tsx to handle electronic digital door keypads (such as entering "4902" for Elena's lab) and the electrical fuse breaker box repair puzzle in Act I.
I am going to remove the unused icon imports in src/components/KeypadModal.tsx.
I am going to create src/components/SecurityMonitors.tsx to implement our CCTV Surveillance terminal system where players can switch camera feeds to track monster anomaly movements and unseal doors.
I am going to create src/components/LoreCodex.tsx to provide an exploration codex where players read comprehensive lore profiles on characters, asylum secrets, and monstrous entities.
I will now remove the unused LoreDossier import in src/components/LoreCodex.tsx to fix the type warning.
I am going to create src/components/EndingScreen.tsx to showcase the cinematic ending narrative, player sanity statistics, celebratory confetti for winning endings, and replay options.
I will now create src/components/GameCanvas3D.tsx, implementing our custom Three.js 3D first-person game engine featuring collision detection, dynamic flashlight beam physics, level geometry for all story acts, item pickup rays, locker hiding spots, and the wandering monster AI behavior.
I will now update the destructured props for GameCanvas3D in src/components/GameCanvas3D.tsx to include monster and solve the type error.
I am now going to remove the unused objectives and inventory parameters in src/components/GameCanvas3D.tsx.
I am going to rewrite src/App.tsx to act as our central game supervisor, coordinating screen navigation, 3D world states, modals, inventory items, audio synthesis triggers, and story endings.
I am going to update src/services/soundEngine.ts to add a public stopAmbientDrone() method to silence background synth loops during post-game ending fanfares.
I will now edit src/App.tsx to remove unused imports and supply objectives and inventory props to <GameCanvas3D />.
I will now provide the objectives and inventory props to <GameCanvas3D> inside src/App.tsx.
I am now going to build the project using build_project to ensure all TypeScript interfaces, Three.js level geometry, audio synthesizer code, and custom React components compile without any issues.
I have designed and implemented "ECHOES OF WARD 4: The Hollow Asylum", an interactive 3D First-Person Psychological Horror Game with a captivating storyline using React, TypeScript, Tailwind CSS, Three.js, and an offline Web Audio API synthesizer engine.
🏛️ What I Built:
-
The Storyline of Blackwood Manor Asylum:
- The Mystery: You play as investigative journalist Morgan Vance entering Ward 4 at midnight to discover what really happened to your missing sibling, Dr. Elena Vance, during her classified studies on neural frequency therapy (Project Neural Sleep).
- Three Progressive Narrative Acts:
- Act I: The Shadows Wake — Infiltrate the main lobby reception, search abandoned psychiatric wings for flashlight spare batteries, and locate 3 high-voltage Electrical Fuses to repair the auxiliary power generator.
- Act II: Resonance of the Dead — With auxiliary power restored, access the sealed Observation Morgue and check the CCTV Surveillance Console. Use your experimental Radio Frequency Scanner tuned to 94.2 MHz and 104.5 MHz to decipher Elena's disembodied audio transmissions and crack the 4-digit passcode (
4902) to her laboratory.
- Act III: Heart of the Abyss — Retrieve Elena's Core Keycard and descend into the underground Resonance Cyclotron to decide how the story ends!
-
Full 3D First-Person Navigation & Gameplay Mechanics (GameCanvas3D & Three.js):
- Pointer Lock Controls & Touch Navigation: Smooth WASD + Mouse look navigation, plus on-screen clickable arrow controls for tablets or non-keyboard gameplay.
- Level Architecture & Collision Engine: Solid wall and door collision checks across multiple wards, consulting rooms, pharmacies, morgues, and underground basements with dynamic lighting and fog (
THREE.FogExp2).
- Flashlight & Battery Resource Management: Your flashlight Spotlight reveals dark items and pathways, but slowly drains batteries. Turning it off enables night-stealth to bypass roaming creatures.
- Sanity & Heart Rate Mechanics: An animated ECG waveform monitor tracks your sanity. Remaining in total darkness or encountering entities triggers visual glitched hallucinations, blood vignettes, and heartbeat spikes. Consume Nerve Pills scattered in cabinets to restore sanity.
-
Monster AI Engine ("The Weeping Wraith"):
- An acoustic phantom composed of shadowy smoke and hollow glowing white ocular reflectors that actively patrols the wards.
- Audio & Glare Sensitivity: Sprinting generates footsteps that attract the entity; shining your flashlight directly at it accelerates pursuit mode.
- Locker Hiding Spots: Players can take refuge inside tall Iron Medical Lockers scattered in corridors to break line of sight and wait for the creature to resume patrolling.
Files built: index.html, src/index.css, src/types/game.ts, src/services/soundEngine.ts, src/data/storyData.ts, src/components/TitleScreen.tsx, src/components/HUD.tsx, src/components/DocumentReader.tsx, src/components/KeypadModal.tsx, src/components/SecurityMonitors.tsx, src/components/LoreCodex.tsx, src/components/EndingScreen.tsx, src/components/GameCanvas3D.tsx, src/App.tsx