Cubefield - 3D Endless Running Game

Seele01-Flash
By
Cubefield is an addictive 3D endless running game that challenges your reflexes as you navigate through an infinite field of colorful cubes. Test your dodging skills at increasing speeds in this classic browser-based runner.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Cubefield Infinite Runner**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Extremely minimalist, retro-3D aesthetic inspired by the original Flash game. * **Player Model:** A simple, low-poly generic spaceship or a sharp Isosceles Triangle (Grey/Black metallic color) positioned at the bottom center of the screen. * **Obstacles:** Simple `BoxGeometry` cubes. They must spawn in procedural patterns (scattered fields, tight corridors, walls with single gaps). * **Environment:** An infinite flat plane (Ground) colored in soft grey (`#cccccc`). The background/sky should be white or very light grey. * **Atmosphere:** Heavy implementation of `scene.fog` (LinearFog) matching the sky color. This is critical to hide the spawning of cubes in the distance and create a sense of speed. * **Mobile Optimization:** Use **InstancedMesh** for the cubes to handle hundreds of objects with a single draw call. Implement an object pooling system to reuse cubes rather than creating/destroying them. ### 2. Audio Requirements * **BGM:** A driving, rhythmic "Wind/Speed" drone sound that increases in pitch or volume as the player's speed increases. * **SFX:** * **Whoosh:** A "Swoosh" sound when the player narrowly misses a cube (near-miss detection). * **Crash:** A digital "glitch" or "crunch" noise upon collision. * **Level Up:** A subtle chime when the color palette changes. ### 3. Gameplay Loop * **Core Mechanic:** The player moves forward automatically along the -Z axis. Speed starts slow ("Gentle introduction") and increases linearly over time. * **Level Progression:** Every 1000 units of distance, change the "Level Phase." This changes the color of the Cubes and the Ground (e.g., from Orange/Grey to Neon Green/Black, then Purple/White) to mimic the "funky visual changes" of the original. * **Obstacle Logic:** Cubes appear on the horizon within the fog. The density of cubes increases with the distance traveled. * **Game Over:** Standard AABB (Axis-Aligned Bounding Box) collision detection. If the player hits a cube, the game stops immediately, displays the final score (Distance), and offers a "Tap to Restart" button. ### 4. Mobile Controls & Interaction * **Screen Orientation:** Landscape Mode preferred (force via CSS if possible), but the camera FOV must adapt if the user is in Portrait to maintain playability. * **Touch Controls (Split Screen):** * **Left Turn:** Invisible touch zone covering the left 50% of the screen. Holding it moves the ship smoothly along the +X axis. * **Right Turn:** Invisible touch zone covering the right 50% of the screen. Holding it moves the ship smoothly along the -X axis. * **Physics:** Movement should not be instant; add slight "drift" or inertia (`lerp`) to the ship's X-movement to simulate the feeling of a hovering craft. * **UI:** * A minimalist Score counter (Distance Traveled) in the top center. * All UI buttons (Start, Restart) must be at least 44x44px for touch accessibility. * **Haptic Feedback:** Trigger `navigator.vibrate(200)` upon 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 legendary 3D endless running game that has captivated players for years with its simple yet incredibly challenging gameplay. In this fast-paced obstacle avoidance game, you navigate through an endless field of colorful cubes, testing your reflexes and concentration as the speed gradually increases. The minimalist 3D graphics and progressive difficulty make it an instantly accessible yet deeply engaging gaming experience.

Core Features

Cubefield delivers an exceptional endless running experience through several key elements:

  • Completely Free : Play instantly in your browser with no downloads, registration, or payments required
  • Progressive Difficulty : Starts gently but becomes increasingly challenging as you advance through levels
  • Dynamic Visual Effects : Experience cool visual changes and effects as you progress deeper into the cube field
  • Smooth 3D Graphics : Clean, colorful cube environment with fluid movement and responsive controls
  • Cross-Platform Compatible : Works perfectly on desktop computers, laptops, and mobile devices

Endless Challenge System

The game features an intelligent difficulty progression that keeps you engaged. Early levels introduce you to the mechanics with wider spaces between cubes, but as you advance, expect tighter corridors, higher speeds, and more complex obstacle patterns that will test even experienced players.

Visual Evolution

One of Cubefield's standout features is how the visual presentation evolves during gameplay. The cube field transforms with different colors, patterns, and effects the further you travel, creating a mesmerizing experience that rewards persistence and skill.

Game Gameplay

The objective is beautifully simple: survive as long as possible while dodging an endless array of cubes. You control a small cursor or ship that moves through a 3D field filled with colorful cube obstacles. The challenge lies in the game's deceptively simple mechanics - while anyone can start playing immediately, mastering the higher levels requires genuine skill and quick reflexes.

As you progress, the game introduces various challenges: - Increased Speed : Your movement speed gradually increases, requiring faster reaction times - Tighter Spaces : Cube formations become more densely packed, creating narrow corridors to navigate - Visual Distractions : Color changes and effects can make it harder to judge distances and spaces - Pattern Complexity : More sophisticated cube arrangements that require strategic planning

Operation Guide

Cubefield features incredibly intuitive controls that anyone can master:

  • Left Arrow Key : Move your cursor left to avoid cubes on the right side
  • Right Arrow Key : Move your cursor right to dodge cubes on the left side
  • P Key : Pause the game when you need a break or want to plan your next move

The key to success is smooth, controlled movements rather than frantic button mashing. Small adjustments are often more effective than large movements, especially at higher speeds.

Pro Tips for Better Performance

  • Start with gentle movements to get familiar with the control sensitivity
  • Focus on the cubes directly ahead rather than trying to see everything at once
  • Use the pause function strategically during intense sections
  • Practice makes perfect - the more you play, the better your reaction time becomes

Why Play Cubefield

Cubefield represents the perfect blend of accessibility and challenge that defines great casual gaming. It's ideal for quick gaming sessions during breaks, yet engaging enough for longer play periods when you're chasing a new high score. The game's timeless appeal lies in its pure focus on skill-based gameplay without complex rules or mechanics to learn.

The progressive difficulty ensures that both beginners and experienced players find appropriate challenges, while the endless nature means there's always a new goal to reach. Whether you're looking to improve your reflexes, enjoy some stress-free gaming, or compete for high scores, Cubefield delivers an satisfying experience that never gets old.

Frequently Asked Questions (FAQ)