Mahjong Shanghai

Seele01-Flash
By
Mahjong Shanghai is a classic free online tile-matching puzzle game featuring traditional 144-tile setup. Match identical tiles to clear the board, with separate modes for adults and kids.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Mahjong Shanghai 3D**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Classic, realistic table-top aesthetic. The visual tone should be "Zen" and clean. * **Tile Models:** Use `THREE.BoxGeometry` to create the Mahjong tiles. The tiles should have two distinct materials: an "Ivory/Bone" material for the face and a "Jade Green" material for the back and sides. * **Textures:** Implement a texture atlas or UV mapping strategy to render standard Mahjong iconography (Bamboo, Characters, Circles, Winds, Dragons, Flowers, Seasons). *Note: Flowers and Seasons are special categories where any tile within the category matches another.* * **Lighting:** Use a warm AmbientLight coupled with a DirectionalLight to cast soft shadows. Shadows are critical for the player to visually distinguish the height of the tile stacks (depth perception). * **Performance:** **Crucial**: Use `THREE.InstancedMesh` to render the 144 tiles. Since the geometry is identical and only the UVs/textures change, this will ensure 60FPS performance on low-end mobile devices. * **Background:** A high-quality, seamless green felt or dark wood texture to mimic a gambling table. ### 2. Audio Requirements * **BGM:** A looping, relaxing, traditional Chinese instrumental track (Guqin or Flute) to encourage focus. * **SFX - Selection:** A subtle "click" or wood-block sound when a tile is tapped. * **SFX - Match:** A satisfying, heavy "clack" sound (simulating stone/plastic tiles hitting each other) followed by a magical "poof" or chime as they disappear. * **SFX - Error:** A dull thud or gentle buzzer if the player taps a blocked tile. * **SFX - Victory:** A celebratory gong or upbeat jingle upon clearing the board. ### 3. Gameplay Loop * **Setup:** * **Adult Mode:** Generate the classic "Turtle" (or Pyramid) formation using 144 tiles. * **Kids Mode:** A simplified layout with fewer tiles (e.g., 36 or 72 tiles) and no complex stacking. * **Mechanic (The "Free" Rule):** A tile is only selectable if: 1. It has no tile directly on top of it (Z-axis check). 2. It has an open space on either its immediately Left OR Right side (X-axis check). * **Matching Logic:** * Player selects Tile A (it highlights/lifts). * Player selects Tile B. * If A and B match, remove both and add score. * If A and B do not match, deselect A and select B. * **Win Condition:** All tiles are removed from the scene. * **Lose Condition:** No valid moves remain (the game must detect this state and offer a "Shuffle" or "Game Over" prompt, although the classic description says no shuffling, modern mobile UX usually allows a limited number of shuffles or hints). ### 4. Mobile Controls & Interaction * **Camera:** Use an **OrthographicCamera**. This eliminates perspective distortion, making it much easier for users to judge tile alignment on small screens. The camera should automatically zoom/pan to fit the board within the screen bounds (Responsive Design). * **Touch Controls:** Implement Raycasting for touch events. * **Tap:** Select/Deselect tile. * **Pinch/Spread:** Zoom in/out (optional but good for accessibility). * **Pan:** Two-finger drag to move the board if zoomed in. * **Visual Feedback:** * **Selected State:** When a tile is tapped, it should tween (animate) slightly upwards (y-axis +0.5 units) and emit a soft glow or highlight color (0xffff00) to clearly indicate selection to the user's finger is covering it. * **Blocked State:** If a user taps a blocked tile, flash it red briefly or shake it to indicate it cannot be moved. * **UI Layout:** * **Orientation:** Support **Landscape** mode primarily, as the Turtle layout is wide. * **HUD:** Place a "Restart", "Hint", and "Menu" button in the corners. Ensure touch targets are at least 44x44 pixels. * **Score/Timer:** Display clearly at the top center. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Mahjong Shanghai is a timeless tile-matching puzzle game that brings the ancient Chinese game of Mahjong to your browser. This free online version features the classic solitaire-style gameplay where players must strategically match and remove identical tiles to clear the entire board. The game offers both traditional adult mode with full 144-tile complexity and a simplified kids mode for younger players.

The game showcases beautifully designed traditional Mahjong tiles with authentic Chinese characters and symbols, creating an immersive cultural gaming experience. Each tile features intricate details including bamboo sticks, circles, characters, and special honor tiles that make every game visually engaging.

Core Features

Dual Game Modes

Mahjong Shanghai caters to players of all skill levels with two distinct playing modes:

  • Adult Mode : Features the complete traditional 144-tile setup in complex multi-layered arrangements
  • Kids Mode : Simplified version with fewer tiles, making it perfect for children and beginners

Authentic Mahjong Experience

The game preserves the traditional Mahjong aesthetic with: - Traditional Chinese tiles featuring authentic symbols and characters - Classic tile arrangements in pyramid and complex layered structures - Strategic gameplay requiring careful planning and tile selection - No shuffle option - adding strategic depth to every move

Browser-Based Convenience

  • No download required - play instantly in any web browser
  • Cross-platform compatibility - works on desktop computers and mobile devices
  • Free to play - complete game experience without any cost
  • Quick loading - start playing within seconds

Game Playstyle

Strategic Tile Matching

Unlike simple matching games, Mahjong Shanghai requires strategic thinking. Players must: - Identify matching pairs of identical tiles - Ensure tiles are "free" (not blocked by other tiles) - Plan moves carefully as only exposed tiles can be selected - Think several moves ahead to avoid getting stuck

Progressive Difficulty

As you remove tiles and reveal new layers, the game becomes increasingly challenging. The three-dimensional tile arrangements create complex puzzles where every move matters.

Operation Guide

Basic Controls

The game uses simple mouse controls for easy accessibility: - Left mouse click : Select and match tiles - Mouse hover : Preview tile selection - Visual feedback : Selected tiles are highlighted for clarity

How to Play

  1. Scan the board for matching pairs of identical tiles
  2. Check availability - only "free" tiles (not covered or blocked) can be selected
  3. Click matching tiles to remove them from the board
  4. Reveal new tiles as you clear layers
  5. Continue matching until all tiles are removed or no moves remain

Winning Strategy Tips

  • Start by removing tiles from the top and sides
  • Prioritize tiles that will free up multiple other tiles
  • Look for tiles that appear in multiple copies
  • Plan your moves to avoid creating impossible situations

Why Play Mahjong Shanghai

Mental Exercise

Mahjong Shanghai provides excellent cognitive benefits: - Pattern recognition skills development - Strategic thinking and planning abilities - Memory enhancement through tile memorization - Concentration and focus improvement

Relaxing Entertainment

The game offers a perfect balance of challenge and relaxation: - Stress relief through engaging puzzle-solving - Cultural appreciation of traditional Chinese gaming - Flexible gameplay - play for minutes or hours - No time pressure - play at your own pace

Educational Value

Players gain exposure to Chinese culture and symbols while developing problem-solving skills. The kids mode makes it an excellent educational tool for introducing children to strategic thinking.

Accessibility

With its browser-based design and simple controls, Mahjong Shanghai is accessible to players of all ages and technical abilities. The game works seamlessly across devices without requiring downloads or installations.

Frequently Asked Questions (FAQ)