voxel-reach

0.2.2 • Public • Published

voxel-reach

A simple module for voxel-engine to listen for fire/firealt events, raycast the voxel within reach, and send mining/interact events for the hit voxel.

Used by:

Installation

npm install voxel-reach

Example

var createReach = require('voxel-reach');

reach = createReach(game, {reachDistance: 8});

reach.on('use', function(target) { 
  if (target)
    game.createBlock(target.adjacent, 1);
});

reach.on('mining', function(target) { 
  if (target)
    game.setBlock(target.voxel, 0);
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i voxel-reach

Weekly Downloads

8

Version

0.2.2

License

MIT

Last publish

Collaborators

  • deathcap