Code viewer for World: Cloned Cloned of Kian Coll...

// Cloned by test2 on 15 Jan 2018 from World "Cloned of Kian Collision World" by Test Account  
// Please leave this clone trail here.
 
function initMusic(){var e="<audio  id=theaudio  src="+MUSIC_BACK+"   autoplay loop> </audio>";$("#user_span1").html(e)}function randomfloatAtoB(e,a){return e+Math.random()*(a-e)}function randomintAtoB(e,a){return Math.round(randomfloatAtoB(e,a))}function World(){function e(){var e;e=new THREE.DirectionalLight(16777215,1.3),e.position.set(LIGHTRADIUS,startRadius,-20),e.target.position.copy(threeworld.scene.position),e.castShadow=!0,e.shadow.camera.left=-60,e.shadow.camera.top=-60,e.shadow.camera.right=60,e.shadow.camera.bottom=60,e.shadow.camera.near=20,e.shadow.camera.far=200,e.shadow.bias=-1e-4,e.shadow.mapSize.width=e.shadow.mapSize.height=2048,threeworld.scene.add(e);var t,i,s=new THREE.TextureLoader;t=Physijs.createMaterial(new THREE.MeshLambertMaterial({map:s.load(TEXTURE_GROUND)}),HIGH_FRICTION,LOW_RESTITUTION),i=new Physijs.BoxMesh(new THREE.BoxGeometry(100,1,100),t,0),i.receiveShadow=!0,threeworld.scene.add(i);var d=new THREE.TextureLoader,h=new THREE.TextureLoader;o=new THREE.BoxGeometry(BOXSIZE,BOXSIZE,BOXSIZE),r=Physijs.createMaterial(new THREE.MeshLambertMaterial({map:d.load(TEXTURE_FILE_0)}),MEDIUM_FRICTION,LOW_RESTITUTION),n=Physijs.createMaterial(new THREE.MeshLambertMaterial({map:h.load(TEXTURE_FILE_1)}),MEDIUM_FRICTION,LOW_RESTITUTION),a()}function a(){var e=new Physijs.BoxMesh(o,r);e.collisions=0,e.castShadow=!0,e.position.set(randomintAtoB(-10,BOXPOS),30,randomintAtoB(-10,BOXPOS)),e.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),e.addEventListener("collision",function(e,a,o,r){var i=a.y;Math.abs(i)>4&&(t(),this.material=n)}),threeworld.scene.add(e),i=e,setTimeout(a,randomintAtoB(500,2e3))}function t(){var e="<audio    src="+SOUND_COLLISION+"   autoplay  > </audio>";$("#user_span2").html(e)}var o,r,n,i,s=0;this.endCondition,this.newRun=function(){this.endCondition=!1,threeworld.init3d(startRadius,maxRadius,SKYCOLOR),threeworld.renderer.shadowMap.enabled=!0,threeworld.renderer.shadowMapSoft=!0,threeworld.scene.setGravity(new THREE.Vector3(-25,80,-70)),e(),threeworld.lookat.copy(threeworld.scene.position),threeworld.scene.simulate(),initMusic()},this.nextStep=function(){i&&threeworld.follow.copy(i.position),s++,$("#user_span2").html("Step: "+s)},this.endRun=function(){}}const CLOCKTICK=100,MAXSTEPS=2e3,SCREENSHOT_STEP=200,BOXSIZE=4,BOXPOS=10,LIGHTRADIUS=20,startRadius=60,maxRadius=1e3,TEXTURE_FILE_0="/uploads/starter/smiley.png",TEXTURE_FILE_1="/uploads/starter/ghost.3.png",TEXTURE_GROUND="/uploads/starter/rocks.jpg",SOUND_COLLISION="/uploads/starter/wooden.mp3",SKYCOLOR=16777164,HIGH_FRICTION=.8,MEDIUM_FRICTION=.6,LOW_RESTITUTION=.3,MUSIC_BACK="/uploads/kian/8-bit-Dancer2.mp3";