Eggy Car - Physics Driving Challenge

Seele01-Flash
By
Eggy Car is a unique physics-based driving game where you must transport a fragile egg on your car's roof across challenging terrain. Master the art of smooth driving while collecting coins and avoiding crashes in this deceptively simple yet addictive challenge.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Eggy Car**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** 2.5D Side-Scroller with a "Flat Design" or "Vector Art" aesthetic to match the reference image. Use `THREE.MeshToonMaterial` or `MeshLambertMaterial` with vibrant colors (Primary Red for the car, White for the egg, Warm Orange/Yellow gradient for the background skybox). * **Camera:** Use an **Orthographic Camera** to simulate a 2D look while using 3D models. The camera should follow the player's car smoothly on the X-axis but with a slight delay (lerp) to create a dynamic feel. * **The Car:** A low-poly, blocky red van/pickup truck. It must have a concave "roof rack" or holding area where the egg sits. The wheels should be large, exaggerated, and have independent suspension (visualized by simple movement). * **The Egg:** A high-poly white oval sphere (smooth surface). It is a separate physics object from the car, resting loosely in the car's holding area. It should visually show cracks if it takes damage (optional texture swap). * **The Terrain:** Infinite procedurally generated hilly terrain (using Perlin noise). The ground should be contrasting (e.g., green or sandy brown) with a simple texture. * **Optimization:** Keep geometry low-poly. Use object pooling for the infinite terrain and coins to ensure 60FPS on mobile browsers. ### 2. Audio Requirements * **BGM:** A looping, whimsical, and lighthearted track (style: casual mobile puzzle/cartoon). It should be upbeat but not distracting. * **Sound Effects (SFX):** * **Engine:** A synthesis-based engine hum that increases in pitch based on the car's velocity. * **Impact:** A "thud" or "rattle" sound when the egg hits the edge of the car holder. * **Coin:** A high-pitched, satisfying "ding" or generic 8-bit pickup sound. * **Game Over:** A wet "crunch/splat" sound when the egg hits the ground, followed by a sad trombone or losing jingle. ### 3. Gameplay Loop * **Core Mechanic:** The player drives a car over bumpy, physics-based terrain. The egg is physically simulated (using a physics engine like Cannon.js or Ammo.js integrated with Three.js). The egg reacts to acceleration, braking, and gravity. * **Goal:** Drive as far as possible (distance = score) without the egg falling out of the car and touching the ground. * **Collectibles:** Gold coins scattered along the path (some in the air requiring momentum to jump). * **Fail State:** If the egg collider touches the terrain collider -> Immediate "Game Over" screen with a "Restart" button. * **Physics Tuning:** The car should have high torque but bouncy suspension. The egg should have moderate friction (not too slippery, but enough to slide if the player stops abruptly). ### 4. Mobile Controls & Interaction * **Touch Controls:** Implement a split-screen touch interface: * **Right 50% of screen:** Touch & Hold to **Accelerate** (Gas). * **Left 50% of screen:** Touch & Hold to **Brake/Reverse**. * **Visual Feedback:** When the user touches the left or right side, overlay a subtle transparent arrow animation on that side to indicate input registration. * **Orientation:** Force **Landscape Mode** compatibility (resize canvas dynamically). * **UI Layout:** * **Score/Distance:** Top Center, large font, readable. * **Game Over Screen:** A modal centered on the screen with a large, thumb-friendly "Play Again" button (min-height: 44px). * **Haptics:** Trigger `navigator.vibrate(20)` on coin pickup and a longer vibration `navigator.vibrate(200)` on Game Over. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Eggy Car

Eggy Car is an innovative physics-based driving game that combines simple controls with challenging gameplay mechanics. Unlike traditional racing games, your primary objective isn't speed – it's protection. A delicate egg sits precariously on your car's roof, and your mission is to drive as far as possible while keeping it safe from the realistic physics that threaten to send it tumbling.

The game's brilliant simplicity makes it instantly accessible yet surprisingly difficult to master. Every acceleration, every brake, and every landing affects the egg's position, creating a constant tension between progress and preservation.

Core Features

Realistic Physics Engine

The game's sophisticated physics system governs every aspect of gameplay. The egg responds naturally to momentum changes, slope angles, and impact forces. Drive too aggressively uphill and watch the egg slide backward. Land hard from a jump and it launches forward dangerously.

Simple Two-Button Controls

Accessibility is key in Eggy Car's design: - Desktop : Use D or right arrow to accelerate, A or left arrow to brake/reverse - Mobile : Tap the right side of the screen to move forward, left side to brake or reverse

No complex steering mechanics or special abilities – just pure physics and timing.

Progressive Difficulty

The endless scrolling terrain presents increasingly challenging obstacles: - Steep Hills : Launch points that can send eggs skyward - Sudden Valleys : Momentum traps that test your control - Rolling Terrain : Requires precise throttle management - Gaps and Jumps : Demand perfect landing technique - Coin Collection Points : Risk-versus-reward decision making

Vehicle Progression System

Collect coins during successful runs to unlock: - New Vehicles : Each with unique stability and handling characteristics - Performance Upgrades : Smoother driving capabilities - Different Environments : Varied challenge levels and visual themes

Gameplay Strategy

Mastering the Physics

Success in Eggy Car requires understanding momentum and weight distribution. The egg's position indicates your driving smoothness – a centered egg means optimal control, while a sliding egg warns of impending disaster.

Risk Management

Coins scattered throughout levels create strategic decisions. Do you risk a difficult maneuver for extra currency, or prioritize egg safety? Each choice affects your progression and upgrade potential.

Terrain Reading

Experienced players learn to "read" upcoming terrain, adjusting speed and approach angles before obstacles appear. This predictive driving separates beginners from masters.

Operation Guide

Basic Controls

Desktop Players : - Press D or Right Arrow : Accelerate forward - Press A or Left Arrow : Brake or reverse - No Steering Required : Focus purely on speed control

Mobile Players : - Tap Right Side : Accelerate forward - Tap Left Side : Brake or reverse - Touch-Friendly : Optimized for smartphone and tablet play

Winning Strategies

  1. Smooth Acceleration : Gradual speed changes prevent egg sliding
  2. Anticipatory Braking : Slow down before steep descents
  3. Landing Technique : Gentle landings after jumps preserve egg position
  4. Coin Timing : Collect rewards only when egg position is secure
  5. Practice Patience : Distance matters more than speed

Why Play Eggy Car

Eggy Car offers a refreshingly different take on driving games. Instead of focusing on speed and competition, it emphasizes skill, physics understanding, and careful control. The game's completely free nature makes it accessible to everyone, while its cross-platform compatibility ensures you can play anywhere.

The addictive "just one more try" gameplay loop keeps players engaged as they attempt to beat their distance records. Each failure teaches valuable lessons about physics and control, making every subsequent attempt more informed and strategic.

Whether you're looking for a quick gaming break or a serious physics challenge, Eggy Car delivers engaging gameplay that's easy to learn but incredibly difficult to master. The satisfaction of completing a perfect run – egg intact, coins collected, distance record broken – makes every careful moment worthwhile.

Frequently Asked Questions (FAQ)