Snake Blockade - Math Snake Collection Game

Seele01-Flash
By
Snake Blockade is an innovative twist on the classic snake game that combines strategic collection with math-based obstacles. Grow your snake by collecting points and use them strategically to crush numbered blockades.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Snake Blockade 3D". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: Minimalist "Hyper-Casual" aesthetic using a top-down 3D perspective (Orthographic camera preferred). * **Color Palette**: * **Background**: Deep Midnight Blue (`#101018`) to reduce eye strain and save battery on OLED screens. * **Snake**: Bright, emissive Yellow (`#FFD700`) spheres. The head should be slightly larger than the body segments. * **Blocks**: Rounded Cubes in pastel colors. Color code them by difficulty (e.g., Pale Green for low numbers, Orange for medium, Bright Red for high numbers). Text textures (CanvasTexture) must be applied to the top face of the blocks to display their HP numbers. * **Collectibles**: Small, glowing floating orbs (Yellow) with a number floating above them indicating how much length they add. * **Effects**: * **Particle System**: When a block is destroyed, it should shatter into small square particles that fade out. * **Trail**: A subtle glowing trail behind the snake for speed sensation. * **Performance**: Use InstancedMesh for the particles and blocks if possible to maintain 60FPS on mobile devices. Use simple Geometries (SphereBufferGeometry, BoxBufferGeometry) with low segment counts. ### 2. Audio Requirements * **BGM**: A rhythmic, driving minimal techno or synth-wave track (approx. 120 BPM) that implies forward momentum. * **Sound Effects (SFX)**: * **Collect**: A high-pitched, pleasant "pop" or "bloop" sound. * **Impact**: A rapid-fire percussive "tick-tick-tick" sound as the snake hits a block and loses length (feedback for damage). * **Break**: A satisfying "crash" or "glass breaking" sound when a block reaches 0 and disappears. * **Game Over**: A distinct low-frequency "power down" sound. ### 3. Gameplay Loop * **Core Mechanic**: An endless runner where the snake moves forward (Z-axis) automatically at a constant speed. * **The Snake**: The snake consists of a Head and a Tail. The Tail length represents the player's "Life". * **Eating**: Colliding with a Pickup Orb increases the tail length by the number displayed on the orb. * **Blocking**: Colliding with a Block stops the snake's forward movement momentarily (or slows it down significantly). * **Interaction**: While touching a block, the Snake's length decreases by 1 every `x` milliseconds, and the Block's number decreases by 1 simultaneously. * **Outcome**: * If Block number reaches 0: The block is destroyed, score increases, and the snake continues moving. * If Snake length reaches 0: **Game Over**. * **Level Generation**: Procedurally generate rows of blocks and pickups. Ensure there is always at least one path with a block value lower than the maximum possible snake length (to prevent unfair unavoidable deaths), or provide gaps. ### 4. Mobile Controls & Interaction * **Orientation**: **Portrait Mode** (Vertical) is mandatory for this gameplay style to allow one-handed play. * **Touch Controls**: * Implement a high-sensitivity **Swerve** mechanic. * The snake's X-position follows the user's finger drag horizontally. * **Important**: Movement should be relative (delta drag), not absolute position, so the player's finger doesn't cover the snake. * Clamp the movement within the play area width so the snake doesn't go off-screen. * **Haptic Feedback**: Trigger `navigator.vibrate(10)` on every "tick" of damage when hitting a block (if supported). * **Camera Behavior**: The camera must smoothly follow the snake on the Z-axis but remain fixed on the X-axis (do not sway left/right with the snake) to prevent motion sickness. * **UI**: * Display "Current Score" at the top right. * Display "Current Length" text floating above the Snake's head at all times. * "Restart" button overlay centered on the screen upon Game Over (min size 48x48px 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 the Game

Snake Blockade revolutionizes the classic snake gaming experience by introducing strategic math elements and obstacle navigation. In this engaging casual game, players must carefully balance growing their snake with managing resources to overcome numbered barriers. The game features a clean, modern design with intuitive controls that work perfectly on both desktop and mobile devices.

Unlike traditional snake games where the only goal is to grow as long as possible, Snake Blockade adds a strategic layer where every point collected serves a dual purpose: growing your snake and providing ammunition to destroy obstacles blocking your path.

Core Features

Strategic Point Management

Every yellow dot you collect adds to your snake's length and your point total. However, these points become your currency for breaking through numbered obstacles. This creates an engaging risk-reward dynamic where players must decide when to spend points and when to save them.

Mathematical Obstacles

Numbered blocks create challenging barriers that require specific point amounts to destroy. Higher numbers demand more points, forcing players to plan their collection strategy carefully. This math element adds educational value while maintaining the fun, arcade-style gameplay.

Modern Snake Mechanics

The game maintains the beloved core of snake gameplay while adding contemporary twists. Your snake moves smoothly across the screen, and collision detection is precise and fair. The challenge scales naturally as you progress through different obstacle configurations.

Cross-Platform Compatibility

Built specifically for web browsers, Snake Blockade runs seamlessly on desktop computers, tablets, and smartphones. No downloads or installations required - just open your browser and start playing immediately.

Gameplay Mechanics

The objective is simple yet challenging: navigate your snake through a field of obstacles while collecting points and strategically using them to clear your path. Each numbered block requires exactly that many points to destroy - a "5" block needs 5 points, a "25" block needs 25 points.

As you collect yellow dots, your snake grows longer, making navigation more challenging. However, longer snakes can carry more points, allowing you to tackle bigger obstacles. The key is finding the right balance between growth and resource expenditure.

The game ends when your snake loses all its points or crashes into an obstacle you cannot destroy. This creates tension in every move - do you risk going for that extra point, or do you play it safe and preserve your current resources?

Controls and Interface

Mouse Control : Simply drag with your left mouse button to control your snake's movement. The control system is responsive and intuitive, allowing for precise navigation around obstacles.

Touch Support : On mobile devices, touch and drag controls work seamlessly, providing the same level of precision as desktop play.

The interface is clean and uncluttered, displaying your current point total and obstacle values clearly. Visual feedback helps you quickly assess whether you have enough points to destroy specific barriers.

Why Play Snake Blockade

This game appeals to both casual gamers and puzzle enthusiasts. The familiar snake mechanics provide immediate accessibility, while the strategic elements offer depth for players seeking more engaging gameplay. The math component makes it suitable for educational environments while remaining entertaining for pure recreational play.

The progressive difficulty and strategic decision-making create a highly replayable experience. Each session presents different obstacle layouts and collection opportunities, ensuring that no two games feel identical.

Perfect for quick gaming sessions during breaks or extended play sessions when you want to challenge yourself with increasingly complex obstacle patterns.

Frequently Asked Questions (FAQ)