Mahjong Connect (Legacy)

Seele01-Flash
By
Mahjong Connect is a classic tile-matching puzzle game where players must match identical tiles to clear the board. Challenge yourself through multiple levels of this timeless puzzle format.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Mahjong Connect (Legacy)". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: Arcade-style 3D with an Oriental/Chinese aesthetic. The look should be a modernized tribute to the Flash era—clean, vibrant, and readable. * **Camera & Perspective**: Use an Orthographic Camera or a high-FOV Perspective Camera set to a fixed top-down view (slightly angled, approx 70 degrees) to ensure all tiles are easily tappable without perspective distortion at the screen edges. * **Tile Assets**: Create 3D Mahjong tiles that look like chunky, ivory/bone rectangles with green or bamboo backings. * **Performance Optimization**: Crucial for mobile. Use `THREE.InstancedMesh` to render the grid of tiles (e.g., 14x8 grid) to minimize draw calls. Use a single texture atlas for all Mahjong face symbols (Bamboo, Circles, Characters, Winds, Dragons, Flowers). * **Background**: A simple, seamless texture resembling dark red silk or a wooden table surface to provide high contrast against the white/ivory tiles. * **VFX**: * **Selection**: When a tile is tapped, it should lift slightly (y-axis) and glow (emissive material). * **Match**: When a pair is connected, a glowing line (using `THREE.Line` or a shader) should briefly draw the path between them, followed by a particle explosion (confetti or sparks) as the tiles scale down to zero and vanish. ### 2. Audio Requirements * **BGM**: A loopable, relaxing, yet rhythmic track featuring traditional Chinese instruments (Guzheng, Dizi flute) blended with a subtle lo-fi beat to maintain focus without causing fatigue. * **Sound Effects (SFX)**: * **Tap/Select**: A crisp "wood block" or realistic "tile click" sound. * **Deselect/Cancel**: A softer, lower-pitched click. * **Match Success**: A satisfying "chime" or "ding" combined with the sound of stones clacking together. * **Invalid Move**: A subtle "dull thud" or low-tone buzzer (not too harsh). * **Win/Level Clear**: A short, celebratory fanfare. ### 3. Gameplay Loop * **Core Mechanic**: "Shisen-Sho" or "Onet" style matching. The player must clear the board by matching pairs of identical tiles. * **Connection Rule**: A match is valid ONLY if the two tiles can be connected by a line that turns **no more than twice** (0, 1, or 2 right-angle turns) and does not pass through other existing tiles. * **Level Generation**: * Grid size should be responsive (e.g., 6x10 for portrait mobile, 8x14 for landscape). * The board must be populated with pairs. * **Gravity Mechanic (Optional but Classic)**: After a match is made, remaining tiles in that column could slide down or the whole board could shift (depending on the specific level logic), but for the base version, static placement is fine. * **Win/Loss**: * **Win**: Board is completely empty. * **Loss**: Time runs out (implement a progress bar timer at the top). * **Hint/Shuffle System**: If no moves are possible, the game should auto-shuffle. Provide a limited number of manual "Hints" and "Shuffles" via UI buttons. ### 4. Mobile Controls & Interaction * **Touch Controls**: * Implement Raycasting for precise touch detection. * **Hitbox**: Ensure the invisible raycast target for each tile is slightly larger than the visual mesh to accommodate "fat finger" errors. * **Screen Orientation**: Design the layout to be responsive. * **Portrait Mode**: Grid scales to fit width; camera zooms out slightly. * **Landscape Mode**: Grid centers; UI moves to the sides. * **UI/UX**: * **HUD**: Place the Timer Bar at the very top. Place "Pause", "Hint", and "Shuffle" buttons at the bottom of the screen in a "thumb-friendly" zone (minimum 44x44px touch area). * **Feedback**: * **Haptic**: Trigger a light vibration (using `navigator.vibrate(10)`) on valid tile selection and a slightly longer vibration on a successful match. * **Visual Line**: It is critical to visually draw the connection line between tiles so the player understands *why* the match was valid. 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 Connect is a captivating tile-matching puzzle game that combines traditional mahjong elements with modern connectivity gameplay. This classic puzzle challenges players to find and match identical tiles to progressively clear the entire board. With its intuitive mechanics and escalating difficulty levels, Mahjong Connect offers hours of engaging puzzle-solving entertainment.

The game features the traditional mahjong tile set with beautiful, detailed designs that are easy to recognize and match. Each level presents a unique tile arrangement that requires strategic thinking and careful observation to solve efficiently.

Core Features

Classic Tile Matching Gameplay

The core mechanic revolves around finding pairs of identical tiles that can be connected by a path with no more than two turns. This "connection" rule adds a strategic layer beyond simple matching, requiring players to think ahead and plan their moves carefully.

Multiple Challenging Levels

Progress through numerous levels, each with increasingly complex tile arrangements. The difficulty gradually increases, introducing new layouts and patterns that will test your puzzle-solving skills and spatial awareness.

Clean, Intuitive Interface

The game features a clean, user-friendly interface that makes tile selection and matching straightforward. The traditional mahjong tiles are beautifully rendered and easy to distinguish, ensuring a smooth gameplay experience.

Cross-Platform Compatibility

Play seamlessly on both desktop computers and mobile devices through your web browser. No downloads required - simply open and start playing immediately.

Free-to-Play Experience

Enjoy the complete game experience at no cost. All levels and features are available without any payment requirements or premium subscriptions.

Game Mechanics

Tile Connection Rules

To successfully match tiles in Mahjong Connect, two identical tiles must be connectable by a straight line that makes no more than two 90-degree turns. This connection path cannot pass through other tiles, adding a spatial puzzle element to the matching process.

Strategic Depth

While the rules are simple, mastering Mahjong Connect requires strategic thinking. Players must consider which tiles to match first, as removing certain tiles can either open up new possibilities or block potential future matches.

Progressive Difficulty

Early levels serve as tutorials, introducing players to the basic mechanics with simpler layouts. As you advance, tile arrangements become more complex, requiring greater observation skills and strategic planning.

Controls and Gameplay

Simple Mouse Controls

The game uses intuitive mouse-based controls: - Left Mouse Button : Click to select tiles - Click First Tile : Select your first tile of the matching pair - Click Second Tile : Select the matching tile to complete the connection - Visual Feedback : Selected tiles are highlighted, and valid connections are clearly indicated

Gameplay Flow

  1. Observe the Board : Study the tile layout to identify potential matching pairs
  2. Plan Your Strategy : Consider which matches will open up the most opportunities
  3. Select Tiles : Click on matching tiles that can be connected according to the rules
  4. Clear the Board : Continue matching until all tiles are removed
  5. Advance Levels : Complete each level to unlock progressively challenging layouts

Why Play Mahjong Connect

Brain Training Benefits

Mahjong Connect provides excellent mental exercise, improving pattern recognition, spatial awareness, and strategic thinking skills. The game challenges both short-term memory and logical reasoning abilities.

Relaxing Yet Engaging

The game offers a perfect balance of relaxation and mental stimulation. The peaceful gameplay combined with satisfying tile-clearing mechanics creates a meditative yet engaging experience.

Timeless Appeal

Based on the classic mahjong tradition, this game has universal appeal across different age groups and cultural backgrounds. The familiar tile designs and intuitive gameplay make it accessible to both newcomers and experienced puzzle enthusiasts.

Perfect for Quick Sessions

Whether you have five minutes or an hour, Mahjong Connect adapts to your available time. Individual levels can be completed relatively quickly, making it perfect for short breaks or extended puzzle sessions.

No Pressure Gaming

With no time limits or competitive pressure, players can enjoy the game at their own pace, focusing on the pure enjoyment of puzzle-solving and pattern matching.

Frequently Asked Questions (FAQ)