A two-player memory card matching game built with React 19, TypeScript, and Vite. Test your memory by flipping cards and finding matching pairs!
- Two-player mode β Compete with a friend, taking turns to find matching pairs
- Score tracking β Keep track of each player's matched pairs
- Smooth animations β Card flip animations powered by Motion
- 24 unique emoji cards β 48 cards total (24 pairs) for a challenging game
- Turn indicator β Visual indicator showing whose turn it is
- Reset game β Start a new game anytime with the reset button
- Node.js v18 or higher
- npm, yarn, or pnpm
Clone the repository and install dependencies:
git clone <repository-url>
cd memory-card
npm installStart the development server:
npm run devOpen your browser and navigate to http://localhost:5173 to play the game.
npm run buildThe built files will be in the dist folder, ready for deployment.
- Player 1 starts β Click any card to flip it
- Flip a second card β Try to find a matching emoji
- Match found? β The current player scores a point and gets another turn
- No match? β Cards flip back and it's the other player's turn
- Game ends β When all pairs are found, the player with the most matches wins!
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| TypeScript | Type safety |
| Vite | Build tool & dev server |
| Motion | Animations |
| ESLint | Code linting |
src/
βββ components/
β βββ Card.tsx # Individual card with flip animation
β βββ CardContainer.tsx # Game board grid with card logic
β βββ PlayerInformation.tsx # Score display and turn indicator
βββ hooks/
β βββ useGamePlay.ts # Game state management hook
βββ lib/
β βββ data.ts # Card data and shuffle logic
β βββ type.ts # TypeScript type definitions
βββ App.tsx # Main application component
βββ main.tsx # Application entry point