Mahjong Online - Classic Tile Matching Puzzle Game

Seele01-Flash
By
Mahjong Online brings the timeless Chinese tile-matching puzzle to your browser. Clear the board by matching identical patterned tiles in this classic solitaire version that has captivated players for centuries.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Mahjong Online". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** A relaxing, Zen-inspired aesthetic. Use a clean, 3D representation of Mahjong tiles. The tiles should have a bone/ivory white front and sides, with a curved emerald green back (referencing the screenshot). * **The Tiles:** Use `THREE.BoxGeometry` with rounded bevels (or a texture trick to simulate rounded edges) to make them look tactile. Since there are 144 tiles, **use `THREE.InstancedMesh`** for performance optimization on mobile devices. * **Tile Textures:** To ensure the code is runnable without external assets, use `THREE.CanvasTexture` to procedurally draw simplified symbols for the suits (Dots, Bamboo, Characters, Winds, Dragons) directly onto the tile faces. * **Background:** A 2D plane or subtle skybox behind the board featuring a muted, dark grey-blue background with a faint traditional Japanese "Seigaiha" (wave) pattern to match the screenshot's vibe. * **Lighting:** Use a combination of Ambient Light (soft white) and a Directional Light casting soft shadows to clearly define the depth of the tile stacks. This is crucial for players to visualize which tiles are on top of others. ### 2. Audio Requirements * **BGM:** A calm, looping ambient track featuring a Guzheng (zither) or bamboo flute. It should be low volume and non-intrusive. * **SFX - Selection:** A distinct, crisp "clack" sound (like heavy stone or bone) when a tile is tapped. * **SFX - Match:** A satisfying harmonic chime or a smooth "sliding" sound when two tiles successfully match and disappear. * **SFX - Error:** A subtle dull thud or wooden sound if the user taps a tile that is currently blocked/locked. * **SFX - UI:** Soft clicks for buttons (Shuffle, Hint). ### 3. Gameplay Loop * **Setup:** Initialize the board in the classic "Turtle" (pyramid) formation consisting of 144 tiles. * **Logic - Blocked Tiles:** Implement the core Mahjong Solitaire rule: A tile is only selectable if it has no tile directly on top of it **AND** it has a free space on either its left or right side. * **Matching:** 1. Player taps Tile A (it highlights). 2. Player taps Tile B. 3. If Tile A and B match suits/values and are both "free", they animate (fade out or scale down) and are removed from the board. 4. If they don't match, deselect Tile A. * **Win Condition:** The game is won when all 144 tiles are removed. * **Fail/Stuck State:** Check after every move if valid moves remain. If no moves are possible, show a "Shuffle" button or auto-shuffle. ### 4. Mobile Controls & Interaction * **Camera:** Use a `PerspectiveCamera` fixed at a high angle (approx 60-75 degrees), slightly tilted to show 3D depth, ensuring the whole board fits within the viewport. * **Touch Interaction:** Implement `Raycaster` for touch detection. * **Visual Feedback:** When a tile is touched and selected, it should visually lift up slightly (translate Y axis) and emit a glow (emissive material property) to indicate selection state. * **Screen Adaptation:** * The game should be responsive, but **Landscape mode** is preferred for the wide board layout. If in Portrait, scale the board down to fit the width. * Implement "Pinch to Zoom" and "Two-finger Pan" to allow mobile users to see small tiles more clearly. * **UI Layout:** * Place a HUD bar at the bottom of the screen (safe area). * **Score/Timer:** Displayed clearly at the top corners. * **Buttons:** "Hint" (highlights a valid pair), "Shuffle" (rearranges remaining tiles), and "Restart". Buttons must be at least 44x44 pixels for touch targets. 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 Online is a faithful digital recreation of the ancient Chinese tile-matching puzzle game. This classic solitaire version challenges players to systematically clear a complex arrangement of beautifully designed tiles by finding and matching identical pairs. With its traditional Chinese characters, bamboo patterns, and symbolic designs, the game offers an authentic mahjong experience that combines strategic thinking with pattern recognition skills.

The game presents tiles arranged in intricate layouts that require careful observation and planning. Each tile features traditional mahjong symbols including Chinese characters for numbers, directional winds, dragons, and seasonal elements. Success depends on your ability to identify matching pairs while considering which tiles can be legally removed according to the classic mahjong solitaire rules.

Core Features

Traditional Authentic Design

Experience genuine mahjong aesthetics with beautifully crafted tiles featuring traditional Chinese symbols, characters, and artistic elements. The visual design maintains the cultural authenticity of this ancient game while providing clear, readable tile patterns.

Strategic Puzzle Gameplay

Unlike simple matching games, Mahjong Online requires strategic thinking. Players must plan their moves carefully, as removing certain tiles can block access to others. This creates layers of puzzle-solving complexity that keep the game engaging through multiple sessions.

Free Browser-Based Play

Enjoy complete mahjong gameplay without downloads, subscriptions, or hidden costs. The game runs smoothly in any modern web browser, making it instantly accessible whenever you want to play.

Cross-Platform Compatibility

Seamlessly switch between desktop and mobile devices. The responsive design ensures optimal gameplay whether you're using a computer mouse or touchscreen controls.

Progressive Difficulty

While maintaining classic rules, the game provides varying board layouts that offer different levels of challenge, from beginner-friendly arrangements to complex patterns that test experienced players.

Game Rules and Mechanics

The fundamental rule of Mahjong Online follows traditional solitaire mahjong principles: tiles can only be removed if they are "free" - meaning they have at least one open side (left or right) and no tiles stacked above them. This creates the strategic element where players must think several moves ahead.

To successfully clear the board, you must: - Identify pairs of identical tiles that are available for removal - Remove tiles strategically to unlock access to buried tiles - Plan your sequence to avoid creating impossible situations - Clear all tiles from the board to win

Operation Guide

Desktop Controls

  • Mouse Click : Select and match tiles
  • Hover : Preview tile selection and highlight available matches
  • Menu Navigation : Use mouse to access game options and restart functions

Mobile Controls

  • Tap : Select tiles on touchscreen devices
  • Zoom : Pinch gestures for better tile visibility on smaller screens
  • Scroll : Navigate around larger tile layouts

The intuitive control scheme makes the game accessible to players of all experience levels, from mahjong newcomers to seasoned puzzle enthusiasts.

Why Play This Game

Mahjong Online offers a perfect blend of relaxation and mental stimulation. The game provides an excellent brain exercise that improves pattern recognition, memory, and strategic planning skills. Its meditative quality makes it ideal for stress relief, while the puzzle elements keep your mind sharp and engaged.

The game serves multiple purposes: casual entertainment during breaks, serious puzzle-solving for mental exercise, or cultural appreciation of this ancient Chinese tradition. With no time pressure and the ability to restart layouts, players can enjoy the game at their own pace.

Whether you're a longtime mahjong enthusiast or discovering this classic game for the first time, Mahjong Online provides an authentic, accessible, and thoroughly enjoyable puzzle experience that honors the rich tradition of this timeless game.

Frequently Asked Questions (FAQ)