/memory-game

Primary LanguageTypeScriptMIT LicenseMIT

3D Memory Game

A classic memory matching game reimagined in 3D using Three.js and React. Test your memory while enjoying an immersive, atmospheric experience.

Game Screenshot Placeholder

Features ⭐️

  • 3D card matching gameplay
  • Atmospheric environment with custom skybox
  • Animated card flips and transitions
  • Score tracking and game state management
  • Custom AI-generated card designs

Game Session

Live Demo 📸

Try it out: Demo Link

Built With 🛠️

Getting Started ⚡️

Prerequisites

  • Node.js (v16 or higher recommended)
  • npm or yarn

Installation

  1. Clone the repository
git clone https://github.com/yourusername/3d-memory-game.git
  1. Install dependencies
npm install
  1. Start the development server
npm run dev

Current Status

Working Features ✅

  • Full 3D environment with custom lighting and shadows
  • Card matching mechanics
  • Score tracking
  • Atmospheric skybox (optimized JPEG version)
  • Desktop browser compatibility
  • Smoke shader

Known Issues ⚠️

  • Performance optimization needed for weaker devices

Roadmap 🛣️

  1. Mobile Support

    • Optimize asset loading for mobile devices
  2. Performance Optimization

    • Implement asset compression
    • Add progressive loading
    • Optimize render cycles
  3. Environment Enhancement

    • Explore HDR skybox implementation
    • Add ambient sound effects
    • Implement particle effects

Assets and Attribution 🎨

Game Session

Models

Graphics

Implementation Notes 📝

Technical Challenges

  • Implementing proper loading states with Suspense
  • Managing texture flips during animations
  • Optimizing skybox file size while maintaining quality
  • Handling mobile device performance

Solutions Implemented

  • Custom asset loader for better resource management
  • Debounced loading screen updates
  • Optimized texture loading sequence
  • Memoized component renders

Acknowledgments

Inspiration

  1. GFG: Flip Card Game Tutorial
  2. Memory Game Implementation
  3. R3F Multiplayer Card Game

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Feedback 🤝

This project was built as a learning exercise in React Three Fiber and 3D web development. If you have any suggestions, tips, or feedback about performance, code quality, or user experience, I'd love to hear them! Feel free to:

  • Open an issue to discuss potential improvements
  • Share your thoughts on mobile performance
  • Suggest better ways to handle asset loading
  • Point out bugs or problems you encounter

Your insights will help me learn and improve!

Models from poly.pizza and Pmnd.rs Market Small Table by Quaternius CC0 Candle by Kay Lousberg CC0 Skybox generated using BlockadeLabs Matcaps Images were generated with AI On Canva. HDRI conversiont to cube map from matheowis Base for candle smoke Perlin Noise Maker

Resources and Inspiration:

  1. https://www.geeksforgeeks.org/build-a-flip-the-card-match-done-game-using-react/
  2. https://codesandbox.io/p/sandbox/memory-game-using-react-uyv1d?file=%2Fsrc%2Fcomponents%2FGame.js%3A44%2C14-45%2C6
  3. https://www.geeksforgeeks.org/memory-game-from-scratch-using-react/
  4. https://javascript.plainenglish.io/building-a-card-memory-game-in-react-e6400b226b8f
  5. https://dev.to/shubhamreacts/build-a-card-memory-game-with-react-23dj
  6. https://github.com/wass08/r3f-multiplayer-pirate-card-game