Version 2.0.0 โ A fast-paced, reflex-driven 3D brick-swiping game built with vanilla HTML, CSS, and JavaScript.
- About the Game
- Features
- Live Demo
- File Structure
- Getting Started
- How to Play
- Changelog
- Contributing
- License
- Acknowledgments
3D Bricks Slider Game is a fast-paced, reflex-driven browser game where players swipe bricks off the screen to score points while avoiding deadly bombs. As you progress, the game environment dynamically evolves with vivid new background colours as you clear levels, creating an ever-changing and immersive visual journey.
Built entirely with vanilla HTML5, CSS3, and JavaScript โ no frameworks, no dependencies, just pure performance.
- 3D Rendered Bricks: Real-time 3D projection and rendering with perspective, shadows, and smooth physics.
- Swipe Mechanics: Swipe bricks using a mouse or touchscreen. Speed and direction affect scoring and physics reactions.
- Ranked & Casual Modes: Play competitively in Ranked Mode (missed bricks end the game) or relax in Casual Mode (missed bricks deduct points instead).
- Slow-Motion Power-Up: Smashing special wireframe bricks triggers a slow-motion effect with bonus spawns.
- Bombs randomly spawn among regular bricks. Do not swipe them! Swiping a bomb immediately ends the game with a dramatic explosion effect and sound.
- Bombs that fall off-screen are safely ignored โ the game continues.
- Powered by the Web Audio API for zero-latency, hardware-accelerated audio โ optimized for both desktop and mobile.
- Game Start Sound: Plays when the player starts or restarts a game.
- Splash Sound: Fires on every successful brick smash โ supports simultaneous overlapping playback with no lag.
- Game Over Sound: Plays when the player loses (brick missed or bomb swiped).
- Dynamic Background Sound: Plays on every completed level when the background changes.
- Sound Toggle Button (๐/๐): Mounted in the HUD. Preference is saved to
localStorageand persisted across sessions.
-
The game background evolves every time you complete a level (by successfully smashing a required sequence of 10, 15, 20, 25, or 30 cubes) randomly picking from a curated palette of 15 environments:
# Colour Name Hex 1 Teal (Default) #65c8a82 Blue Night #1a365d3 Cosmic Space Purple #170b3b4 Sunset Red/Orange #8a2c225 Digital Green #0f381e6 Deep Violet #4a154b7 Vibrant Orange #e67e228 Midnight Blue #2c3e509 Bright Purple #8e44ad10 Deep Crimson #c0392b11 Dark Sapphire #0c246112 Ocean Night #3c638213 Rich Maroon #b7154014 Deep Teal #07999215 Charcoal #2f3640 -
The game will always begin in the Teal (Default) environment, and all subsequent levels will shift into a dynamically randomized color from the list above.
-
Each transition displays a smooth "New World Unlocked!" milestone notification.
- An in-game instruction menu accessible from the Main Menu explains the game objective, controls, bomb warnings, and background progression system.
3d-Bricks-Slider-Game/
โ
โโโ index.html # Main entry point โ game HTML structure & HUD
โ
โโโ src/
โ โโโ css/
โ โ โโโ style.css # All game styles, animations, menus & HUD
โ โ
โ โโโ js/
โ โ โโโ globalConfig.js # Global constants: colors, physics, camera, sizes
โ โ โโโ state.js # Global game state, enums, and localStorage high score
โ โ โโโ PERF.js # Performance measurement utilities
โ โ โโโ utils.js # Math, DOM, color, timing, 3D projection helpers
โ โ โโโ 3dModels.js # 3D brick and fragment model definitions
โ โ โโโ Entity.js # Entity class for 3D game objects
โ โ โโโ getTarget.js # Target spawning and object pool logic
โ โ โโโ createBurst.js # Burst/fragment explosion effect on brick smash
โ โ โโโ sparks.js # 2D spark particle system
โ โ โโโ hud.js # HUD rendering: score, cubes left, slow-mo bar, milestone notifications
โ โ โโโ menus.js # Menu rendering and button click handlers
โ โ โโโ audioManager.js # Web Audio API sound manager: preloading, playback, mute toggle
โ โ โโโ actions.js # Core game loop, physics tick, milestone & background logic
โ โ
โ โโโ assets/
โ โโโ img/ # Game image assets
โ โโโ sounds/
โ โโโ game-start.mp3 # Sound played when starting a game
โ โโโ game-over.mp3 # Sound played on game over
โ โโโ dynamic-background.mp3 # Sound played on background milestone change
โ โโโ splash.mp3 # Sound played when a brick is smashed
โ
โโโ feature/ # Feature specification documents
โ โโโ BOMB.md
โ โโโ DYNAMIC-BACKGROUND.md
โ โโโ HOW IT WORKS.md
โ โโโ 3-Lives.md
โ โโโ CUBE-BASED-LEVEL.md
โ โโโ HOW-IT-WORKS.md
โ โโโ LEVEL.md
โ โโโ SOUND.md
โโโ Release/
โ โโโ v2.0.0-release-notes.md # Official v2.0.0 release notes
โ
โโโ CHANGELOG.md # Full version history and change log
โโโ CONTRIBUTION.md # Contribution guidelines
โโโ CODE_OF_CONDUCT.md # Community code of conduct
โโโ LICENSE # MIT License
โโโ README.md # This file
All you need is a modern web browser. No build tools, no package managers, no dependencies.
-
Clone the repository:
git clone https://github.com/mmabiaa/3d-bricks-slider-game.git
-
Navigate to the project directory:
cd 3d-bricks-slider-game
Simply open index.html directly in your browser, or serve it with any local static server:
# Using Python
python -m http.server 8000
# Using Node.js (npx)
npx serve .Then visit http://localhost:8000 in your browser. ๐
Note: Running via a local server (rather than opening the file directly) is recommended to ensure audio assets load correctly due to browser security policies.
| Action | Result |
|---|---|
| Click / Tap PLAY GAME | Start a Ranked game |
| Click / Tap CASUAL MODE | Start a Casual game |
| Swipe a regular brick fast | Score points + splash effect |
| Swipe a bomb | ๐ฅ Instant Game Over |
| Miss a brick (Ranked) | โ Game Over |
| Miss a brick (Casual) | -25 points |
| Smash a wireframe brick | โก Slow-Motion activated |
| Complete a level | ๐ Background changes + sound cue |
| Press P | Pause / Resume |
| Click ๐ / ๐ | Toggle sound effects |
See CHANGELOG.md for a full history of all changes, or read the v2.0.0 Release Notes for the latest major update.
Contributions are welcome! Please read CONTRIBUTION.md for guidelines on how to submit improvements or bug fixes.
This project is licensed under the MIT License โ see the LICENSE file for details.
- Special thanks to Rajtlak for early contributions and support!
- Inspired by classic fruit-slicing and brick-swiping arcade games.
- Audio engine optimized using the Web Audio API specification.