capture player edits into json voxel diffs
capture player edits into json voxel diffs for voxeljs
var game = require'voxel-hello-world';var vjson = require'../'game;windowaddEventListener'keydown'if evwhich === 'Z'charCodeAt0console.logJSONstringifyvjsontoJSON;;
Now press the
z key in-game after making some edits.
You'll get a JSON blob. You can then apply that JSON blob to make the same
edits again elsewhere:
var voxelJSON = require'voxel-json'
Register listeners on
game and return a new
Apply a complete
json should have
diff and later other
parameters like terrain seed information.
Apply just a
diff to the
Return a json object with the diff and terrain seed that can be sent to
With npm do:
npm install voxel-json
Compile for the browser with browserify.