KAUSHIK SARKARBlogs
Game Prompts

Flesh, Blood, & Concrete: Crafting Atmospheric Horror in HTML5 Canvas

By Kaushik Sarkar · · 9 min read
Hero screenshot of the finished Flesh, Blood, & Concrete

This tutorial shows how to build a horror exploration RPG inspired by a game found on itch.io. Using AI coding tools such as ChatGPT, Claude, Gemini, Cursor, Lovable, and Bolt, you'll follow the full prompt to create an immersive browser-based experience. The resulting game will include player movement, dynamic lighting, inventory systems, save/load functionality, and day/night cycles. You can run it locally and deploy it for free using GitHub Pages or Netlify.

What you need

  • A modern web browser
  • Access to an AI coding tool (ChatGPT, Claude, Gemini, etc.)
  • Text editor like VS Code or Sublime Text
  • Basic understanding of HTML, CSS, and JavaScript
  • A copy of the full prompt from this page
  • Optional: Audio editing software for sound design

The full prompt

Build The Forgotten Apartments - A Browser Horror Exploration RPG

Tech stack: HTML5 Canvas with JavaScript, no build tools required

- Player character movement with WASD or arrow keys and mouse look for camera control
- 30 unique apartment levels with different layouts, puzzles, and horror elements
- Dynamic lighting system with flickering lights and shadows that create atmosphere
- Inventory system with collectible items, notes, and tools to solve environmental puzzles
- Non-player characters that react to player actions with dialogue trees and scripted events
- Health and sanity meters that decrease during terrifying encounters and exploration
- Atmospheric sound design with ambient noise, footsteps, and sudden horror sounds
- Save/load system that preserves player progress and discovered secrets between sessions
- Interactive environment elements like broken windows, locked doors, and hidden compartments
- Day/night cycle affecting visibility and enemy behavior patterns
- Multiple endings based on player choices and collected items
- Room transition animations with screen wipes and camera effects
- Particle effects for blood splatters, smoke, and environmental debris
- Dark color palette with deep blues, grays, and occasional red accents

Visual design uses a monochromatic dark theme with strategic red highlights for danger warnings. Typography features rough, cracked fonts for text elements. Layout prioritizes immersion with minimal UI overlays. Animations include subtle character breathing, flickering lights, and door creaking sounds.

Controls: WASD or arrow keys for movement, mouse for camera rotation, spacebar to interact, E to open inventory, F to use items, R to restart level

Data handling: LocalStorage for save games, JSON objects for level data, state management for player stats and inventory

Responsive requirements: Adapts to different screen sizes with scalable canvas and touch controls for mobile

Accessibility: High contrast mode toggle, keyboard navigation support, audio descriptions available

Output should be a single index.html file containing all HTML, CSS, and JavaScript. Run by opening the file directly in any modern browser. No external dependencies or build steps required.

1Choose Your AI Tool and Paste the Prompt

Start by selecting one of the supported AI tools: ChatGPT, Claude, Gemini, Cursor, Lovable, or Bolt. Paste the full prompt above into the AI interface. Ensure you're using a version that supports full HTML/CSS/JS outputs without external dependencies. The prompt specifies an HTML5 Canvas game with no build steps required. Keep the output in one single index.html file for easy local testing.

  • Open your chosen AI tool
  • Paste the entire prompt exactly as it appears on this page
  • Confirm that the output is a complete index.html file with all code inside
AI coding assistant generating the Flesh, Blood, & Concrete code
AI coding assistant generating the Flesh, Blood, & Concrete code

Pro tip: Always check for errors in generated code before proceeding to save time later.

2Run the Generated Code Locally

Save the output from your AI tool as index.html in a local folder. Open it directly in any modern browser like Chrome, Firefox, or Edge. The game should load with basic visuals and controls. If nothing appears, check for syntax errors in JavaScript or missing HTML elements. Make sure all variables are initialized properly and there are no typos in canvas drawing commands.

  • Save the file locally
  • Open index.html directly in your browser
  • Look for console errors in developer tools (F12)
  • Check that the canvas element is visible

Pro tip: Use browser dev tools to inspect HTML and debug JavaScript logic.

3Test Core Game Features

Once loaded, test key gameplay features mentioned in the prompt. Try moving with WASD or arrow keys, rotating camera with mouse, interacting with objects using spacebar, opening inventory with E, and restarting with R. Check that lighting flickers, particles appear during events, and save/load works. Ensure sanity and health meters decrease appropriately during horror encounters.

  • Move character around the level
  • Rotate camera with mouse movement
  • Interact with environment elements
  • Save and reload progress
  • Observe visual effects like flickering lights
Flesh, Blood, & Concrete main gameplay view with HUD
Flesh, Blood, & Concrete main gameplay view with HUD

Pro tip: If some features don't work, go back to AI and ask for specific fixes.

4Refine Movement and Controls

Verify player movement and camera rotation work smoothly. Adjust sensitivity or key bindings if needed. If the character feels sluggish or controls are unresponsive, inspect keyboard event listeners in JavaScript. The prompt requires WASD or arrow keys for movement and mouse look for camera control. Ensure both desktop and mobile touch support are considered.

  • Test all movement directions (WASD/arrow keys)
  • Adjust camera sensitivity if necessary
  • Make sure interaction keys work properly
  • Add touch controls for mobile if needed

Pro tip: Use requestAnimationFrame for smoother movement than setInterval.

5Implement Lighting and Particle Effects

The prompt includes dynamic lighting with flickering effects and particle systems. Look for code handling shadows, light sources, and visual particles like blood splatters or smoke. These are crucial for atmosphere but may require additional rendering logic. Use HTML5 Canvas methods to draw lighting overlays and create pseudo-3D effects.

  • Locate canvas-based lighting code
  • Add flickering effect to lights
  • Implement particle system for environmental debris
  • Adjust color palette to match dark theme

Pro tip: Limit particle count to maintain performance on low-end devices.

6Fix Bugs and Add Missing Systems

If the inventory or save/load systems don't function, refine your prompt with follow-up queries. Ask AI to generate code for missing features like item collection, dialogue trees, or sanity meter logic. Also ensure level transitions are smooth and NPC behavior is scripted correctly. You might need several revisions to get everything working.

  • Identify broken systems (inventory, save/load)
  • Ask AI to regenerate specific sections
  • Fix dialogue tree and event triggers
  • Add proper level transition animations

Pro tip: Break down complex features into smaller prompts for better results.

7Add Puzzle Mechanics and Dialogue

The prompt calls for environmental puzzles, NPC interactions, and dialogue trees. Implement locked doors that require keys or notes, hidden compartments that open with tools, and NPCs who react to player actions. These systems often involve state management and conditional logic in JavaScript.

  • Create interactive puzzles (locked doors, hidden items)
  • Script NPC reactions and conversations
  • Add logic for item usage and note collection
  • Ensure puzzles provide meaningful progress

Pro tip: Use JSON objects to store dialogue trees and puzzle states.

8Deploy Free Using GitHub Pages or Netlify

Once your game is stable, deploy it for others to play. Upload index.html to a public GitHub repository and enable GitHub Pages in settings. Alternatively, drag and drop the file into Netlify or Vercel dashboards. Both platforms support single-file deployments without build steps.

  • Push code to a GitHub repo
  • Enable GitHub Pages in repo settings
  • Or upload to Netlify/Vercel directly
  • Share the public URL with friends

Pro tip: GitHub Pages is free and perfect for hosting small games like this.

9Customize Game Assets and Levels

To make your game unique, customize level layouts, change item names, adjust dialogue text, and tweak visual themes. Replace placeholder images with your own if desired, or modify the color scheme to match a different horror setting. The core mechanics remain the same but personalization makes it yours.

  • Modify apartment layouts per level
  • Change inventory items and note texts
  • Adjust color tones to fit theme
  • Add custom sound effects where possible

Pro tip: Use consistent naming conventions for all game elements.

10Optimize Performance and Accessibility

Check performance by testing on lower-end devices or simulating slower hardware. Ensure the canvas renders efficiently and uses minimal memory. Add accessibility features like keyboard navigation toggle, high contrast mode, and audio descriptions as specified in the prompt. These improve usability for a wider audience.

  • Test game speed across devices
  • Optimize rendering loops
  • Add keyboard-only controls
  • Implement accessibility options

Pro tip: Use performance profiling tools to find bottlenecks early.

11Share and Iterate on Your Creation

After deployment, gather feedback from players and iterate on your game. Add more levels, improve dialogue, or enhance visual effects based on user suggestions. The prompt gives a strong foundation; personal touches can make it stand out. Consider adding multiple endings or collecting secrets for replayability.

  • Gather player feedback
  • Improve visuals and audio
  • Add new puzzles or story elements
  • Plan future updates or expansions

Pro tip: Encourage early adopters to share their progress on social media.

Adapt it to your own brand

  • Use different color schemes to match various horror genres like gothic, sci-fi, or psychological
  • Swap out apartment layouts for themed environments like offices, hospitals, or haunted mansions
  • Modify the inventory system to include unique items that affect story outcomes
  • Change the dialogue trees to reflect different character personalities or languages
  • Adjust sanity and health mechanics to fit different difficulty levels
  • Introduce new control schemes for mobile users or accessibility preferences
  • Add custom sound effects or ambient tracks to enhance mood and immersion

Common mistakes and fixes

  • Forgetting to initialize all variables before use, leading to runtime errors
  • Not testing on multiple browsers which can cause inconsistent rendering or behavior
  • Skipping the save/load system, making progress unrecoverable
  • Overcomplicating particle effects without considering performance impact
  • Ignoring keyboard and mouse control conflicts during interaction events
  • Using outdated Canvas APIs that don't work in newer browsers

Frequently asked questions

Do I need any build tools to run this game?

No. The full prompt specifies no external dependencies or build steps. Just open index.html directly in a browser.

Which AI tools work best for generating this kind of code?

ChatGPT, Claude, Gemini, Cursor, Lovable, and Bolt all support full HTML/CSS/JS outputs and are suitable for this project.

How do I fix issues with lighting or particle effects?

Re-paste the AI prompt with specific requests to improve those sections. Focus on canvas rendering logic for lighting and particle animation.

Can I deploy this game for free?

Yes, GitHub Pages, Netlify, and Vercel all support single-file deployments without build steps.

Final thoughts

You've now built a horror exploration RPG inspired by a popular indie game using AI tools. By following the step-by-step guide, you've created an immersive experience with dynamic lighting, puzzles, and save/load systems. Copy the prompt above and experiment with your own theme or setting to build something truly unique.

Originally published on PromptGrabber.com — find thousands more AI prompts there.