Skip to content

Alena0490/Escape-room

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

92 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Escape Room Game

An immersive React-based escape room game featuring atmospheric audio, interactive puzzles, and a mysterious storyline. Navigate through a dark room using clues and solving riddles to find your way out.

โœจ Features

  • 360ยฐ Room Navigation - Turn left/right to explore different walls
  • Atmospheric Audio System - Dynamic ambient sounds and random horror effects
  • Interactive Puzzles - Click on objects to gather clues and solve riddles
  • Progressive Gameplay - Light/dark mechanics affect audio and atmosphere
  • Mobile-Friendly - Touch controls, vibration feedback, and responsive design
  • Accessibility - Screen reader support and keyboard navigation
  • Game Statistics - Track completion time, hints used, and easter eggs found

๐Ÿ–ผ๏ธ Mockups & Screenshots

  • Overview / Start
    Start screen

  • Game
    Game

  • UI Fragments
    Win screen


๐ŸŽง Audio System

The game features a sophisticated audio system with multiple layers:

Ambient Audio

  • Plays automatically when lights are turned off (after first interaction)
  • Stops immediately when lights are turned on
  • Respects mute settings

Random Spooky Sounds

  • Different probability based on lighting:
    • Lights ON: 65% chance every 30 seconds
    • Lights OFF: 20% chance every 30 seconds
  • Includes various horror effects (voices, steps, laughter, etc.)

Interactive Sounds

  • Switch clicking sounds (preloaded for immediate response)
  • Item interaction feedback
  • Door and lock sounds
  • Sequence-based audio for complex interactions

Mute Functionality

  • Global mute toggle (M key or button)
  • Preserves user preference in localStorage
  • Stops all audio types when enabled

๐ŸŽฎ Game Mechanics

Light System

  • Dark Room: Enhanced ambient audio, fewer random sounds
  • Lit Room: No ambient audio, more frequent random sounds
  • Flickering effect when switching lights

Puzzle Elements

  • OUIJA Board: Provides cryptic instructions and riddles
  • Code Lock: 6-digit combination required to escape
  • Collectible Clues: Hidden throughout room objects
  • Easter Eggs: 7 hidden secrets for bonus points

Navigation

  • Mouse/Touch: Drag to look around with tilt effects
  • Keyboard: Arrow keys for turning, M for mute
  • Mobile: Swipe gestures and haptic feedback

๐Ÿงฑ Technical Implementation

Architecture

src/
โ”œโ”€โ”€ components/           # Main game components
โ”‚   โ”œโ”€โ”€ Room.js          # Main game container
โ”‚   โ”œโ”€โ”€ Room.css         # Room styling
โ”‚   โ”œโ”€โ”€ AudioController.js # Audio management
โ”‚   โ”œโ”€โ”€ CodeLock.js      # Final puzzle interface
โ”‚   โ”œโ”€โ”€ CodeLock.css     # Lock interface styling
โ”‚   โ”œโ”€โ”€ RoomNavigation.js # Control buttons
โ”‚   โ”œโ”€โ”€ RoomNavigation.css # Navigation styling
โ”‚   โ”œโ”€โ”€ WinScreen.js     # Ending screen
โ”‚   โ”œโ”€โ”€ WinScreen.css     # Ending screen styling
โ”‚   โ”œโ”€โ”€ StartScreen.js     # Start screen
โ”‚   โ”œโ”€โ”€ StartScreen.css     # Start screen styling
โ”‚   โ”œโ”€โ”€ GhostComponent.js # Ghost effects
โ”‚   โ”œโ”€โ”€ GhostComponent.css # Ghost styling
โ”‚   โ”œโ”€โ”€ Table.js         # Table with OUIJA
โ”‚   โ”œโ”€โ”€ Table.css         # Table styling
โ”‚   โ”œโ”€โ”€ Shelf.js         # Object shelf
โ”‚   โ”œโ”€โ”€ Shelf.css         # Shelf styling
โ”‚   โ””โ”€โ”€ Cardbox.js       # Cardboard box component
โ”‚   โ””โ”€โ”€ Cardbox.css       # Cardboard box component styling
โ”œโ”€โ”€ wall-components/     # Room wall elements
โ”‚   โ”œโ”€โ”€ BackWall.js      # Light switch, door, lock
โ”‚   โ”œโ”€โ”€ BackWall.css     # Wall styling
โ”‚   โ”œโ”€โ”€ LeftWall.js      # Shelf with objects
โ”‚   โ”œโ”€โ”€ LeftWall.css     # Left wall styling
โ”‚   โ”œโ”€โ”€ RightWall.js     # Mirror, poster
โ”‚   โ”œโ”€โ”€ RightWall.css    # Right wall styling
โ”‚   โ”œโ”€โ”€ FrontWall.js     # Painting
โ”‚   โ”œโ”€โ”€ FrontWall.css    # Front wall styling
โ”‚   โ”œโ”€โ”€ Floor.js         # Floor interactions
โ”‚   โ”œโ”€โ”€ Floor.css        # Floor styling
โ”‚   โ”œโ”€โ”€ Ceiling.js       # Ceiling lighting
โ”‚   โ””โ”€โ”€ Ceiling.css      # Ceiling styling
โ”œโ”€โ”€ hooks/
โ”‚   โ”œโ”€โ”€ useSetAudio.js   # Audio management hook
โ”‚   โ””โ”€โ”€ useTilt.js       # Mouse tilt effects
โ”œโ”€โ”€ sounds/              # Audio assets
โ””โ”€โ”€ img/                 # Visual assets and textures

Audio Performance Optimizations

  • Preloading: Critical sounds (switch) loaded immediately
  • Lazy Loading: Random sounds loaded on demand
  • Memory Management: Automatic cleanup of audio instances
  • Cache System: Reuse audio objects to reduce memory usage

State & Persistence

  • Progress and stats in localStorage.
  • Tracked: time, hints, searched items, easter eggs, total score.

๐Ÿ› ๏ธ Installation & Development

# Clone
git clone <repo-url>
cd escape-room

# Install
npm install

# Dev
npm start

# Production build
npm run build

### State Management

- Game state persisted in localStorage
- Statistics tracking (time, hints, items clicked)
- Progress preservation across sessions

## Controls

### Desktop

- **Mouse**: Look around, click objects
- **Arrow Keys**: Turn left/right
- **M Key**: Toggle mute
- **Click + Drag**: Tilt view for immersion

### Mobile

- **Touch**: Tap objects, swipe to turn
- **Vibration**: Haptic feedback on interactions
- **Responsive UI**: Optimized for touch devices

## Gameplay Tips

### Getting Started

- Turn on the lights to see all clues using the wall switch to begin exploring
- Click on objects throughout the room to gather clues
- Use the OUIJA board for cryptic instructions about solving puzzles
- Look for the paper with the key sequence in the cardboard box
- Find numerical clues hidden in various room objects
- Combine the numbers according to the OUIJA's and KEY's instructions
- Enter the final code in the door lock to escape

### Helpful Hints

- Explore all walls and objects thoroughly
- Pay attention to numbers and sequences mentioned in object descriptions
- The OUIJA board provides crucial instructions for combining clues
- References span literature, pop culture, science, and anatomy
- Look for connections to famous dates, songs, books, and scientific discoveries
- The hint system provides themed clues pointing to specific puzzle categories
- Some puzzles require knowledge of astronomy, biology, and cultural references
- Use the hint system if you get stuck (affects your final score)

## Installation & Development

### Prerequisites

- Node.js 16+
- React 18+
- Modern browser with audio support

### Setup

```bash

# Clone repository
git clone [repository-url]
cd escape-room

# Install dependencies
npm install

# Start development server
npm start

# Build for production
npm run build

Audio Assets

Ensure all audio files are properly placed in src/sounds/ directory. The game expects specific file formats and names for proper functionality.

๐ŸŒ Browser Compatibility

  • Chrome/Edge: Full support including vibration
  • Firefox: Full support
  • Safari: Full support with iOS touch optimizations
  • Mobile Browsers: Touch controls and responsive design

โšก Performance Considerations

  • Audio files are optimized for web delivery
  • Critical path audio is preloaded
  • Efficient state management prevents unnecessary re-renders
  • Memory cleanup prevents audio leaks

๐Ÿค Contributing

When modifying the audio system:

  1. Maintain mute functionality across all sound types
  2. Preserve original light switch behavior
  3. Test performance with multiple audio instances
  4. Ensure mobile compatibility

Built with React, featuring immersive audio design and responsive gameplay mechanics.

๐Ÿ“ฌ Contact

โœ‰๏ธ Email: mailto:alenapumprova@seznam.cz

๐Ÿ’ผ LinkedIn: linkedin.com/in/alena-pumprovรก

๐Ÿฑ GitHub: github.com/Alena0490 ๏ปฟ# Escape-room

About

Escape room game created in Rect, 3D room, sound effects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors