Mini Golf Game Source Code: Holes, Physics and a 3D Course Map
How the Puttide package stores its 30 holes, where Three.js and Rapier sit, and how a buyer adds a hole of their own.

Mini golf game source code stands or falls on one task: adding a hole. A buyer who wants a branded course, a seasonal level or a client's logo on the green will open the level files first, and if a hole is buried in engine code, the project stalls. In Puttide, our 3D mini golf template, each course has its own hole file in plain JavaScript, and the manual walks through adding one.
This guide follows the package the way a developer meets it: the folders, the libraries, the course files, the order of changes, hosting and the licence. File names come from the buyer guide that ships with the game.
The short answer for the impatient: Puttide is formatted JavaScript with Three.js for drawing and Rapier for the ball physics, both bundled. No build step, no CDN and no server code.
What the mini golf game source code includes
Puttide is a finished game with 30 holes on five island courses: Sunlit Ruins, Lantern Pier, Frost Peaks, Cloud Garden and Volcano Forge, six holes each. Ramps, portals, bumpers and windmills turn holes into small puzzles. Each hole awards three stars (finish, par or better, the hidden coin), and bronze, silver and gold medals reward the best rounds.
On top of the courses there is a daily challenge with a twist (windy, icy green, heavy ball, bouncy walls, coin rush or birdie hunt), a Locker where coins buy balls, trails and other cosmetics, and rounds for two to four players taking turns on one device. The interface comes in 14 languages.
- game/: the ready-to-upload build, the only folder you publish.
- source/: the same game as a developer edition, with a README and package.json.
- documentation/: one illustrated guide in English and Portuguese.
- THIRD-PARTY-LICENSES/: licence texts for the libraries and fonts.
- Version 1.1.0, updated on 22 October 2026.
Open the Puttide listing: demo, manual and price
Three.js, Rapier and the rest of the stack
The ball is simulated by Rapier 3D 0.21.0, which runs as WebAssembly, and the scene is drawn with Three.js r186. Both sit in lib/three/ and lib/rapier/ with their licence files, and index.html has an import map that points the game at them. The manual notes the library files are unchanged in behaviour and only formatted so they can be read.
This matters for two reasons. First, nothing loads from a CDN, so a portal or a client with a strict security policy only needs your host. Second, upgrading a library is a manual, deliberate step: source/package.json lists the exact versions, and you copy new module files over the matching lib/ folder and keep the import map paths.
- Three.js r186: MIT licence.
- Rapier 3D compat 0.21.0, WebAssembly embedded: Apache-2.0 licence.
- Rubik and Fredoka web fonts: SIL Open Font License 1.1.
- Two music tracks: music/menu.mp3 and music/play-1.mp3.
Where the holes, coins and texts live
Paths are the same in source/ and game/. The course data is split by island, which keeps each file short enough to read in one sitting.
- src/course/courses.js: course order and unlock requirements.
- src/course/holes.js: the Sunlit Ruins holes, with geometry, par and obstacles.
- src/course/pier.js, ice.js, lava.js and sky.js: the holes of the other four courses.
- src/sim/constants.js: physics tuning.
- src/game/economy.js: balls, trails and outfits, with their prices.
- src/ui/i18n.js and its companion files: the 14 language dictionaries, including hole names and tips.
- src/game/localRecords.js: course records kept in the browser.
- src/audio/audio.js: effects and the music mapping, in probeTracks.
- css/style.css: interface colours, fonts and responsive styles.
Adding a hole, step by step
This is the change most buyers make, and the manual describes it in a few lines. We have expanded it into the order we would follow ourselves.
- Pick the course file the new hole belongs to, for example lava.js for Volcano Forge.
- Duplicate an existing hole definition that looks close to what you want.
- Give it a unique id. Reusing an id confuses saved progress.
- Set par, the tee position and the cup position, then move or replace the obstacles.
- Add the hole to its course in courses.js.
- Add its display name and tip to the language dictionaries, in every language you ship.
- Play it: test collisions, out-of-bounds recovery and all three stars, including the hidden coin.
Edit in source/, copy the changed files to the same paths in game/, and serve the folder over HTTP to test. The package.json has a serve script, or you can run python -m http.server 8765. Node.js is optional and only needed if you want npm to manage the library versions.
The other changes, in a sensible order
- Brand and colours: logo, colours and fonts in css/style.css. White label is allowed, so your brand can replace ours.
- Prices in the Locker: economy.js. Cheaper cosmetics make a casual site friendlier; dearer ones stretch a long campaign.
- Texts: wording and tips in the i18n files.
- Music: the two included tracks can be replaced with recordings you hold a licence for. Copy the file and update the explicit mapping in audio.js (probeTracks); scene music falls back to the gameplay track.
- Physics: constants.js, last, and in small steps, because every hole was tuned against the current values.
For a related project with the same plain-JavaScript approach and no 3D library at all, our pool template is built the same way.
Velvet Pool: 8-ball pool in plain JavaScript and WebGL2
Sunset Rally: 3D table tennis with a nine-match campaign
Hosting, MIME types and app wrappers
Upload everything inside game/ to a folder such as public_html/puttide/, keep the subfolders, and open the address over HTTPS. No npm, PHP, database or account is needed on the server. Opening index.html from disk does not work, because browsers block the modules on file://.
Puttide has one hosting detail that a 2D game does not: the physics runs as WebAssembly. Your server must send .js files with a JavaScript MIME type and .wasm as application/wasm. A host that gets this wrong shows a blank screen or a module error, so check it on day one.
- Browser needs: JavaScript, ES modules, WebAssembly and WebGL2.
- In a portal iframe, allow fullscreen and autoplay.
- On touch screens: drag to aim and putt, two fingers to rotate the camera, pinch to zoom.
- Not an installable offline app: each fresh load still reaches your host.
Native app projects are not in the package. If you plan a store release, budget for the wrapper and its testing on real phones, because a 3D physics game is heavier than a card game on older devices.
Not included, and the licence
This is the local browser edition: no online multiplayer or online rooms, no online leaderboard, no cloud accounts, no advertising SDK, no native apps and no hosting. Course records, daily progress and same-device rounds stay in the player's browser, and no score is uploaded. Saves belong to the browser origin, so moving to another domain starts players fresh.
Puttide lists at $39; until 30 November 2026 the Black Friday promotion brings it to $33.15, and buying two or more templates in one order adds a 5% to 20% bundle discount. The licence is perpetual and non-exclusive for one end product, yours or one client's. You may rebrand it, change its code, art and audio, and let players in free or with ads, but you may not resell the template or its code by itself. Support runs six months, or twelve with the extension; custom holes, integrations and hosting are quoted on request.
Licence, support and refund terms in full
FAQ
Is the mini golf source code in TypeScript?
No. Puttide is plain, formatted JavaScript in source/src and game/src, with no minified or bundled files of our own.
Can I add my own holes or courses?
Yes. Duplicate a hole in the course file, give it a unique id, set par, tee and cup, add it to courses.js and add its name and tip to the language files.
Does it load Three.js from a CDN?
No. Three.js, Rapier, the fonts and the music are all inside game/, so the game only needs your host.
Why does my host show a blank screen?
Usually the MIME types. Serve .js as JavaScript and .wasm as application/wasm, open the game over HTTP(S), and check that WebGL2 is enabled.
Can friends play together?
Yes, two to four players take turns on the same device. Online play is not part of this edition.
Is it the right mini golf base for you?
Puttide fits a family or sports portal, an agency building a branded course for one client, and a developer who wants to see how Three.js and Rapier work together in readable code. It is a weaker fit for a project that needs online rounds or a shared leaderboard from day one.
Play a full course in the demo on a phone, then read the manual's section on adding a hole. If that section looks like an afternoon of work to you, the rest of the game is already built.
