Inspiration

We wanted to bring the timeless appeal of Mahjong Solitaire to Reddit's community platform. The classic tile-matching puzzle has entertained millions for decades, and we saw an opportunity to create a modern, accessible version that anyone could play directly within Reddit posts. Our goal was to combine traditional gameplay with contemporary design and progressive difficulty to keep players engaged across 40 unique levels.

What it does

Mahjong Go is a strategic tile-matching puzzle game where players clear boards by matching pairs of tiles. The twist? You have only 4 holding slots to work with, adding a layer of strategy to every move. Players must:

Click free tiles (not blocked on top or sides) to add them to holding slots Match pairs automatically to clear them and earn points Clear all tiles to win and unlock the next level Avoid filling all 4 slots with non-matching tiles (game over!) The game features 40 progressively challenging levels, beautiful 3D ceramic tile designs with Reddit-themed emoji symbols, smooth animations, sound effects, and a memory challenge mechanic in higher levels where tiles are face-down. Progress is automatically saved, so players can continue where they left off.

How we built it

We built Mahjong Go using Devvit's React framework with TypeScript. The tech stack includes:

Frontend: React with Framer Motion for smooth animations Styling: Tailwind CSS for responsive design Game Logic: Custom algorithms for tile generation, free tile detection, and matching State Management: React hooks for game state and localStorage for progress persistence Design: CSS gradients and shadows to create realistic 3D ceramic tiles with glossy highlights We implemented a smart tile sizing algorithm that dynamically scales tiles based on screen dimensions and level complexity, ensuring the game works perfectly on both mobile and desktop without any scrolling. The level system gradually increases difficulty from 16 tiles on a single layer to 132 tiles across 4 layers.

Challenges we ran into

Mobile responsiveness: Getting tiles to fit perfectly on all screen sizes, especially for high-complexity levels (13+) with many columns, required careful calculation of spacing ratios and layer offsets Tile positioning logic: Implementing the "free tile" detection algorithm to check if tiles are blocked on top or both sides across multiple layers Performance optimization: Ensuring smooth animations and instant tile matching even with 132 tiles on screen Visual design: Creating realistic 3D ceramic tiles using only CSS gradients, shadows, and highlights without image assets Game balance: Designing 40 levels with gradual difficulty progression that feels natural and rewarding Accomplishments that we're proud of Zero scrolling: The game fits perfectly on any screen size with intelligent tile scaling Beautiful visuals: Premium 3D ceramic tiles with glossy highlights and realistic shadows created entirely with CSS Smooth gameplay: Buttery animations at 60fps using Framer Motion Progressive difficulty: 40 carefully balanced levels that gradually introduce new challenges Accessibility: Clear visual feedback, sound effects, and intuitive controls Memory mechanic: Face-down tiles in higher levels add a unique twist to traditional Mahjong Complete game loop: From splash screen to level selection to gameplay with win/loss conditions and progress saving

What we learned

How to build complex game logic with React hooks and state management Advanced CSS techniques for creating 3D effects without WebGL or images Responsive design strategies for games that must work on any screen size The importance of playtesting and iterative difficulty balancing How to optimize React performance for animation-heavy applications Devvit's capabilities for building interactive experiences on Reddit

What's next for Mahjong Go

Leaderboards: Global and subreddit-specific high score tracking Daily challenges: Special puzzle layouts that change every 24 hours Custom themes: Let players choose different tile designs and backgrounds Multiplayer mode: Race against other players to clear boards fastest Level editor: Community-created puzzles that players can share Achievements system: Unlock badges for completing challenges Hint system: Optional hints for players who get stuck Undo feature: Allow players to undo their last move Statistics: Track personal stats like completion time, accuracy, and win rate

Built With

Share this project:

Updates