Skip to content

reach distance for block breaking and placing (voxel.js addon)

Notifications You must be signed in to change notification settings

voxel/voxel-reach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

reach distance for block breaking and placing (voxel.js addon)

Resources

Stars

Watchers

Forks

Packages

No packages published