(function() { var boxIndex = 0; var boxProps = { type: 'Box', color: { red: 255, green: 0, blue: 0 }, dimensions: { x: 0.25, y: 0.25, z: 0.25 } } function makeBox() { print('making box::'+boxIndex); boxProps.position = { x: boxIndex/2, y: 0, z: boxIndex/2 }; Entities.addEntity(boxProps); boxIndex++; } Script.setInterval(makeBox, 1000); var _this; NaughtyBug = function() { _this = this; }; NaughtyBug.prototype = { }; return new NaughtyBug(); })