Sweet Swap Level-Based Game

Sweet Swap is a multi-level match-3 puzzle game built in React. The user progresses through levels by reaching score targets within a limited number of moves. Each level has its own difficulty, board size, and score requirement. When a level is completed, a confetti animation runs for five seconds, after which the next level automatically loads. The dashboard tracks unlocked levels and best scores.

Sweet Swap Level-Based Game
Sweet Swap Level-Based Game
Sweet Swap Level-Based Game
Sweet Swap Level-Based Game
Sweet Swap Level-Based Game
  1. Level-based progression with increasing difficulty.
  2. Match-3 game logic including swapping, matching, cascading, and gravity refill.
  3. Dashboard with level cards, best scores, and unlock tracking.
  4. Five-second confetti animation on level completion.
  5. Automatic transition to the next level after confetti ends.
  6. Back button that immediately stops confetti and returns to the dashboard.
  7. LocalStorage support for unlocked levels and best scores.
  8. Restart button to reset the current level instantly.
  9. Responsive and clean UI built without external CSS frameworks.
  1. The user selects a level from the dashboard.
  2. A dynamic candy grid is generated based on the level.
  3. The user swaps adjacent candies to make matches.
  4. Matches are cleared, gravity pulls candies down, and new candies fill the grid.
  5. Each match increases the score while moves decrease.
  6. If the score reaches the target, confetti plays for five seconds.
  7. After the confetti ends, the game automatically opens the next level.
  8. If the user returns using the Back button, confetti stops immediately.
  9. Best scores and unlocked levels remain saved even after refresh.
  1. React
  2. JavaScript
  3. Canvas-confetti
  4. LocalStorage
  5. CSS-in-JS (inline styles)

This project demonstrates how to build a complete, interactive game using React only. It covers real concepts like state management, animations, grid-based logic, dynamic rendering, and persistence using LocalStorage. It serves as a strong portfolio project showing both UI design and functional JavaScript logic.

Note: This project is for educational purposes only. Not for commercial sale.