Aim. Spin. Sink it.
This is an HTML5 8-ball pool game template with full source code: a finished browser game you upload to your own web host and make your own. Players aim, set the power and add follow, draw or side spin to the cue ball. Three CPU levels, a free practice table and two-player matches on one device are already built in, and the interface comes in 14 languages.

Every shot starts with a plan
On desktop, move the mouse to aim, click to lock the line, then drag down and release to shoot. The mouse wheel fine-tunes the angle and a right-click unlocks it. On touch screens you aim on the table and pull with the power control. A dotted guide shows the path, and the rules module handles fouls, ball-in-hand and solids or stripes.

Cue-ball spin and custom physics
The spin button sets follow, draw and side spin. The ball physics were written for this game in plain JavaScript and rendered with WebGL2, with no third-party 3D library. They live in their own physics file, apart from the CPU logic.

Three CPU opponents
Easy, Medium and Hard computer opponents. CPU shot selection lives in one readable file, so you can tune how the computer plays.

A practice table that teaches
Free play with no opponent, with undo, ball placement and re-rack. Useful for players who want to master a shot before a match.

Cloths, cues and local records
Local achievements unlock five cloth colours and five cue styles. Statistics and personal scores are stored in the browser, with no account or server. Eligible CPU matches that you finish save a personal score; practice and same-device matches do not.

Two players, one device, 14 languages
Pass the phone or share the laptop: same-device matches sit next to CPU play and practice. The interface comes in 14 languages, picked from a dropdown: English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Simplified Chinese.

A smooth start for your project
Upload the contents of the game folder to any static host, keeping the subfolders, and open its address: no npm, no build step, no PHP, no database. Serve it over HTTP(S) rather than opening index.html from disk. The illustrated manual covers installation, file map, customisation, saves and troubleshooting.
Who this template is for
Portal and site owners who want a pool game in their catalogue, studios delivering a branded game to a client, and developers who prefer to learn from readable, formatted JavaScript instead of minified bundles. One licence covers one end product, yours or one client's.
Customise it
The manual points to where each thing lives: cloth and cue definitions in progress.js (keep item IDs stable so saved cosmetics keep working), CPU behaviour in the CPU shot-selection file, physics parameters in physics.js, texts in i18n.js, and the logo files in assets/logo/ with matching sizes in the CSS. Back up first and change one feature at a time.
Technical details at a glance
- Stack: Vanilla JavaScript, WebGL2 and ES modules, with no 3D library
- Files: HTML, CSS, JavaScript and JSON
- Delivery: a ready-to-host game folder plus the readable source edition
- Requirements: a modern browser with JavaScript, ES modules and WebGL2, and any HTTP(S) host that serves static files
- Optional tests: Node.js 20+ for physics, rules, CPU and translation checks
- Documentation: illustrated manual in English and Portuguese
Not included in this edition
This is the local browser edition. Online multiplayer and private rooms, online rankings and cloud accounts, advertising SDKs and accounts, native apps and hosting are not part of the package.
Licence and support in short
A perpetual, non-exclusive licence for one end product. Players can access it free of charge or through advertising monetisation. Six months of support are included, or 12 months with the extension; support covers installing and using the files and fixing reproducible defects. Customisation, hosting and SDK or portal integration are separate services, quoted first.










