This game is a tribute to Arkanoid and Space Invaders created by Taito Corporation.
THE VOID HAS AWAKENED
THE GEOMETRIC ARMADA RETURNS
ONE SHIP STANDS READY
DEFEND THE CORE SECTOR
YouTube video showing in-game action: https://youtu.be/ExsImSRaeAo
Play for free: https://cosmicbounce.netlify.app/
Send me a screenshot of your highscore ![]()
Overview
Cosmic Bounce is a retro-futuristic, 3D arcade game that blends the mechanics of Arkanoid/Breakout with the encroaching enemy pressure of Space Invaders. It is built using Three.js for 3D rendering and features a comprehensive custom audio engine.
Visual Style & Atmosphere
* The game relies heavily on a “Synthwave” or “Cyberpunk” aesthetic.
* CRT Simulation: The game features a toggleable CRT overlay (crt-overlay) that adds scanlines, screen curvature (vignette), and chromatic aberration to mimic an old arcade monitor.
* Lighting: It utilizes high-contrast neon lighting with “UnrealBloomPass” post-processing to make objects glow. It features dynamic spotlights (Cyan and Magenta) that sweep across the playfield.
* Shaders: The floor grid uses a custom shader that creates physical “shockwave” ripples when enemies are destroyed.
* Intro Sequence: It mimics a retro computer boot-up sequence, complete with a “Twilight Zone Software” loader screen and a flying logo.
Gameplay Mechanics
* Objective: Pilot a “V-Wing Interceptor” paddle to bounce a ball into the “Geometric Armada.” The goal is to clear 20 levels (Sectors).
* Orbit Decay: Unlike standard Breakout games, the enemies slowly descend toward the player. If they reach the bottom, the game ends immediately (“Invasion Complete”).
* Controls: Mouse movement steers the paddle. Clicking shoots the ball or fires lasers (if equipped).
* Health: The player has 3 lives. Losing a ball costs a life.
* Stun Mechanic: Enemies shoot projectiles. If the paddle is hit, the player is “Stunned” (controls jammed) for a short duration.
Content Breakdown
- Power-Ups
Destroying enemies has a chance to drop supply canisters:
* Multi (Green): Splits the ball into three.
* Wide (Blue): Extends the paddle width.
* Laser (Red): Equips twin cannons to shoot enemies directly.
* Sticky (Magenta): The ball sticks to the paddle for precise aiming.
* Life (Yellow): Grants an extra life.
- Enemies & Bosses
* Standard Enemies: Geometric 3D shapes (Torus Knots, Cones, Spheres) arranged in procedural patterns.
* Bosses: Every 4th level features a Boss fight. Bosses have health bars and specialized meshes (Saucer, Twinpod, Pyramid, Cube, Dreadnought). When a boss reaches 50% health, it becomes “Enraged,” turning red and moving faster.
Technical Highlights
Custom Audio Engine
This is the most technically complex part of the code. The game includes a Module (MOD) Player written entirely in JavaScript within the file.
* ProTracker Support: It manually parses binary .mod files (specifically arkanoid.mod), handling sample data, period tables, vibrato, and tone portamento effects math manually.
* Radio Knob UI: A UI element allows the player to switch between the Tracker Music (MOD), a WAV file, or Silence.
* Synthesized SFX: Sound effects are generated in real-time using the Web Audio API oscillators (sawtooth, square waves), meaning no external MP3/WAV files are required for sound effects.
Level Generation
The game contains a procedural generation function generateLevelPattern that creates 20 unique layouts using mathematical patterns (e.g., alternating rows, pyramids, invader shapes) rather than storing static level maps.
User Experience
* Mobile Detection: The game detects mobile devices and displays a “System Alert” warning suggesting the user play on a desktop for the best experience.
* High Score: It uses localStorage to save the player’s high score persistently.



