Mahjongg - Classic Chinese Tile Matching Game

Seele01-Flash
By
Mahjongg is the ultimate classic tile matching puzzle game that challenges your pattern recognition skills. Clear all 144 traditional Chinese tiles by finding matching pairs in this timeless brain teaser.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Mahjongg Solitaire 3D". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Realistic, "Zen" aesthetic. The game should feature a 3D table surface (wood grain or green felt texture) with high-contrast lighting to make the tiles pop. * **Tile Models:** Create a rounded rectangular block (BoxGeometry with beveled edges or a texture that simulates depth). The main color should be bone/ivory for the top and bamboo/green for the backing. * **Textures:** Use a single **Texture Atlas** containing all Mahjong face symbols (Bamboo, Dots, Characters, Winds, Dragons, Flowers, Seasons) to optimize performance (reduce draw calls). * **Effects:** * **Selection:** When a tile is tapped, it should lift slightly (y-axis tween) and emit a soft golden glow outline. * **Match:** When a pair is matched, tiles should dissolve with a particle burst effect (gold sparks) or fade out smoothly. * **Camera:** Use a `PerspectiveCamera` positioned at a high angle (approx 60 degrees) looking down at the board, ensuring the "Turtle" pyramid layout is fully visible. * **Performance:** Use `InstancedMesh` if possible for the tiles to ensure 60fps on mobile devices, or merge geometries efficiently. ### 2. Audio Requirements * **BGM:** A calming, looped ambient track featuring traditional Chinese instruments (Guqin or Pipa) mixed with subtle nature sounds (flowing water or wind) to reduce player stress. * **Sound Effects (SFX):** * **Select:** A crisp, satisfying "clack" sound (like distinct hard plastic or bone hitting wood). * **Match/Remove:** A harmonious chime or a sliding stone sound. * **Invalid Move:** A dull, muted wood thud to indicate a tile is locked. * **Shuffle/Win:** A cascading tile sound effect. ### 3. Gameplay Loop * **Setup:** Generate the classic 144-tile "Turtle" formation (pyramid structure). Use a 3D array or coordinate system to map tile positions (layers, rows, columns). * **Matching Logic:** * Players select two tiles with matching faces. * **Special Rule:** "Flowers" match any other Flower; "Seasons" match any other Season. * All other tiles must match exactly (e.g., 3 Bamboo matches 3 Bamboo). * **Validation Logic (Crucial):** A tile is only selectable if it is "Free." * Condition 1: No tile is directly on top of it (Z-axis check). * Condition 2: It has an empty space immediately to its Left OR Right. * **Win/Lose:** * **Win:** Clear all 144 tiles. Show a "You Win" modal with star rating based on time. * **Lose:** Detect when no valid moves remain. Show "No Moves Left" with options to "Shuffle" (penalty added) or "Restart". ### 4. Mobile Controls & Interaction * **Touch Controls:** Implement `Raycaster` for precise touch detection. * **Tap:** Select/Deselect tile. * **Pinch & Drag:** Allow the user to slightly rotate and zoom the camera via `OrbitControls` (restricted polar angles) to see tiles hidden behind taller stacks. * **Orientation:** Portrait mode preferred for one-handed play, but responsive design for Landscape is acceptable. * **UI Layer (HTML/CSS Overlay):** * Top Bar: Score, Timer, and "Remaining Matches" counter. * Bottom Bar: Large, thumb-friendly buttons (min 48px height) for "Hint", "Undo", "Shuffle", and "Menu". * **Feedback:** * **Haptic:** Trigger `navigator.vibrate(10)` on valid tile selection. * **Visual:** If the player taps a "Locked" tile, flash it red briefly to teach the rules. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Mahjongg is a legendary tile-matching puzzle game that has captivated players for generations. This digital version brings the classic Chinese game directly to your browser, featuring 144 beautifully designed tiles arranged in intricate patterns. With a solid 3.6/5 rating from thousands of players, this game offers the perfect blend of strategy, skill, and luck that makes Mahjongg endlessly engaging.

Unlike simple matching games, Mahjongg requires careful planning and strategic thinking. You must clear the entire board by removing pairs of matching tiles, but only tiles that are free on at least one side can be selected. This seemingly simple rule creates layers of complexity that will challenge even experienced puzzle enthusiasts.

Core Features

Completely Free to Play

Enjoy unlimited access to this classic game without any cost. No registration, no downloads, no hidden fees - just pure Mahjongg enjoyment.

Authentic Traditional Gameplay

Featuring genuine Chinese tile designs with traditional symbols including: - Bamboo tiles (numbered 1-9) - Character tiles with Chinese numerals - Circle/Dot tiles (numbered 1-9) - Special Honor tiles (winds and dragons) - Bonus tiles (flowers and seasons)

Multiple Difficulty Levels

Choose from 5 different tile arrangements, each offering unique challenges: - Beginner layouts for newcomers - Intermediate patterns for casual players - Advanced configurations for puzzle masters - Expert arrangements that test your limits

Cross-Platform Compatibility

Built with HTML5 technology, the game runs smoothly on: - Desktop computers (Windows, Mac, Linux) - Mobile devices (smartphones and tablets) - All modern web browsers - No additional plugins required

Strategic Depth

This isn't just about finding matches - it's about planning ahead. Sometimes the best strategy is to leave obvious matches for later, saving them to free up buried tiles. Every move matters when aiming for complete board clearance.

Game Mechanics

Tile Matching Rules

Most tiles must be matched exactly with their identical counterpart. However, special tiles follow unique rules: - Season tiles : Any two season tiles can be matched (Spring, Summer, Fall, Winter) - Flower tiles : Any two flower tiles can be paired together - Regular tiles : Must match exactly (same symbol, same number)

Movement Restrictions

Only "free" tiles can be selected - those with at least one open side (left or right). This creates the puzzle's core challenge as you work to uncover buried tiles.

Victory Conditions

Win by clearing all 144 tiles from the board. Lose if you run out of possible moves before clearing everything.

How to Play

Basic Controls

  • Click on any free tile to select it
  • Click on its matching pair to remove both tiles
  • Observe the board carefully before making moves
  • Plan ahead to avoid getting stuck

Winning Strategy Tips

  1. Survey the board before making your first move
  2. Prioritize freeing buried tiles over easy surface matches
  3. Keep season and flower tiles as backup options
  4. Work from the top down when possible
  5. Don't rush - think several moves ahead

Special Tile Strategy

Use the flexible matching rules for flowers and seasons to your advantage. These tiles can serve as "wildcards" to help you out of difficult situations.

Why Play Mahjongg?

Mental Exercise

Mahjongg provides excellent brain training, improving: - Pattern recognition skills - Strategic planning abilities - Concentration and focus - Problem-solving techniques

Stress Relief

The meditative nature of tile matching combined with the satisfaction of clearing patterns makes Mahjongg an excellent stress-reliever after a long day.

Timeless Appeal

With origins dating back centuries, Mahjongg has proven its lasting entertainment value. This digital version preserves all the charm while adding modern convenience.

Perfect for Any Schedule

Games can last anywhere from 10-30 minutes, making it ideal for quick breaks or longer relaxation sessions.

Accessibility and Convenience

This version of Mahjongg is designed for maximum accessibility. The clean interface works equally well on large desktop monitors and small mobile screens. Touch controls are optimized for smartphones and tablets, while mouse controls provide precision on desktop computers.

The game automatically saves your progress, so you can return to unfinished games later. Multiple difficulty levels ensure that both beginners and experts can find appropriate challenges.

Frequently Asked Questions (FAQ)