View on GitHub

jFormics

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.

Features

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.

Dependencies

None, all native js code

Compatibility

Works on all browsers that support CSS3 transforms, even mobile (that I've tested). See http://caniuse.com/transforms2d

How to use

Include the JS somewhere, and then initialize with

  new jFormics();

or

  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.

Options

Modes

Credits

Upgraded Screen Bug https://github.com/Auz/Bug

Original Screen Bug http://screen-bug.googlecode.com/git/index.html