Code viewer for World: AlienLab (clone by Cbum)

// Cloned by Cbum on 5 Dec 2022 from World "AlienLab" by Dylan Corbari 
// Please leave this clone trail here.
 
const SKYBOX_ARRAY=["/uploads/dg/right.jpg","/uploads/dg/left.jpg","/uploads/dg/top.jpg","/uploads/dg/bot.jpg","/uploads/dg/front.jpg","/uploads/dg/back.jpg"],shot="uploads/corbard2/Untitledvideo-MadewithClipchamp1.mp3",fiveScore="uploads/corbard2/Triplekill.mp3",thirtyScore="uploads/corbard2/Killingspree.mp3",SeventyScore="uploads/corbard2/Halo3Overkill.mp3.mp3",hundredScore="uploads/corbard2/Killtacular.mp3";function initScene(){AB.headerWidth(350);var e=new THREE.Color(16711680);ABWorld.init2d(290,700,e),ABWorld.scene.background=(new THREE.CubeTextureLoader).load(SKYBOX_ARRAY,function(){ABWorld.render(),AB.removeLoading(),AB.runReady=!0})}document.body.style.cursor="url('https://ancientbrain.com/uploads/corbard2/bestcrosshairever.cur'), auto",AB.newSplash(splashScreenStart()),document.getElementById("splashbutton").id="startsplash",AB.world.newRun=function(){AB.socketStart(),initScene(),AB.runReady=!1,cameraControls(),addLight(),loadImg(),loadImg2()};const gameClock=new THREE.Clock;var allCircles=new Array(0);function loadImg(){(new THREE.GLTFLoader).load("/uploads/corbard2/Sci-fiNailGun.glb",function(e){var o=e.scene;o.scale.set(15,15,15),o.position.set(120,150,100),o.rotation.set(181,60,0),ABWorld.scene.add(o)})}function loadImg2(){(new THREE.GLTFLoader).load("/uploads/corbard2/ufo.glb",function(e){var o=e.scene;o.scale.set(45,45,45),o.position.set(-150,90,-100),o.rotation.set(181,60,0),ABWorld.scene.add(o)})}function addLight(){var e=new THREE.PointLight(16777215,1,1e3);e.position.set(0,0,0),ABWorld.scene.add(e)}function redLight(){var e=new THREE.PointLight(16711680,.2,1e3);e.position.set(0,0,0),ABWorld.scene.add(e)}function goldLight(){var e=new THREE.PointLight(16766720,10,1e3);e.position.set(0,0,0),ABWorld.scene.add(e)}AB.world.nextStep=function(){32==Math.trunc(gameClock.getElapsedTime())&&(AB.runReady=!1,AB.newSplash(splashScreenEnd()),document.getElementById("splashbutton").innerHTML="Play Again",document.getElementById("splashbutton").onclick=reload),allCircles.length<max_circles&&spawnCircle(),AB.socket&&AB.socket.connected&&(AB.socketOut(p1score),AB.msg("P1 Score = "+p1score+" P2 score = "+p2score+"\n Time remaining: "+Math.trunc(32-gameClock.getElapsedTime())))};var gridSetup=[[-100,0,100],[-100,0,0],[-100,0,-100],[0,0,100],[0,0,0],[0,0,-100],[100,0,100],[100,0,0],[100,0,-100]],max_circles=3;function spawnCircle(){var e=(new THREE.TextureLoader).load("/uploads/corbard2/sadAlien.jpg"),o=new THREE.SphereGeometry(30,64,32),r=new THREE.MeshBasicMaterial({map:e}),t=new THREE.Mesh(o,r);t.rotation.set(181,80,0);var n=AB.randomIntAtoB(0,gridSetup.length),a=gridSetup[n];t.position.set(a[0],a[1],a[2]),ABWorld.scene.add(t),gridSetup.splice(n,1),allCircles.push(t)}function mouseDrag(e,o){}function cameraControls(){ABHandler.initMouseDrag=mouseClick,ABHandler.mouseDrag=mouseDrag}var x=0;function mouseClick(e,o){audioHandler("shoot"),5==p1score&&audioHandler("fiveScore"),35==p1score&&audioHandler("thirtyScore"),70==p1score&&audioHandler("SeventyScore"),100==p1score&&audioHandler("hundredScore"),targetHit(e,o),p1score--}var p1score=0,p2score=0;function targetHit(e,o){if(allCircles.length>0)for(var r=0;r<allCircles.length;r++){10==p1score&&redLight(),20==p1score&&redLight(),30==p1score&&redLight(),40==p1score&&redLight(),50==p1score&&redLight(),60==p1score&&redLight(),70==p1score&&redLight(),80==p1score&&redLight(),90==p1score&&redLight(),100==p1score&&goldLight();var t=allCircles[r];if(ABWorld.hitsObject(e,o,t)){var n=[t.position.x,t.position.y,t.position.z];gridSetup.push(n),ABWorld.scene.remove(t),allCircles.splice(r,1),p1score+=2;break}}}function audioHandler(e){"shoot"==e&&new Audio(shot).play(),"fiveScore"==e&&new Audio(fiveScore).play(),"thirtyScore"==e&&new Audio(thirtyScore).play(),"SeventyScore"==e&&new Audio(SeventyScore).play(),"hundredScore"==e&&new Audio(hundredScore).play()}function splashScreenStart(){var e="<p>Shoot as many targets as you can in 30 seconds.</p>";return e+="<p>Aim with your mouse and click to shoot. Misses result in a -1 score.</p>",e+="<p>Use scroll wheel to adjust camera distance.</p>",e+="<p>Two players must start at same time to make use of 1v1 feature!!!</p>",e+="<p>Current High Score: 151 Set by: dylzu</p>",e+="<p>DM dylzu#0001 on discord with video proof for highscore submissions!</p>"}function splashScreenEnd(){var e="<h2>Game Over!</h2>";return p1score>p2score?e+="<p>You Won!</p>":p1score<p2score?e+="<p>You Lost!</p>":p1score==p2score&&(e=(e+="<p>Draw</p>")+"<p>vv Both had a score of vv</p>"+p2score),e=(e=e+"<p>Your score:</p>"+p1score)+"<p>Opponent score:</p>"+p2score}function reload(){location.reload()}$("#startsplash").click(function(){AB.runReady=!0,AB.removeSplash()}),AB.socketIn=function(e){p2score=e};