Create a gist now

Instantly share code, notes, and snippets.

@maxogden /line.js
Last active Dec 11, 2015

What would you like to do?
voxel script gun scripts
for (var i = 0; i < 50; i++) {
var forward = new game.THREE.Vector3(0,0, -game.cubeSize * i)
var block = position.clone().addSelf(forward)
game.createBlock(block, 1)
}
var left = position.clone().addSelf(new game.THREE.Vector3(-game.cubeSize,0,0))
var top = position.clone().addSelf(new game.THREE.Vector3(0,game.cubeSize,0))
var right = position.clone().addSelf(new game.THREE.Vector3(0,0,game.cubeSize))
game.createBlock(left, 1)
game.createBlock(top, 1)
game.createBlock(right, 1)
// If right-click, create a block.  Else, delete a block
var mouseEvent = arguments[1];
if (mouseEvent.button == 2) {
  game.createBlock(position, 1);
} else {
  game.setBlock(position, 0);
}
dibu28 commented Feb 13, 2014

// plane 10x10
for (var i = 0; i < 10; i++) {
for (var j = 0; j < 10; j++) {
var forward = new game.THREE.Vector3(-game.cubeSize * j, 0, -game.cubeSize * i)
var block = position.clone().addSelf(forward)
game.createBlock(block, 1)
}
}

dibu28 commented Feb 13, 2014

// wall 10x10
for (var i = 0; i < 10; i++) {
for (var j = 0; j < 10; j++) {
var forward = new game.THREE.Vector3(0, game.cubeSize * j, -game.cubeSize * i)
var block = position.clone().addSelf(forward)
game.createBlock(block, 1)
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment