🎲🐀 Make your voxelbuilder.com critter come to life!
JavaScript CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
textures
.gitignore
.npmignore
.travis.yml
LICENSE-MIT
README.md
demo.js
index.html
index.js
main.js
package.json
rabbit.png
style.css
test.js

README.md

voxel-critter Build Status

Make your voxel critter come to life!

Extends voxel-creature and loads encoded PNG files exported from voxelbuilder.com.

example

View this example

var critterCreator = require('voxel-critter')(game);
critterCreator('./critter.png', function(err, critter) {
  // Move forward
  critter.move(0, 0, 0.02);

  // Jump!
  critter.jump();
});

converting images to voxel data

If you would like to convert images into voxel data within Node.js or the browser do:

var convert = require('voxel-critter').Convert();
convert.readImage('./critter.png', function(err, hash) {
  var data = convert.toVoxels(hash);
  // data now contains the voxels, colors, and bounds
});

install

With npm do:

npm install voxel-critter

Use browserify to require('voxel-critter').

release history

  • 1.0.0 - Made node compatible. Uses get-pixels to load data. API changes.
  • 0.1.2 - Fix non-existent load (@domenic)
  • 0.1.1 - Subdivide functionality into load and convertToVoxels (@maxogden)
  • 0.1.0 - initial release

license

Copyright (c) 2014 Kyle Robinson Young
Licensed under the MIT license.