blocks spawning

This commit is contained in:
ericrius1 2015-09-17 09:09:25 -07:00
parent b9985031da
commit 7ffcce589d

View file

@ -9,18 +9,18 @@ var blocks = [];
spawnBlocks();
var table = Entities.addEntity({
type: "Box",
position: Vec3.sum(center, {x: 0, y: -0.2, z: 0}),
dimensions: {x: 2, y: .01, z: 2},
color: {red: 20, green: 20, blue: 20}
})
// var table = Entities.addEntity({
// type: "Box",
// position: Vec3.sum(center, {x: 0, y: -0.2, z: 0}),
// dimensions: {x: 2, y: .01, z: 2},
// color: {red: 20, green: 20, blue: 20}
// })
function spawnBlocks() {
for (var i = 0; i < NUM_BLOCKS; i++) {
var block = Entities.addEntity({
type: "Model",
modelURL: modelUrl,
position: center,
position: {x: 548.3, y:495.55, z:504.4},
shapeType: 'box',
name: "block",
dimensions: Vec3.sum(BASE_DIMENSIONS, {x: Math.random()/10, y: Math.random()/10, z:Math.random()/10}),
@ -34,10 +34,10 @@ function spawnBlocks() {
}
function cleanup() {
Entities.deleteEntity(table);
blocks.forEach(function(block) {
Entities.deleteEntity(block);
});
// Entities.deleteEntity(table);
// blocks.forEach(function(block) {
// Entities.deleteEntity(block);
// });
}
Script.scriptEnding.connect(cleanup);