King of Mahjong

Seele01-Flash
By
King of Mahjong is an enhanced puzzle game that elevates the classic Mahjong experience with beautiful tiles and multiple challenging game modes. Connect identical tiles using three or fewer straight lines in this engaging brain training adventure.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "King of Mahjong". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Create a "2.5D" aesthetic. The game should be viewed from a top-down perspective using an OrthographicCamera to ensure the grid remains perfectly aligned without perspective distortion. * **Tile Design:** Tiles should be represented as slightly rounded 3D box geometries (thin depth). Use a bright, clean color palette (creamy white or light yellow base). * **Textures:** Procedurally generate or use placeholder colored icons/emojis on the tile faces to represent the assets mentioned: Butterflies (various colors), Fruits (tarts, berries), Drinks, and Gems. Ensure high contrast between the icon and the tile background. * **Background:** A soothing, cool-toned background (e.g., cyan or light teal checkerboard pattern) similar to the reference image, to make the colorful tiles pop. * **VFX:** * **Selection:** When a tile is tapped, it should pop up slightly (Z-axis movement) and glow. * **Connection:** When a match is found, draw a glowing line (using `THREE.Line` or a stretched mesh) showing the path between the two tiles before they disappear. * **Destruction:** Simple particle burst when tiles are cleared. ### 2. Audio Requirements * **BGM:** A light, cheerful, and repetitive "puzzle casual" track (acoustic guitar or mallet instruments style). It should not be distracting. * **SFX:** * **Tap:** A soft, wooden "clack" or "click". * **Match Success:** A satisfying, high-pitched "chime" or "pop". * **Invalid Move:** A low-pitched "buzzer" or dull "thud". * **Win:** A triumphant fanfare. ### 3. Gameplay Loop * **Core Mechanic (Onet/Connect-2 Logic):** The player must select two identical tiles. They can only be connected if a path exists between them using **three or fewer straight lines** (i.e., maximum 2 turns). The path cannot pass through other existing tiles. * **Grid System:** Generate an even-numbered grid (e.g., 6x8 or 8x10) filled with pairs of items. Ensure the board is solvable (or include a shuffle function if no moves are possible). * **Scoring - Distance Bonus:** Implement the specific scoring logic from the description: Calculate the Manhattan distance between the two matched tiles. Award more points/stars for matching tiles that are farther apart. * **Win Condition:** Clear the entire board within a specific time limit. * **Feedback:** If the player selects a second tile that doesn't match or cannot be connected, shake both tiles briefly and deselect them. ### 4. Mobile Controls & Interaction * **Touch Input:** Use a Raycaster specifically optimized for `touchstart` events (not just `click`). The raycaster hitbox for each tile should be slightly larger than the visual model to ensure forgiving touch inputs on smaller screens. * **Orientation:** The game should detect screen aspect ratio. If in Portrait mode, generate a taller grid (e.g., 6 columns x 8 rows). If in Landscape, generate a wider grid (e.g., 8 columns x 6 rows). * **UI Layout:** Place the Score, Timer, and a "Shuffle" button at the top of the screen (safe area), ensuring they do not overlap with the game grid. Buttons must be at least 44x44 pixels. * **Haptic Feedback:** Trigger `navigator.vibrate(10)` on a valid tile selection and `navigator.vibrate([30, 50, 30])` on a successful match to provide tactile satisfaction. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About King of Mahjong

King of Mahjong transforms the traditional Mahjong experience into an exciting modern puzzle adventure. This free online brain game challenges players to connect identical tiles using strategic thinking and pattern recognition. With stunning visual designs featuring butterflies, gems, fruits, and adorable animals, the game offers both entertainment and mental stimulation for puzzle enthusiasts of all skill levels.

Unlike traditional Mahjong solitaire, King of Mahjong introduces a unique connection-based gameplay mechanic where success depends on finding the shortest path between matching tiles. The game has earned popularity among puzzle game fans for its perfect balance of accessibility and challenge.

Core Features

Beautiful Tile Varieties

The game showcases an impressive collection of colorful, hand-designed tiles including: - Butterfly Collection : Vibrant butterflies with intricate wing patterns - Precious Gems : Sparkling diamonds and colorful jewels - Fresh Fruits : Delicious-looking oranges, strawberries, and tropical fruits - Adorable Animals : Cute creatures that add charm to every game session - Food Items : Appetizing cakes, chocolates, cheese, and beverages

Multiple Game Modes

Marathon Mode : Perfect for extended gaming sessions with endless tile-matching challenges. Test your endurance and see how long you can maintain your winning streak.

PVP Mode : Compete against other players online in real-time matches. Show off your tile-connecting skills and climb the leaderboards.

Calendar Mode : Enjoy fresh daily challenges with unique puzzle layouts. Each day brings new tile arrangements and special objectives to keep the gameplay exciting.

Strategic Scoring System

The game rewards strategic thinking through its innovative scoring mechanism. Players earn more stars by connecting tiles that are farther apart, encouraging tactical planning and spatial awareness. This system adds depth to the gameplay beyond simple pattern matching.

Gameplay Mechanics

Core Objective

Your primary goal is to connect two identical tiles using three or fewer straight lines. The path between tiles cannot pass through other tiles, requiring careful observation and planning. Clear all tiles from the board to complete each level.

Connection Rules

  • Lines can only travel horizontally and vertically (no diagonal connections)
  • Maximum of three straight line segments allowed per connection
  • Paths cannot intersect with other tiles
  • Only identical tiles can be connected
  • Strategic tile removal opens new connection possibilities

How to Play

Basic Controls

  • Mouse Click : Select tiles to connect matching pairs
  • Visual Indicators : The game highlights valid connections with colored lines
  • Hint System : Use hints when stuck to reveal possible connections
  • Undo Function : Reverse moves if you make a strategic mistake

Winning Strategies

  1. Survey the Board : Always scan for tiles that are farthest apart first 2 Plan Ahead : Consider how removing certain tiles will affect future connections
  2. Use Edges : Corner and edge tiles are often easier to connect
  3. Save Difficult Pairs : Keep challenging connections for when you have more space
  4. Maximize Stars : Prioritize long-distance connections for higher scores

Why Play King of Mahjong

Mental Benefits

This puzzle game serves as excellent brain training , improving: - Pattern Recognition : Quickly identify matching tiles among diverse designs - Spatial Reasoning : Visualize connection paths and plan tile removal sequences - Memory Enhancement : Remember tile locations and potential matching opportunities - Strategic Planning : Develop long-term strategies for efficient board clearing

Accessibility & Convenience

  • Completely Free : No hidden costs, premium subscriptions, or pay-to-win mechanics
  • No Download Required : Play instantly in any modern web browser
  • Cross-Platform Compatible : Seamless experience on desktop computers, tablets, and smartphones
  • Quick Sessions : Perfect for short breaks or extended gaming marathons
  • Offline Capability : Continue playing even with limited internet connectivity

Perfect for Everyone

Whether you're a Mahjong veteran or puzzle game newcomer, King of Mahjong offers: - Gentle Learning Curve : Easy-to-understand rules with gradually increasing difficulty - Relaxing Gameplay : Stress-free environment perfect for unwinding - Competitive Elements : PVP mode for players seeking head-to-head challenges - Daily Variety : Calendar mode ensures fresh content every day

Start your tile-connecting adventure today and discover why King of Mahjong has become a favorite among puzzle game enthusiasts worldwide!

Frequently Asked Questions (FAQ)