Carrom 3D – Realistic HTML5 Board Game
Carrom 3D is a complete HTML5 carrom board game featuring a custom-built 3D renderer and realistic physics engine. Play against an intelligent computer opponent, challenge a friend on the same device, or practice your shots in Practice mode.
Built from scratch using plain HTML5, CSS3, JavaScript, and WebGL, Carrom 3D requires no third-party libraries, external image files, audio files, or installation process. The board, coins, textures, lighting effects, and sound effects are generated directly through code.
With responsive controls, multiple board appearances, adjustable AI difficulty, and offline support, Carrom 3D delivers a complete carrom experience across desktop and mobile devices.
Game Modes
Play Against Computer
Challenge the computer opponent with three difficulty settings:
- Easy: A less accurate opponent suitable for beginners.
- Medium: A more challenging opponent with improved shot accuracy.
- Hard: A stronger opponent that evaluates possible shots before making a move.
Two Players
Play against a friend on the same device. Players take turns controlling the striker and competing to pocket their coins.
Practice Mode
Improve your aiming, shot power, and control without the pressure of a competitive match.
Intuitive Flick Controls
Carrom 3D uses an intuitive drag-and-release shooting system designed to feel natural on both touchscreens and desktop devices.
- Position the striker along the baseline.
- Drag backwards to set the shooting direction and power.
- Release to flick the striker toward the coins.
- Use the visual power bar to control shot strength.
- Enable the optional aiming guide to line up shots.
- Touch, mouse, and keyboard control support.
Realistic Physics Engine
The custom physics engine is written in JavaScript and designed to recreate the movement and collisions of a traditional carrom game.
- Sliding friction and gradual coin slowdown.
- Responsive coin-to-coin collisions.
- Realistic cushion and board-edge bounces.
- Striker movement and shooting power.
- Accurate pocket detection.
- Physics-based movement for the striker and coins.
Carrom Rules and Scoring
The game includes the essential carrom rules and scoring mechanics to provide a complete match experience.
- Coin pocketing and score tracking.
- Queen pocketing and cover requirement.
- Foul detection when the striker is pocketed.
- Turn management and scoring logic.
- Win-condition detection.
- Match completion and end-game presentation.
Intelligent Computer Opponent
Carrom 3D includes a computer player that evaluates multiple possible shots using the actual game physics before selecting a move.
- Evaluates potential shot directions and power.
- Uses physics simulation to compare possible outcomes.
- Adjustable Easy, Medium, and Hard difficulty.
- Different accuracy levels based on selected difficulty.
- Automated opponent turns.
Detailed 3D Graphics
Experience a custom-rendered 3D carrom board with detailed materials, lighting, and visual effects.
- Detailed wooden board frame and cushions.
- Realistic-looking pockets with nets.
- Painted board markings and playing lines.
- Bevelled coins with dimensional appearance.
- Glossy striker design.
- Soft shadows and lighting effects.
- Board and coin textures generated in code.
Camera and Visual Options
- 3D View: Play with a perspective view of the board.
- Top View: Switch to a top-down playing perspective.
- Player Camera: Camera rotates for Player 2.
- Impact Feedback: Subtle camera shake on powerful hits.
- Victory Presentation: Camera movement when the match ends.
Three Board Themes
Customize the appearance of the playing board with three built-in visual styles.
- Classic Wood: A traditional wooden carrom board appearance.
- Ebony: A dark and elegant board style.
- Ocean: A distinctive ocean-inspired colour theme.
Sound and Visual Effects
- Sound effects generated using the Web Audio API.
- Vibration feedback on supported mobile devices.
- Confetti effect when a player wins.
- Impact feedback during powerful shots.
- Responsive game animations and camera effects.
Responsive Design and Controls
Carrom 3D adapts to different screen sizes, providing a consistent playing experience across desktop computers, tablets, and mobile phones.
- Responsive phone, tablet, and desktop layouts.
- Touchscreen controls for mobile devices.
- Mouse controls for desktop players.
- Keyboard control support.
- Adaptive board presentation.
Statistics and Settings
- Player statistics saved in the browser.
- Game settings saved locally.
- Customizable gameplay configuration.
- Persistent settings between visits using browser storage.
Easy Customization
Carrom 3D includes a central configuration file that makes it easier to adjust important gameplay and presentation settings without modifying the entire game engine.
Main configuration file: js/config.js
- Physics settings.
- Scoring and point values.
- Computer opponent difficulty.
- Game interface text.
- Board themes and colours.
- Gameplay configuration.
Developer-Friendly Source Code
The source code is organized into separate files with readable, commented JavaScript to make customization and future development easier.
- Physics engine.
- Computer player logic.
- Custom 3D WebGL renderer.
- Core game functionality.
- Interface and gameplay components.
- Central configuration file.
Technical Features
- HTML5, CSS3, and vanilla JavaScript.
- Custom WebGL 3D renderer.
- Custom-built physics engine.
- No third-party JavaScript libraries.
- No external image or audio files.
- Procedurally generated board and coin textures.
- Code-generated sound effects using Web Audio API.
- Offline gameplay support.
- Can be embedded into other websites using an iframe.
Package Contents
index.html – Main game entry point. css/ – Game stylesheets. js/ – JavaScript source files. js/config.js – Central customization settings. - Complete physics and computer player source code.
- Custom WebGL renderer and game logic.
- Full HTML documentation.
Documentation Included
The included documentation provides guidance for installation, gameplay, configuration, and further customization.
- Installation instructions.
- Game rules and gameplay guide.
- Configuration and settings reference.
- Customization instructions.
- Source code structure and code guide.
- Troubleshooting information.
Browser Requirements
Carrom 3D requires a modern browser with WebGL support and hardware acceleration enabled.
- Google Chrome.
- Microsoft Edge.
- Mozilla Firefox.
- Apple Safari.
- Opera.
- Supported mobile browser versions.
Important: WebGL support is required to render the 3D board. If WebGL is unavailable, the game displays an explanatory message instead of the board.
Credits and Original Work
All code, the custom 3D renderer, physics engine, game design, and logo were created by Md Shunam Al Anam. No third-party assets are used.
Start Playing with Carrom 3D
Bring the classic carrom experience to the browser with a custom-built 3D board, realistic physics, intelligent computer opponent, local multiplayer, and multiple visual themes.
Carrom 3D is a complete HTML5 game package for developers who want a customizable, library-free 3D board game that can be uploaded to a website or embedded into an existing project.