var Doors = function(game_mesh, options) { var self=this; self.game_mesh = game_mesh; this.mesh = []; var material; var depth; var depth2; var total_doors=0; this.generated_doors = []; this.data_doors = {}; this.load= function() { var self=this; depth = (Math.sqrt(3)/2) * options.door_size*1.0; depth2 = (Math.sqrt(3)/2) * options.door_size * Math.sqrt(3)/2 *1.3; var texloader = new THREE.TextureLoader(); this.cubeTexture=texloader.load("textures/test.jpg"); return new Promise(function(ok, reject) { var loader = new THREE.JSONLoader(); loader.load( "js/meshes/door.js", function(geometry, mat) { self.door_geo = geometry; self.door_mat = mat; ok(); }); }); }; this.build = function() { var self=this; self.data_doors=[]; var num_items_line = Math.floor(Math.sqrt(options.maze_num)); // Loop lines for(var row=0; row