Sandtris - Sand Physics Tetris Game

Seele01-Flash
By
Sandtris revolutionizes classic Tetris gameplay by transforming falling blocks into realistic sand particles. Experience physics-based puzzle action as colorful blocks cascade down and convert to sand upon landing.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Sandtris**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** 2.5D Voxel/Pixel Art Aesthetic. Use an **Orthographic Camera** to maintain a flat, retro game look while using 3D cubes. * **Core Elements:** * **The Blocks (Tetrominoes):** Groups of small 1x1 cubes. Use bright, saturated neon colors (Hot Pink `#FF0066`, Bright Yellow `#FFCC00`, Cyan `#00CCFF`, Lime Green `#66FF00`) to match the reference. * **The Sand:** When a block lands, it must decompose into individual 1x1 cubes (voxels) that act as sand grains. * **Background:** A deep navy/dark blue void (`#050A20`) with a subtle, faint grid pattern or distant twinkling stars to give a "cosmic puzzle" feel. * **Performance Optimization (Crucial):** Since the game involves thousands of sand particles, you **must use `THREE.InstancedMesh`** to render the sand grains. Do not create individual Mesh objects for every grain, or mobile performance will crash. Implement a color attribute for the InstancedMesh to support multiple block colors in a single draw call. ### 2. Audio Requirements * **Background Music (BGM):** A "Zen Focus" style track. Lo-fi beats or ambient electronic synth that is relaxing but rhythmic. It should help the player concentrate without becoming annoying over time. * **Sound Effects (SFX):** * **Movement:** A subtle, high-pitched digital "tick" when sliding the block. * **Transformation/Impact:** A satisfying "crumbling" or "shaking" sound (like maracas or pouring sugar) when a solid block turns into loose sand upon impact. * **Line Clear:** A harmonious, rising chime or a digital "sweep" sound. * **Game Over:** A low-pitched, slowing-down sound effect. ### 3. Gameplay Loop * **Core Mechanic:** The game combines Tetris with **Cellular Automata (Sand Physics)**. 1. **Spawn:** A solid Tetromino spawns at the top. 2. **Fall:** The block falls slowly. 3. **Collision:** As soon as the block hits the bottom or existing sand, it **dissolves** into individual pixels/grains. 4. **Sand Physics:** These grains obey gravity and fluid physics. If a pixel has empty space below it, it falls. If directly below is blocked but down-left or down-right is free, it slides there. This creates natural-looking piles/dunes. * **Scoring:** A "Line Clear" happens when a horizontal row is fully occupied by sand pixels of *any* color from the far left wall to the far right wall. The color does not need to match. When a line is full, the pixels in that row vanish, and all sand above it falls down to fill the gap. * **Game Over:** If the pile of sand reaches the top of the screen where blocks spawn. ### 4. Mobile Controls & Interaction * **Orientation:** Portrait Mode (Vertical) to accommodate the tall playfield. * **Touch Controls:** * **Horizontal Drag:** The active block should track the user's finger x-position 1:1. Use Raycasting on a hidden plane to detect touch position. * **Tap:** Rotate the block 90 degrees. * **Swipe Down (Fast):** Hard drop the block. * **UI Layout:** * Place a score counter at the top center. * Include a discreet "Pause" button in the top-right corner (minimum touch target 44x44px). * **Feedback:** * **Haptic Feedback:** Trigger a light vibration (using `navigator.vibrate`) when a block lands and turns into sand, and a heavier vibration when a line clears. * **Visual Feedback:** Emit a small burst of glowing particles when a row clears. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Sandtris is an innovative physics-based puzzle game that puts a creative spin on the beloved Tetris formula. Instead of traditional solid blocks, this game features colorful pieces that transform into flowing sand particles upon impact, creating a mesmerizing visual experience that combines classic puzzle mechanics with realistic particle physics.

The game challenges players to fill complete horizontal lines from left to right to clear sand and create space for incoming blocks. What makes Sandtris unique is its dynamic sand physics system - watch as blocks gracefully fall and instantly convert into thousands of tiny sand grains that respond naturally to gravity and pile up realistically.

Core Features

Innovative Sand Physics Engine

Unlike traditional Tetris games, Sandtris employs advanced particle physics to simulate realistic sand behavior. Each block transforms into individual sand particles that flow, settle, and interact naturally with the game environment.

Dual Game Modes

  • Classic Mode : Perfect for beginners and casual players who want to enjoy the relaxing sand physics at a comfortable pace
  • Speed Mode : Challenge your reflexes as blocks fall faster and faster, testing your ability to keep up with the accelerating sand cascade

Visual Excellence

Featuring vibrant pixel art graphics with smooth particle animations, Sandtris delivers a visually stunning experience that's both nostalgic and modern. The contrast between the dark blue background and colorful sand creates an immersive atmosphere.

Cross-Platform Compatibility

Play seamlessly across all devices - desktop computers, smartphones, and tablets. The game adapts perfectly to different screen sizes while maintaining optimal performance.

Gameplay Mechanics

The core objective remains familiar to Tetris fans: arrange falling pieces to create complete horizontal lines. However, Sandtris adds complexity through its physics system. When blocks land, they immediately break apart into sand particles that settle naturally according to gravity, creating organic pile formations that affect future block placement strategies.

Operation Guide

Sandtris features intuitive controls suitable for all platforms:

Desktop Controls: - Mouse Movement : Move left or right to aim your falling blocks - Click : Drop blocks or confirm placement

Mobile Controls: - Touch and Drag : Swipe left or right with your finger to position blocks - Tap : Quick placement and game interaction

The simple control scheme ensures that players can focus on strategy rather than complex button combinations, making the game accessible to puzzle enthusiasts of all skill levels.

Why Play Sandtris

Sandtris offers a fresh take on puzzle gaming that combines the satisfaction of classic Tetris with the wonder of physics simulation. The game provides both relaxation and challenge - watch mesmerizing sand cascades in Classic mode or push your limits in the intense Speed mode.

Key benefits include: - Stress Relief : The flowing sand physics create a meditative, calming experience - Brain Training : Enhances spatial reasoning and quick decision-making skills - Universal Appeal : Easy to learn but difficult to master, suitable for all ages - No Commitment : Play quick sessions anytime, anywhere without downloads - Progressive Challenge : Start easy and gradually increase difficulty as you improve

Whether you're a Tetris veteran looking for something new or a casual gamer seeking engaging entertainment, Sandtris delivers unique gameplay that keeps you coming back for more.

Frequently Asked Questions (FAQ)