Three of a kind pop — and everything hanging from them falls
← Back to Fun TimeThis game is split into small library files inside funtime/lib/, and every function has a comment saying exactly what goes in, what comes out, and the algorithm in plain English. Empty any function out, read its comment, and write it yourself.
| File | What it does | Good functions to try re-writing |
|---|---|---|
| lib/bubbles-rules.js | The rules: aiming, sticking, popping, falling | turnShooter, sameGroup, popGroup, dropFloaters |
| lib/bubbles-draw.js | Painting five kinds of bubble without any colour | drawBubble, drawShooter, renderGame |
| lib/bubbles-main.js | The glue: the held keys, tap-to-aim, the loop | doAction, connectBoard, gameLoop |
💡 The big idea: one search, two questions. The same flood fill that asks "which bubbles of this kind are joined together?" also answers "which bubbles are joined to the ceiling?" — you only change where it starts and what it is willing to walk through. Learning one algorithm well beats learning two badly.
🛠️ Want to be walked through it? Build Bubble Shooter Yourself takes you through the key functions one step at a time and tests each one you write. There is a Python version too.