View on GitHub


Flexible, customazable, interactive, behaviorally rich, pure javascript bugs
Download this project as a .zip file Download this project as a tar.gz file

Bugs infest the screen and interact with the pointer. Bugs have tons of options to customize behavior and very flexible sprite system for customizing their look.


I'd love to have more bug sprite images available, but making them is not my strong suit. Please feel free to contribute and I'll set up a little downloadable gallery if we get some good ones.


None, all native js code


Works on all browsers that support CSS3 transforms, even mobile (that I've tested). See

How to use

Include the JS somewhere, and then initialize with

  new jFormics();


  new jFormics({'minBugs':10, 'maxBugs':50, 'mouseOver':'die'});

Use multiple instances with different options for multiple variants of bugs.

  new jFormics({imageSprite:'fly-sprite-folded-wings.png'});
  new jFormics({imageSprite:'fly-sprite-spread-wings.png'});

See example.html

jFormics constructor can optionally take an object of options. To make this js more async friendly, you can adjust the default options at the top of jformics.js, and then instantiate at the bottom of the file as above. This will allow one to wrap the entire script in a closure to prevent any global window name space overlaps.




Upgraded Screen Bug

Original Screen Bug