Cubefield - Endless Obstacle Avoidance Runner

Seele01-Flash
By
Cubefield is an addictive 3D endless running game that challenges your reflexes as you navigate through fields of colorful cubes at increasingly high speeds. Simple controls, progressive difficulty, and mesmerizing visual effects make it perfect for quick gaming sessions.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Cubefield". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: Recreate the classic "Flash game" aesthetic with a minimalist, high-contrast, low-poly design. * **Player Character**: A small, dark grey or black tetrahedron (pyramid shape) representing a futuristic spaceship. It should have a slight "tilt/banking" animation when moving left or right to add dynamic feedback. * **Obstacles**: Simple 3D Cubes (`BoxGeometry`). Colors should be bright (Orange, Yellow, Neon Green) to contrast sharply against the grey background. * **Performance Note**: Use `THREE.InstancedMesh` for the cubes to ensure 60 FPS performance on mobile devices, as hundreds of cubes will be on screen simultaneously. * **Environment**: A flat, infinite grey ground plane. * **Fog**: Implement `THREE.FogExp2` (Exponential Fog) matching the background color to hide the draw distance and create a smooth "horizon" effect where cubes emerge from the distance. * **Skybox**: Simple solid color matching the fog (light grey/white). * **Level Progression Visuals**: Every 1000 distance units, change the color palette of the ground and cubes (e.g., Grey/Orange -> Dark Blue/Neon Pink -> Black/Matrix Green) to signify difficulty increase. ### 2. Audio Requirements * **BGM**: A fast-paced, rhythmic Techno or Synthwave track that loops. The music should feel urgent to match the speed. * **Sound Effects (SFX)**: * **Engine**: A low, constant hum that rises in pitch as game speed increases. * **Whoosh**: A wind-passing sound when passing close to a cube (proximity check). * **Crash**: A digital "crunch" or glass-breaking sound when hitting a cube. * **Level Up**: A subtle chime when the color palette shifts. ### 3. Gameplay Loop * **Core Mechanics**: The player moves forward automatically at an increasing speed. The only control is steering Left/Right on the X-axis. * **Obstacle Generation**: Cubes should spawn at the horizon line. * Use a procedural generation algorithm (like Perlin noise or randomized "rows") to create distinct patterns: scattered fields, tight corridors, and walls with single gaps. * **Difficulty Scaling**: * **Speed**: Increase the forward velocity (Z-axis) linearly over time. * **Density**: Increase the number of cubes per row as the score gets higher. * **Win/Loss Condition**: * **Loss**: Any collision between the Ship's bounding box and a Cube triggers a "Crash". The camera should shake, the ship should shatter (simple particle explosion), and a "Game Over" UI appears. * **Score**: Score is based on distance traveled. Display current score in the top-left corner. ### 4. Mobile Controls & Interaction * **Control Scheme**: **"Touch & Drag" (1:1 Movement)**. * Touch anywhere on the screen and drag left/right to move the ship. The ship's X position should smoothly follow the finger's horizontal movement relative to the screen width. * *Alternative Fallback*: Two large invisible touch zones (Left 50% / Right 50%) for steering, but Drag is preferred for precision. * **Screen Orientation**: Force **Landscape Mode** (or adapt camera FOV if Portrait is used, but Landscape is preferred for horizon visibility). * **UI/UX**: * **Start Screen**: A simple "Tap to Start" overlay. * **Game Over Screen**: A large, thumb-friendly "Restart" button (minimum 60x60px hit area). * **Pause**: A small pause button in the top-right corner. * **Haptic Feedback**: Trigger a short vibration (`navigator.vibrate(200)`) on collision/game over. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Cubefield

Cubefield is a fast-paced endless running game that has captivated players with its simple yet challenging gameplay mechanics. In this 3D obstacle avoidance adventure, you'll navigate through an infinite field of colorful cubes, testing your reflexes and concentration as speeds increase and corridors become tighter.

The game features a minimalist design with vibrant cube formations that create mesmerizing patterns as you progress. What starts as a gentle introduction quickly evolves into an intense challenge that will keep you coming back for more.

Core Features

Progressive Difficulty System

Cubefield employs a brilliant escalating challenge system. The game begins with widely spaced cubes and moderate speed, allowing new players to familiarize themselves with the controls. As you survive longer, several elements intensify:

  • Increasing Speed : Your movement through the cube field accelerates continuously
  • Tighter Corridors : Cube formations become more complex and narrow
  • Visual Effects : Dynamic color changes and visual distortions add to the challenge
  • Stage Progression : Each level brings new obstacles and configurations

Immersive 3D Graphics

The game's visual appeal lies in its clean 3D aesthetic. Colorful cubes float in space, creating tunnel-like formations that you must navigate. The visual effects become more intense as you progress, with funky color changes and patterns that add both beauty and challenge to the experience.

Endless Gameplay

As a true endless runner, Cubefield offers infinite replayability. There's no final destination - only the challenge of beating your previous best score and seeing how far your reflexes can take you through the cube field.

Gameplay Mechanics

The core gameplay revolves around precise timing and quick reactions. Your ship automatically moves forward through the cube field, and your only control is steering left and right to avoid collisions. This simplicity makes the game easy to learn but incredibly difficult to master.

Success in Cubefield requires: - Anticipation : Looking ahead to plan your route through cube formations - Precision : Making exact movements to squeeze through tight spaces - Adaptation : Adjusting to increasing speeds and changing visual effects - Focus : Maintaining concentration as the game becomes more intense

Operation Guide

Cubefield features intuitive controls that anyone can master:

  • Left Arrow Key : Steer your ship to the left
  • Right Arrow Key : Steer your ship to the right
  • P Key : Pause the game to take a break
  • Mouse : Navigate menus and restart options

The beauty of these simple controls is that they allow you to focus entirely on the challenge at hand - dodging cubes and surviving as long as possible.

Pro Tips for Better Performance

  • Start with small movements and avoid oversteering
  • Keep your eyes focused ahead rather than on your ship
  • Learn to read cube patterns and anticipate openings
  • Stay calm as speeds increase - panic leads to crashes
  • Use the pause feature strategically to collect yourself during intense moments

Why Play Cubefield

Cubefield stands out in the endless runner genre for several compelling reasons:

Perfect for Any Schedule : With no save requirements or complex progression systems, you can enjoy quick 2-minute sessions or longer challenge runs whenever you have time.

Universal Appeal : The simple mechanics make it accessible to players of all ages and skill levels, while the increasing difficulty ensures even experienced gamers find it challenging.

Browser Convenience : No downloads, installations, or accounts required. Simply open your web browser and start playing immediately on any device.

Addictive Progression : The gradual difficulty increase creates a perfect "just one more try" feeling that keeps players engaged.

Visual Satisfaction : The clean 3D graphics and dynamic color effects provide a visually pleasing experience that's both relaxing and exciting.

Whether you're looking for a quick distraction during a break or a challenging test of your reflexes, Cubefield delivers an engaging experience that perfectly balances simplicity with addictive gameplay.

Frequently Asked Questions (FAQ)