Skip to content

Instantly share code, notes, and snippets.

@danfinlay
Created September 17, 2013 06:17
Show Gist options
  • Select an option

  • Save danfinlay/6590678 to your computer and use it in GitHub Desktop.

Select an option

Save danfinlay/6590678 to your computer and use it in GitHub Desktop.
A couple node-warrior tools to be used with a voxel-code gun.
///Wavy cloud generator
for(var x = -20; x < 20; x++){
for(var z = -20; z < 20; z++){
setBlock([x, Math.sin(x*0.1)+Math.cos(z*0.1)+50, z], 3);
}
}
///Wavy cloud generator2
for(var x = -20; x < 20; x++){
for(var z = -20; z < 20; z++){
setBlock([x, (Math.sin(x*0.3)+Math.cos(z*0.3))*3+10, z], 3);
}
}
//Stair generator
for(var i = 0; i < 50; i++){
for(var x = 0; x < 4; x++){
setBlock([hitBlock[0]+i, hitBlock[1]+i, hitBlock[2]+x], avatar.currentMaterial);
}
}
//Big hole maker inthe middle of the map
//stacks of the hole
for(var y = 0; y< 100; y++){
for(var x = -10; x < 10; x++){
for(var z = -10; z<10; z++){
setBlock([x, y, z], 0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment