Stacktris - Physics Block Stacking Game

Seele01-Flash
By
Stacktris combines the classic Tetris experience with challenging physics-based tower stacking. Test your precision and balance as you stack spinning tetrominoes to build the tallest possible tower without letting any blocks fall.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Stacktris". Please read the following detailed game design requirements first, and then generate the code accordingly. Use `cannon-es` for the physics engine simulation. ### 1. Assets & Environment * **Visual Style:** Minimalist, clean 3D aesthetic with a flat, vector-art feel (Low-poly). Use an **Orthographic Camera** to remove perspective distortion, making it easier to align blocks vertically. * **Color Palette:** * Background: Dark slate gray (`#2d3436`) to reduce eye strain and make colors pop. * Blocks: Vibrant, saturated "Tetris" colors (Cyan, Yellow, Purple, Green, Red, Blue, Orange) with a slight bevel or chamfer on edges to catch highlights. * Platform: A neutral light gray, slightly wider than standard blocks. * **Lighting:** Use a strong Directional Light casting sharp, hard shadows (ShadowMap enabled) to give depth perception without performance cost. Add a soft Ambient Light to prevent pitch-black shadows. * **Performance:** Reuse block geometries (InstancedMesh if possible, though simple Mesh cloning is fine for low counts). Limit shadow map resolution to 1024x1024 for mobile performance. ### 2. Audio Requirements * **BGM:** A minimal, rhythmic Lo-Fi or Synth-pop track that is relaxing but helps with concentration. * **Sound Effects (SFX):** * *Spinning:* A subtle, rising pitch loop while the block spins. * *Lock:* A mechanical "click" sound when the user touches the screen and stops the spin. * *Impact:* A satisfying, heavy "thud" based on the velocity of the collision when a block lands. * *Game Over:* A crumbling or shattering sound. * *UI:* Soft taps for button presses. ### 3. Gameplay Loop * **Spawn Phase:** A random Tetromino spawns in the air above the current stack. It automatically rotates along the Z-axis. The rotation speed increases exponentially over time if the player waits too long. * **Action Phase:** 1. **Touch/Click Hold:** The block immediately **stops spinning**. 2. **Drag:** The player moves their finger/mouse left or right to position the block horizontally. 3. **Release:** Physics is enabled for the block, and it falls (gravity applied). * **Settling:** The block collides with the stack. It must physically balance. The physics material should have moderate friction (to prevent sliding off too easily) and low restitution (low bounce). * **Camera Tracking:** As the stack grows, the camera smoothly pans upward to keep the top of the tower in the center of the viewport (roughly lower 1/3rd of the screen). * **Win/Loss Condition:** * **Loss:** If any block falls off the platform and drops below a certain Y-threshold, the game ends. * **Score:** Score increases based on the height of the stack. ### 4. Mobile Controls & Interaction * **Input State Machine:** * `IDLE`: Block rotates automatically. * `TOUCH_START`: Stop rotation instantly. Save current rotation Quaternion. * `TOUCH_MOVE`: Map screen X coordinate to World X coordinate. The block follows the finger horizontally (clamped within screen edges). * `TOUCH_END`: Activate physics body (dynamic mass), apply downward velocity. * **Responsiveness:** No virtual joysticks. The entire screen is the interaction area. * **Orientation:** Portrait mode is mandatory for vertical stacking gameplay. * **Feedback:** * **Haptic:** Trigger a short vibration (using `navigator.vibrate`) when the block lands or when the game is lost. * **Visual:** A subtle "ghost" projection line downwards to help the player aim before releasing. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Stacktris

Stacktris is an innovative arcade physics game that puts a unique spin on the beloved Tetris formula. Instead of fitting blocks into rows, you must carefully stack spinning tetrominoes to build an impossibly tall tower. This challenging game tests your precision, timing, and balance skills as you attempt to create the ultimate block tower without letting a single piece fall.

The game features vibrant, colorful tetrominoes that constantly spin at increasing speeds, creating an intense challenge that requires perfect timing and steady hands. Each block drop could make or break your towering achievement, making every move critical to your success.

Core Features

Physics-Based Stacking Challenge

Stacktris introduces realistic physics mechanics to the classic block-stacking experience. Every tetromino behaves according to gravity, momentum, and friction, creating authentic stacking challenges that feel both familiar and refreshingly new.

Progressive Difficulty System

As you build higher, the tetrominoes spin faster and the challenge intensifies. The exponentially increasing spin speed keeps you on your toes and ensures that even experienced players face exciting new challenges.

Comprehensive Upgrade System

Collect coins during gameplay to purchase powerful upgrades: - Slow Spin : Reduces initial block rotation speed - High Friction : Decreases block sliding for better stability - Coin Magnet : Increases coin collection radius - Low Bounce : Reduces block bouncing on impact - Coin Chance : Improves coin drop probability - Wide Table : Expands the stacking platform - Next Block : Preview upcoming tetrominoes

Cross-Platform Compatibility

Enjoy seamless gameplay across all devices - desktop computers, smartphones, and tablets all provide the same engaging Stacktris experience.

Gameplay Mechanics

Desktop Controls

Master the art of precision stacking with intuitive mouse and keyboard controls: - Click and hold to stop tetromino spinning - Drag to position blocks precisely above your tower - Use A/D keys or arrow keys for horizontal fine-tuning - Release to drop blocks with perfect timing - ESC for menu access, Enter to pause

Mobile Controls

The mobile experience offers equally precise control: - Long-press to halt block rotation - Drag horizontally for accurate positioning - Release to drop blocks onto your growing tower

Strategic Tips for Success

Timing Is Everything

The key to Stacktris mastery lies in perfect timing. Watch the spinning patterns, anticipate the optimal moment to stop rotation, and position blocks with surgical precision.

Build a Stable Foundation

Start with a solid base using larger, more stable tetromino shapes. A wobbly foundation will doom even the most carefully planned tower.

Utilize Upgrade Synergies

Combine upgrades strategically - pair Slow Spin with Wide Table for easier early-game building, or use Coin Magnet with Coin Chance for rapid upgrade acquisition.

Why Play Stacktris

Stacktris offers a uniquely addictive gaming experience that combines the nostalgic appeal of Tetris with innovative physics gameplay. The game's free-to-play model means anyone can dive in immediately, while the upgrade system provides long-term progression goals.

The perfectly balanced difficulty curve ensures that newcomers can enjoy early success while experienced players face increasingly demanding challenges. Whether you're looking for a quick gaming session or an extended tower-building marathon, Stacktris delivers engaging entertainment that's impossible to put down.

Compete with friends to see who can build the tallest tetromino tower and prove your stacking supremacy in this one-of-a-kind physics puzzle adventure!

Frequently Asked Questions (FAQ)