Automatically teleport the player back to a known location if they enter a certain region of the world (e.g. fall off the map)
NOTE: this module is based pretty heavily on maxogden/voxel-highlight.
npm install voxel-rescue
var rescue =
options can be:
frequency: // how often in milliseconds to check player position, default is 500.position: // where to teleport the player when they enter the danger zone, default is game.startingPosition.teleport: // if false, do not teleport the player automatically, only emit a 'rescue' event. default is true.dangerZone: // area to rescue the player from. default is:lower: x: -Infinity y: -Infinity z: -Infinityupper: x: Infinity y: -100 z: Infinity
gets called when player is rescued with the position they were at when rescued.
The first time you set up, you should install the required npm packages:
cd voxel-rescuenpm installnpm install browserify -g
Then run the start script (which you'll need to do every time you want to run the demo):
Then point your browser to http://localhost:8080 and have fun!
If you get stuck then look at the readme for voxel-hello-world