Cyber WeekGame templates at Cyber Week pricesEnds in See the deals

Puzzle · HTML5

Leafy Bugs

Complete HTML5 garden bug sort puzzle game with 100 levels

by Polar GamesVersion 1.0.0Updated Dec 1, 2026

  • Source code
  • Live demo
  • Documented
Perpetual licence$59 $50.15 -15%Buy now
A level of world 1: garden bugs sit on leaves, and three dandelion seeds on top each show the bug they want.World 2: mystery bugs show as a "?" until they reach the right end of a leaf.World 4: a leaf in pollen haze asks for a bug ×N and clears after N groups of that bug are sent.World 5: bugs in frost. The frost melts when a matching bug lands next to it.World 6: the rainbow beetle matches any bug.World 7: leaves with 2, 3 and 5 seats next to the usual 4.World 8: two bugs tied with a vine bow travel together.World 9: a "?" seed shows its bug later.Level complete, with stars: fewer moves, more stars.Level select: a grid of 5 by 2 levels for each world.The menu of Leafy Bugs.The game is in 14 languages; the list is in Settings.

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).

Leafy Bugs: 100 levels in 10 worlds of garden bug sort puzzles

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
Leafy Bugs: a new twist in every world, from mystery bugs to pollen haze, frost, vine bow and a rainbow beetle

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.

Leafy Bugs: 17 garden bugs with faces and poses

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.

Leafy Bugs on a phone, a tablet and a computer

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.

Screens from this edition

Captured from the edition sold here.

Included

  • 100 levels in 10 worlds of 10 levels, in a level select with a grid of 5 by 2 levels per world. Each world has its own garden scenery, its own music track and its own ambient loop
  • The sort rules: only the bug on the right end of a leaf moves, 2 or 3 matching bugs on the right move together, an empty leaf takes any bug, bugs only land next to a matching bug, each leaf holds 4 bugs, and 4 matching bugs fill a seed’s acorn basket. 3 seeds are shown at a time, each one showing the bug it wants
  • A new twist in worlds 2 to 9, and world 10 mixes them: mystery bugs, a tiny leaf for 1 bug, hazy leaves that ask for a bug ×N, frost that melts when a matching bug lands next to it, a rainbow beetle that matches any bug, leaves of 2, 3 and 5 seats, bugs tied with a vine bow that move together, and a "?" surprise seed
  • Levels made by a level generator with a solver that proves each level can be solved and stores the par moves; the levels are plain data files, one per world
  • 3 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), plus a "No moves left" panel with Try again
  • Stars in every level (3 stars up to 1.3 times the par moves, 2 stars up to 1.8 times, otherwise 1; 300 stars in all), combos, praise words, a "Perfect!" stamp and seeds that float up when their basket is full
  • A tutorial that teaches by doing in levels 1 to 4, with one hint at a time and a pointing hand, and a short hint on the first level of each new twist; the hints can be turned off in Settings
  • 17 garden bugs (16 garden bugs plus the rainbow beetle), each one with 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)
  • Feel: the bug lifts, hops in an arc and lands softly, with light and parallax on the leaves and world transitions where the camera follows the seed
  • All the art is separate WebP files: the bugs, 10 world sceneries in 3 shapes (portrait, landscape and ultrawide) plus the menu scenery, leaves, seeds and interface pieces
  • Music (1 menu track and 10 world tracks), 10 ambient loops and sound effects, with separate Music and Effects volumes
  • 14 interface languages (English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Chinese); the browser language is used the first time and the list is in Settings
  • Layouts for phones, tablets, desktop and ultrawide screens, in portrait and landscape, with touch (tap or drag), mouse and keyboard; options for Music, Effects, Vibration (where the device supports it), Reduce motion (it also follows the system), Tips, full screen (where supported) and language
  • The game ready to host and the complete editable project (plain HTML, CSS and JavaScript ES modules, no framework, no library and no runtime dependencies) with 43 automated checks
  • A buyer guide and a customization guide

Not included in this edition

  • Online play, accounts or leaderboards
  • Ads, in-app purchases or any integration with an ad or payment service
  • Publishing to app stores or portals, native apps, hosting and custom development

What is in the ZIP

The real folder structure of the package you download, with names and sizes read from it.

leafy-bugs-1.0.0-complete.zip1,839 files · 63.6 MB
  • leafy-bugs-static-1.0.0/1,838 files · 63.6 MB
    • documentation/HTML guide, open it before you buy36 files · 4 MB
      • img/JPG · PNG · 21 files · 2.9 MB
      • customization-de.html33 KB
      • customization-es.html31 KB
      • customization-fr.html32 KB
      • customization-id.html30 KB
      • customization-it.html31 KB
      • customization-ja.html34 KB
      • customization-ko.html32 KB
      • customization-nl.html31 KB
      • customization-pl.html30 KB
      • customization-pt.html30 KB
      • customization-ru.html39 KB
      • customization-tr.html32 KB
      • +3 more files685 KB
    • game/Ready to host: upload this folder892 files · 29.8 MB
      • assets/Art, audio and fontsJSON · MP3 · PNG · WEBP · 802 files · 29.2 MB
      • css/CSS · 4 files · 53 KB
      • fonts/Bundled fontsTXT · WOFF2 · 4 files · 32 KB
      • src/Source modulesJS · 80 files · 472 KB
      • DOCUMENTATION.txt1 KB
      • index.html12 KB
    • source/Readable source code904 files · 29.8 MB
      • assets/Art, audio and fontsJSON · MP3 · PNG · WEBP · 802 files · 29.2 MB
      • css/CSS · 4 files · 53 KB
      • fonts/Bundled fontsTXT · WOFF2 · 4 files · 32 KB
      • src/Source modulesJS · 80 files · 472 KB
      • test/Automated testsMJS · 5 files · 32 KB
      • tools/Build and check scriptsMJS · 4 files · 25 KB
      • DO-NOT-UPLOAD.txt1 KB
      • index.html12 KB
      • package-lock.json1 KB
      • package.json1 KB
      • README.md4 KB
    • THIRD-PARTY-LICENSES/Licence notices to keep with your game2 files · 6 KB
      • Fredoka-and-Nunito-OFL.txt5 KB
      • README.txt2 KB
    • CHANGELOG.txtVersion history1 KB
    • CUSTOMIZATION.html1 KB
    • DOCUMENTATION.htmlOpens the guide1 KB
    • START-HERE.txtQuick start2 KB
  • POLAR-MARKETPLACE-START-HERE.txtStart here: licence, support and first steps1 KB

Item details

Edition
Standalone Browser Edition
Version
1.0.0
Released
Dec 1, 2026
Updated
Dec 1, 2026
Category
Puzzle
Languages
English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean, Simplified Chinese
Files included
HTML, CSS, JavaScript, WebP, MP3, WOFF2
Built with
HTML5, Vanilla JavaScript, ES Modules, Canvas, Web Audio
Browsers
Current Chrome, Edge, Safari and Opera (no WebGL needed)
Documentation
Documentation

Author

Polar Games

Brazilian studio making browser games. Every template here is a game we built and published.

See our games

Requirements

  • A current browser with JavaScript and audio support
  • Static HTTP(S) hosting (it does not run from file://); no database, PHP or author account required
  • Only for editing the source with the optional tools: Node.js 26.13 or newer

Support covers technical questions and reproducible defects in the supplied game. Installation and customisation are separate services.

Changelog

  1. 1.0.0Dec 1, 2026

Questions

Do I need to build the game?

No. There is no compile step: upload the game folder to any static HTTP(S) host and play. The optional tools are only for the tests and the level generator.

Can I change the theme and the bugs?

Yes. The art is separate WebP files with fixed names, such as assets/cats/<bug>-<face>.webp and assets/cats/<bug>-p-<pose>.webp for the bugs, and the leaves, seeds and world sceneries in assets/game/ and assets/bg/. Swap the pictures and keep the names. A new theme also needs new texts and sounds. The customization guide has step-by-step recipes.

Can I add levels?

Yes. The levels are plain data files, one per world (src/game/levels/world-N.js), made by the level generator with its solver, which proves each level can be solved and stores the par moves. Run the generator for a world, or edit the files, and the game reads them when it starts.

Can I change the helps and the difficulty?

Yes. The number of helps per level (Undo, Shuffle and Extra leaf) is one line at the top of src/game/rules.js, and all the feel numbers (timings, shake, particles) are in src/config.js.

Which languages does it have?

14: English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Chinese. Japanese, Korean and Chinese use the fonts of the device.

Where is the progress saved?

In the browser of each player (localStorage, keys leafy-bugs-save and leafy-bugs-prefs): the unlocked level, the stars of each level, the language, the volumes and the options. There is no server or account.

Does it have ads, purchases or online play?

No. It is a single-player game with no ads, purchases or server built in, and no online play or leaderboards. If you add any of that for your own audience, it is yours to build.

Does it use a framework or a library?

No. It is plain HTML, CSS and JavaScript ES modules with no runtime dependencies. The rules are pure functions, and the canvas only draws picture files.

Does it work on phones?

It supports touch (tap or drag) in portrait and landscape, and has layouts for tablets, desktop and ultrawide screens. It was tested on a computer in the Chrome and Safari (WebKit) engines. It has not been tested on physical phones or tablets.

What licence applies?

The Polar Games Marketplace terms shown at checkout.

Read the full licence, support, refund and privacy terms

Before you buy: guides and reviews

From Brazil to the world

Buyers in 25 countries

License a ready HTML5 game, with source code, for your website, app or brand.

  • 900+sales
  • 25countries
  • 2016selling since
Countries where we have sold: Brazil, United States, United Kingdom, Germany, Canada, Australia, France, India, Netherlands, Spain, Italy, Japan, South Korea, Poland, Mexico, Sweden, Switzerland, Singapore, United Arab Emirates, Saudi Arabia, Indonesia, Türkiye, Portugal, Philippines, Vietnam.
Leafy Bugs$59 $50.15 -15%
Buy now