Piles of Tiles - Online Mahjong Puzzle Game

Seele01-Flash
By
Piles of Tiles is an innovative online mahjong game that combines traditional tile-matching with physics-based challenges. Navigate through 30 unique levels where your moves affect the stability of tile stacks.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Piles of Tiles". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** A casual, bright, and clean 3D aesthetic suitable for mobile screens. The background should be a simple, non-distracting texture (e.g., a bamboo mat, a zen garden sand pattern, or a soft beige gradient) to ensure high contrast with the tiles. * **Tile Models:** Create 3D Mahjong tiles using `BoxGeometry` with slightly beveled edges (`roundedRect` logic or textures with baked ambient occlusion) to catch the light. Apply standard Mahjong face textures (Dots, Bamboo, Characters, Winds, Dragons, Flowers, Seasons) to the top face and a solid ivory/bone color to the sides/bottom. * **Physics & Gravity (Crucial):** Unlike standard Mahjong, this game requires a physics engine (integrate **Cannon.js** or **Ammo.js**). Tiles are stacked physically. When lower tiles are removed, upper tiles must react to gravity and fall realistically, settling into new positions. * **Performance Optimization:** * Use low-poly meshes for tiles. * Implement texture atlasing for tile faces to reduce draw calls. * Limit real-time shadows; use baked shadows or simple blob shadows if frame rate drops on mobile devices. ### 2. Audio Requirements * **BGM:** A relaxing, Zen-inspired loop featuring light traditional instruments (e.g., Guzheng or Bamboo Flute) mixed with ambient nature sounds. It should be unobtrusive to aid concentration. * **Sound Effects (SFX):** * **Selection:** A soft wooden "tap" or "click". * **Match/Clear:** A satisfying, magical chime or "poof" sound. * **Physics Impact:** A distinct "clack" sound when tiles fall and collide with each other or the ground (velocity-dependent volume). * **Shuffle:** The sound of stones rattling together. * **UI:** Crisp clicks for buttons (Hint, Pause). ### 3. Gameplay Loop * **Initialization:** Generate a level layout (one of 30 variations) where tiles are stacked vertically in complex 3D structures (pyramids, walls, towers). Ensure the initial state is physically stable. * **Matching Logic:** * **Selection Rule:** A tile is selectable only if it is "free" (has at least one vertical side open—left or right) AND is not covered by another tile directly on top. * **Match:** Player taps two matching selectable tiles. They disappear instantly. * **Dynamic Physics Phase:** Upon removal, checking for unstable tiles is required. Any tiles supported by the removed pair must fall under gravity. * **Game State Checks:** * After tiles settle, re-evaluate "free" status for all tiles. * **Win Condition:** All tiles are cleared from the board. * **Auto-Shuffle:** If no moves are available, the game detects this state and automatically shuffles remaining tiles (re-stacking them or randomizing positions) without penalty, or prompts the user to use a shuffle power-up. ### 4. Mobile Controls & Interaction * **Touch Controls:** * **Raycasting:** precise tap detection. Since tiles are small, expand the invisible hit-box slightly around each tile for better usability. * **Camera Controls:** Allow single-finger rotate (orbit around the pile) and two-finger pinch to zoom. This is essential for seeing tiles hidden behind the stack. * **Visual Feedback:** * **Highlighting:** When a tile is tapped, it should glow green or lift slightly up. * **Matches:** Highlight matching pairs in gold before removing. * **Playability:** Dim (darken) tiles that are currently blocked/unplayable to help the player focus on valid moves. * **UI Layout:** * **Orientation:** Landscape mode preferred for wider piles, but responsive design is required. * **HUD:** Place "Hint" and "Shuffle" buttons in the bottom corners (thumb zones). Score and Level counter at the top center. * **Touch Area:** Ensure all UI buttons are at least 44x44px. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Piles of Tiles revolutionizes the classic mahjong experience by introducing a unique physics-based twist to traditional tile matching. This free online puzzle game challenges players to think strategically about every move, as removing tiles causes others to fall and shift, creating dynamic puzzle scenarios that keep you engaged.

With an impressive 4.2/5 rating from players worldwide, this HTML5 game delivers smooth gameplay across all devices without requiring downloads or installations.

Core Features

Physics-Based Tile Mechanics

Unlike traditional mahjong games, Piles of Tiles features interconnected tile stacks where your choices have cascading effects. When you remove matching tiles, gravity takes over, causing remaining tiles to tumble and settle into new positions. This mechanic adds layers of strategy and unpredictability to every game.

30 Challenging Levels

Each level presents a unique obstacle and tile arrangement, progressively increasing in difficulty. From simple starter puzzles to complex multi-layered challenges, the game keeps you engaged with fresh scenarios that test different aspects of your puzzle-solving skills.

Smart Hint System

Stuck on a particularly challenging level? The built-in hint system highlights available moves, helping you identify matching pairs when the puzzle becomes overwhelming. The game also features an automatic shuffle function that activates when no moves are detected.

Cross-Platform Compatibility

Built with HTML5 technology, Piles of Tiles runs seamlessly on desktop computers, tablets, and mobile phones. Whether you're using Chrome, Firefox, Safari, or any modern browser, you'll enjoy smooth, responsive gameplay.

Gameplay Mechanics

Basic Rules

The fundamental objective follows traditional mahjong solitaire principles: find and match pairs of identical free tiles to remove them from the board. A "free" tile must have at least one open side and cannot be covered by another tile above it.

Strategic Depth

The physics element transforms simple tile matching into complex strategic planning. Before making a move, consider how falling tiles might: - Cover previously accessible tiles - Reveal new matching opportunities - Create or eliminate future move possibilities - Affect the overall stability of the tile structure

Scoring System

Your performance is tracked through a comprehensive scoring system that rewards efficient play and quick decision-making. Submit your scores to compete with players globally and track your improvement across multiple playthroughs.

Operation Guide

Basic Controls

  • Mouse Click/Tap : Select tiles to match and remove pairs
  • Hint Button : Highlights available matching pairs when you're stuck
  • Shuffle Button : Reorganizes tiles when no moves are available
  • Score Panel : View current score and level progress

Gameplay Strategy Tips

  1. Plan Ahead : Consider the consequences of each move before clicking
  2. Use Hints Wisely : The hint system helps identify opportunities you might miss
  3. Prioritize Access : Focus on moves that will free up more tiles
  4. Watch for Cascades : Anticipate how falling tiles will settle
  5. Practice Patience : Some levels require multiple attempts to master

Why Play Piles of Tiles

Perfect for Puzzle Enthusiasts

If you enjoy traditional mahjong but crave additional challenge, this game offers the perfect evolution. The physics mechanics add strategic depth while maintaining the satisfying tile-matching gameplay that makes mahjong universally appealing.

Accessible Yet Challenging

The game strikes an excellent balance between accessibility for newcomers and depth for experienced players. Early levels teach the mechanics gradually, while later stages provide genuine challenges that require strategic thinking and planning.

Free and Convenient

No downloads, no installations, no payment required. Simply open your browser and start playing immediately. The game saves your progress automatically, allowing you to pick up where you left off across multiple sessions.

Great for Mental Exercise

Piles of Tiles provides excellent brain training, enhancing pattern recognition, spatial reasoning, and strategic planning skills. The physics element adds an extra layer of cognitive challenge that keeps your mind sharp and engaged.

Frequently Asked Questions (FAQ)