""Create a polished, retro-futuristic 3D spaceship web game contained entirely within a single HTML file using Three.js. The game should feature a """"Synthwave/Retrowave"""" aesthetic with the following specifications:
1. Visual Style & Atmosphere
- Aesthetic:* Dark, immersive 3D environment with a glowing, volumetric neon look. Use a color palette of deep purples, hot pinks, and electric cyans.
- Post-Processing:* You must implement Three.js
EffectComposer with UnrealBloomPass to make the neon elements glow intensely.
- Environment:*
- A dense, moving starfield background with rich features. Go beyond simple plane shapes here and apply shaders to make the game visually appealing. For example, simulating retro astra, stars, and planets in the background.
- Distance fog to fade distant objects smoothly into the darkness.
- Assets:* Use complex geometric primitives constructed programmatically (no external model imports).
2. Gameplay Mechanics
- Perspective:* Third-person view from behind the spaceship.
- Core Loop:* The player pilots the ship on the X and Y axis (2D plane) while enemies (neon blocks) spawn in the distance and fly toward the camera along the Z-axis.
- Combat:*
- The player shoots laser bolts (glowing lines) to destroy enemies.
- Collision:* When a laser hits a block, the block should shatter into a very complex particle explosion effect.
- Game Over:* If a block hits the ship, the game ends.
- UI:* A minimal HUD displaying the current Score. A """"Game Over"""" overlay with a """"Restart"""" button.
3. Controls (Cross-Platform)
The game must detect the device type or input method:
- Desktop/Web:*
- Use Arrow Keys* or WASD* for smooth movement (apply
lerp or friction for a floaty, drift-like spaceship feel).