Shanghai Dynasty - Free Online Mahjong Game

Seele01-Flash
By
Shanghai Dynasty is a classic mahjong solitaire game that challenges your pattern recognition and strategic thinking. Clear the board by matching identical tiles in this free online puzzle game.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Shanghai Dynasty" (3D Mahjong Solitaire). Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: Realistic yet clean aesthetic. The mood should be tranquil and focused. * **Tile Models**: Create 3D tile assets using `THREE.BoxGeometry` with slightly beveled edges (or simulating bevels via normal maps) to catch light. Dimensions should mimic real Mahjong tiles (ratio approx 3:4:2). * **Textures**: Use a Texture Atlas for the tile faces (Characters, Bamboos, Circles, Winds, Dragons, Flowers, Seasons). The back of the tiles should be a glossy amber or deep green. * **Performance**: **CRITICAL**: Use `THREE.InstancedMesh` to render the 144 tiles to minimize draw calls for mobile performance. * **Environment**: * **Background**: A static, high-quality 2D background texture featuring a deep blue traditional Chinese "Seigaiha" (wave) pattern, similar to the reference image. * **Lighting**: Use `THREE.AmbientLight` (soft white) combined with a `THREE.DirectionalLight` casting soft shadows. Shadows are essential for the player to visually perceive the depth of the tile stack (z-axis layering). * **Particles**: Simple particle burst (gold dust or sparks) upon a successful match. ### 2. Audio Requirements * **BGM**: A relaxing, looping track featuring traditional Chinese instruments (Guzheng, Pipa, or Flute). Low tempo to aid concentration. * **Sound Effects (SFX)**: * **Selection**: A crisp "clack" sound (simulating bakelite or bone hitting wood). * **Match/Remove**: A satisfying, slightly higher-pitched harmonic chime or magical "poof". * **Invalid Move**: A dull, muted thud (audio feedback for errors). * **Win**: A short traditional gong strike or oriental fanfare. ### 3. Gameplay Loop * **Setup**: Initialize the board with the classic "Turtle" (or Pyramid) layout consisting of 144 tiles arranged in 3D layers. * **Core Logic (The Rules)**: * **Selection Validation**: A tile can only be selected if it is "Free". A tile is free if: 1. No other tile is stacked directly on top of it. 2. It has an empty space on either its Left OR Right side. * **Matching**: Players select two free tiles. If their faces match, both are removed from the board. * *Exception*: "Flower" tiles match any other Flower; "Season" tiles match any other Season. * **Win Condition**: Clear all 144 tiles from the board. * **Lose Condition**: No valid moves remain (Game Over state). * **Utilities**: Implement a "Shuffle" function (re-arranges remaining tiles if stuck) and a "Hint" function (highlights a valid pair). ### 4. Mobile Controls & Interaction * **Input System**: Use `THREE.Raycaster` mapped to touch events (`touchstart`). * **Camera Handling**: * **Perspective**: Fixed Perspective Camera positioned at a high angle (approx 60 degrees) to show the 3D depth of the stack clearly. * **Responsiveness**: Implement logic to auto-scale the camera's Field of View (FOV) or Zoom based on the device's aspect ratio (Portrait vs. Landscape) to ensure the entire board is always visible without manual panning. * **Interaction Feedback**: * **Visual**: When a tile is selected, apply an `emissive` glow (e.g., yellow) or lift the tile slightly along the Y-axis (+0.2 units) to indicate selection state. * **Haptic**: Trigger a light vibration (`navigator.vibrate(10)`) on valid selection. * **UI Layout**: * Top bar: Score counter and Timer. * Bottom bar: Large, thumb-friendly buttons (min 44x44px touch targets) for "Restart", "Shuffle", and "Hint". Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Shanghai Dynasty

Shanghai Dynasty is a captivating free mahjong solitaire game that brings the ancient Chinese tile-matching tradition to your browser. With a stellar 4.4 out of 5 rating from players worldwide, this puzzle game offers both accessibility for beginners and deep strategic challenges for experienced players. The game features 144 beautifully designed tiles arranged in intricate patterns, each adorned with traditional Chinese symbols and characters.

Core Features

Classic Mahjong Solitaire Gameplay

Shanghai Dynasty delivers authentic mahjong solitaire experience where your goal is to clear the entire board by matching pairs of identical tiles. The game follows traditional rules - only tiles that are not blocked by other tiles on their left or right sides can be selected.

Multiple Difficulty Levels

The game offers various tile arrangements and layouts, providing different difficulty levels to suit players of all skill levels. From simple beginner layouts to complex multi-layered configurations that challenge even seasoned players.

Free Browser-Based Gaming

  • Completely free to play - no downloads, subscriptions, or hidden fees
  • HTML5 technology - runs smoothly on any modern web browser
  • Cross-platform compatibility - perfect for desktop computers, tablets, and mobile devices
  • No registration required - start playing immediately

Beautiful Visual Design

Featuring authentic Chinese tile designs with colorful symbols including dragons, flowers, seasons, and traditional Chinese characters. The clean, elegant interface ensures excellent visibility and smooth gameplay experience.

Game Mechanics

Strategic Tile Matching

While the concept is simple - match two identical tiles to remove them - the strategy runs deep. Success requires careful planning and foresight. Sometimes it's better to leave easily accessible matches for later to unlock tiles buried deeper in the stack.

Pattern Recognition Skills

The game challenges your ability to quickly identify matching symbols among the 144 tiles. Traditional mahjong tiles include: - Character tiles (numbered 1-9 in Chinese characters) - Bamboo tiles (numbered 1-9 with bamboo stick patterns) - Circle tiles (numbered 1-9 with circle patterns) - Honor tiles (dragons and winds) - Flower and season tiles

How to Play

Basic Controls

  • Click on the first tile you want to select
  • Click on its matching pair to remove both tiles
  • Only exposed tiles (not covered by other tiles) can be selected
  • Clear the entire board to win the game

Winning Strategy Tips

  1. Plan ahead - consider which tiles your moves will expose
  2. Look for buried tiles - prioritize freeing tiles that are deeply covered
  3. Save accessible pairs - don't always take the easiest matches first
  4. Study the layout - understand which tiles are blocking others
  5. Think vertically - remember that tiles can be stacked on top of each other

Why Play Shanghai Dynasty

Mental Exercise and Relaxation

Mahjong solitaire is renowned for its ability to provide both mental stimulation and relaxation. The game enhances: - Pattern recognition abilities - Strategic thinking skills - Concentration and focus - Memory and visual processing

Timeless Appeal

This classic game has entertained people for thousands of years because it perfectly balances simplicity with depth. Easy to learn but challenging to master, Shanghai Dynasty offers endless replayability with different tile layouts and arrangements.

Perfect for Any Device

Whether you're on a lunch break, commuting, or relaxing at home, Shanghai Dynasty adapts perfectly to your device and schedule. The responsive design ensures optimal gameplay on smartphones, tablets, and desktop computers.

Cultural Connection

Experience a piece of Chinese gaming heritage with authentic tile designs and traditional symbols. Each game session is a journey through the rich visual culture of ancient China.

Frequently Asked Questions (FAQ)