Leafy Bugs, an HTML5 garden bug sort puzzle
A single-player garden bug sort puzzle for the web with 100 levels in 10 worlds. Garden bugs sit on green leaves: lift the bug on the right end of a leaf, move it next to a matching bug and group 4 of a kind to fill a seed’s acorn basket. Each seed shows the bug it wants, and new seeds arrive as others leave. Plain HTML, CSS and JavaScript ES modules, with no framework and no runtime dependencies.
Every level can be solved, and the levels are plain data files made by a level generator with a solver. Fewer moves earn more stars (3 stars up to 1.3 times the par moves, 2 stars up to 1.8 times, otherwise 1).

A new twist in every world
World 1 teaches the basics, and each world from 2 to 9 adds one new twist. World 10 mixes them all.
- World 2: mystery bugs show as a "?" until they reach the right end of a leaf
- World 3: a tiny leaf that holds 1 bug
- World 4: hazy leaves that ask for a bug ×N and clear after N groups of that bug are sent
- World 5: frost that melts when a matching bug lands next to it
- World 6: a rainbow beetle that matches any bug
- World 7: leaves of 2, 3 and 5 seats next to the usual 4
- World 8: bugs tied with a vine bow that move together
- World 9: a "?" seed that shows its bug later
- World 10: everything together

17 garden bugs with faces and poses
There are 16 garden bugs plus the rainbow beetle. Every bug has 9 faces (idle, blink, happy, wow, sleepy, worried, dizzy, sad and yawn), a peek head and 8 poses (crouch, dangle, leap, fall, curl, stretch, wave and cheer). The bug lifts, hops in an arc and lands softly, with combos, praise words, a "Perfect!" stamp and seeds that float up when their basket is full.
Three helps per level, with limits: Undo (5 per level), Shuffle (1 per level, always a layout that can still be solved) and Extra leaf (1 per level, an empty leaf with 4 seats). If no move is left, a panel offers Try again. A tutorial teaches by doing in levels 1 to 4, and the hints can be turned off in Settings.

Phone, tablet and desktop
Layouts for phones, tablets, desktop and ultrawide screens, in portrait and landscape, with touch (tap or drag), mouse and keyboard (arrow keys pick a leaf, Space or Enter act, Esc closes panels). Options for Music, Effects, Vibration (where the device supports it), Reduce motion (it also follows the system), Tips, full screen (where supported) and language.
Each world has its own garden scenery, its own music track and its own ambient loop: 1 menu track, 10 world tracks, 10 ambient loops and sound effects, with separate Music and Effects volumes. All the art is separate WebP files. 14 languages: English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Chinese.

Change the look: what is in which file
The game reads its data when it starts, so most changes need no build step:
- src/game/rules.js: the rules (leaves, moves, seeds, the twists) and, at the top, the number of helps per level
- src/game/levels/: the levels, one data file per world, made by the level generator and its solver
- src/config.js: the feel and rhythm numbers (timings, shake, particles) and the 17 garden bugs
- src/locales/: one text file for each of the 14 languages
- assets/: the pictures (bugs, leaves, seeds, world sceneries, interface), the music, the ambient loops, the sound effects and the fonts, found by file name
What is in the package
- The game, ready to host. Upload it to any static host; no server language, database or account.
- The complete editable project in plain HTML, CSS and JavaScript ES modules, with 43 automated checks. Node.js 26.13 or newer is only needed for the optional tools (the tests and the level generator).
- A buyer guide and a customization guide.
- All the art, music and sound effects, and the Fredoka and Nunito fonts (SIL OFL 1.1).
Notes
- For one person. This edition has no online play, accounts, leaderboards, ads or purchases, and no integration with ad or payment services.
- Progress is saved in the browser of each player (localStorage, keys leafy-bugs-save and leafy-bugs-prefs). The game makes no requests to other servers.
- It needs HTTP(S) hosting and does not run from file://.
- Tested on a computer in the Chrome and Safari (WebKit) engines. It has not been tested on physical phones or tablets.






















