Sandtrix - Sand Physics Tetris Puzzle Game

Seele01-Flash
By
Sandtrix revolutionizes classic Tetris gameplay by transforming falling blocks into sand particles. Match colors horizontally to clear rows and achieve high combos in this innovative puzzle experience.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Sandtrix". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: 2D Retro Pixel Art aesthetic rendered within a Three.js context. Use an **Orthographic Camera** to maintain a flat, classic puzzle look. * **Background**: A static or slowly parallax-scrolling night desert scene inspired by the reference image (dark blue sky, pixelated stars, pyramid silhouettes, and sand dunes). * **Block Assets**: The 7 standard Tetromino shapes. However, they should not be rigid meshes. They must be constructed as **aggregates of individual "sand pixels" (voxels/sprites)**. * **Sand Simulation (Tech Stack)**: Instead of rigid body physics, implement a **Cellular Automata** system (like "Falling Sand" games). When a block lands, it dissolves from a rigid shape into individual colored pixels that obey gravity and slide diagonally down if there is empty space below-left or below-right. * **Performance Optimization**: Since there will be thousands of sand pixels, use `THREE.InstancedMesh` or a GPU-accelerated `THREE.Points` system to render the sand grains to ensure 60FPS on mobile devices. ### 2. Audio Requirements * **BGM**: A chill, Lo-Fi "Desert chiptune" track. It should combine retro 8-bit synths with a Middle Eastern Phrygian dominant scale to match the Egyptian theme. * **Sound Effects (SFX)**: * **Rotation**: A crisp, short 8-bit "blip". * **Landing**: A soft "crumble" or sand-shifting sound (not a heavy thud). * **Line Clear**: A high-pitched, satisfying digital chime or magic sparkle sound. * **Game Over**: A descending scale "power down" sound. ### 3. Gameplay Loop * **Core Mechanic**: Standard Tetris block spawning and movement. The unique twist is the **"Sandification"**: * Blocks remain solid while falling. * Upon collision with the floor or other sand, the block decomposes into individual pixels immediately. * These pixels settle according to sand physics (filling gaps). * **Scoring & Clearing**: Unlike normal Tetris, a row is **NOT** cleared by just filling it. A row is cleared only when a **continuous line of the SAME COLOR** spans from the left wall to the right wall. * **Game Modes**: Implement the **Endless Mode** logic: * Speed increases gradually over time. * Game Over occurs when sand pixels pile up past the top of the visible playfield. * **Combo System**: Visual feedback (text popup) for clearing multiple color lines in quick succession. ### 4. Mobile Controls & Interaction * **Orientation**: **Portrait Mode** (Vertical) is mandatory to accommodate the tall playfield. * **Touch Controls**: * **Swipe Left/Right**: Move the active block horizontally. * **Tap Screen**: Rotate the active block 90 degrees. * **Swipe Down**: Soft drop (accelerate fall). * **UI Button**: Add a dedicated translucent button at the bottom right for "Hard Drop" (instant fall) to prevent accidental swipes. * **Haptic Feedback**: Trigger `navigator.vibrate(50)` when a block lands and turns to sand, and a longer vibration pattern when a line is cleared. * **UI Layout**: * Top: Score display and "Next Piece" preview box (pixel art font). * Center: The main grid (10 columns wide). * Overlay: "Tap to Start" and "Game Over" screens with a Restart button (min-height 44px for touch accessibility). Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Sandtrix

Sandtrix is a groundbreaking twist on the classic Tetris formula that has captivated puzzle game enthusiasts worldwide. Unlike traditional Tetris where blocks remain solid, Sandtrix features a unique sand physics system where pieces transform into colorful sand particles upon landing. This innovative mechanic creates an entirely new strategic layer to the beloved puzzle gameplay.

The game challenges players to think differently about block placement, as the sand physics affect how pieces settle and interact with each other. With its distinctive pixel art style and smooth sand simulation, Sandtrix offers a fresh take on block-puzzle gaming that's both familiar and surprisingly novel.

Core Features

Revolutionary Sand Physics System

The defining feature of Sandtrix is its realistic sand physics. When Tetris pieces hit the ground or other blocks, they instantly transform into individual sand pixels that cascade and settle naturally. This creates dynamic, ever-changing landscapes that require constant adaptation of your strategy.

Three Engaging Game Modes

  • Endless Mode : The classic experience with progressively increasing speed
  • High Score Mode : Maximize your points within a 3-minute time limit
  • Clear 40 Mode : Race to clear exactly 40 rows without time pressure

Multiple Difficulty Levels

  • Easy : Full playing field with normal speed for beginners
  • Medium : Increased speed with slightly reduced play area
  • Hard : Maximum challenge with high speed and limited space

Advanced Combo System

Clear consecutive rows before the combo meter expires to achieve multipliers up to 10x, dramatically boosting your score potential.

Game Mechanics

Color-Based Line Clearing

Instead of simply filling horizontal lines, Sandtrix requires you to create continuous color bands from left to right. When you successfully align pixels of the same color across the entire width, that colored line disappears and awards points.

Strategic Block Placement

The sand physics mean that piece placement affects not just immediate positioning, but how future pieces will settle. Mastering the relationship between solid blocks and flowing sand is key to success.

Controls and Gameplay

Desktop Controls: - W/Up Arrow : Rotate blocks - A,D/Left,Right Arrows : Move pieces horizontally - S/Down Arrow : Fast drop - P : Pause game - Enter/Left Click : Confirm selections

Mobile Controls: - Tap : Rotate the current piece - Swipe Left/Right : Move pieces horizontally - Swipe Down : Quick drop

Platform Support

Sandtrix runs perfectly in any modern web browser on desktop and mobile devices. No downloads or installations required - simply open your browser and start playing immediately.

Why Play Sandtrix

Unique Gaming Experience

Sandtrix offers something genuinely different in the crowded puzzle game market. The sand physics create emergent gameplay situations that keep every session fresh and challenging.

Perfect for All Skill Levels

Whether you're a Tetris veteran or puzzle game newcomer, Sandtrix accommodates all players. Start on easy mode to learn the mechanics, then progress to harder difficulties as your skills develop.

Completely Free

Enjoy the full Sandtrix experience without any cost. No premium features, no pay-to-win mechanics - just pure puzzle gaming accessible to everyone.

Instant Accessibility

Play anywhere, anytime through your web browser. Perfect for quick gaming sessions during breaks or extended puzzle-solving marathons.

Viral Social Appeal

Join the community that has made Sandtrix a social media sensation. Share your high scores and impressive combo achievements with friends across platforms.

Frequently Asked Questions (FAQ)