Can anyone help me with the spawning issue I'm facing?
Currently, random blocks are falling down the screen one at a time. I want them to spawn every 2 seconds instead of just having one block appear at a time.
If you have any suggestions or solutions, please let me know!
You can check out my Codepen here: http://codepen.io/anon/pen/Qwpqex
var callSpawn = setInterval(function(){
if (RandomBlock.position.x < paddle.position.x*2.5) {
spawning();
newBlock = false;
}
},50);
function spawning()
{
shapes = [LeftBlock, RightBlock, middleRightBlock, middleLeftBlock, middleBlock];
var shape = shapes[Math.floor(Math.random()*shapes.length)];
RandomBlock = new THREE.Object3D();
RandomBlock.add(shape);
scene.add(RandomBlock);
hit = false;
}