/***************************************************************************/ /* */ /* This obfuscated code was created by Javascript Obfuscator Free Version.*/ /* Javascript Obfuscator Free Version can be downloaded here */ /* http://javascriptobfuscator.com */ /* */ /***************************************************************************/ var _$_527e=["highScore","getItem","keydown","addEventListener","random","a","d"," ","w","s","key","x","speed","y","up","down","left","right","gameCanvas","getElementById","2d","getContext","fillStyle","#000000","fillRect","lime","red","width","height","yellow","white","Score: ","fillText","Time: ","Game Over! Your Score: ","\x0AHigh Score: "];var invaderLife=3;var onOff=false;var bulletInterval;var score=0;var highScore=localStorage[_$_527e[1]](_$_527e[0])|| 0;var gameDuration=60;var timeRemaining;var gameTimer;var w=false,a=false,s=false,d=false;window[_$_527e[3]](_$_527e[2],handleKeyPress);let enemy={x:Math[_$_527e[4]]()* 480,y:Math[_$_527e[4]]()* 480,width:20,height:20};let circle={x:175,y:450,radius:20,speed:7};let bullet={x:1175,y:450,radius:20,speed:20};function handleKeyPress(_0xBFD4){switch(_0xBFD4[_$_527e[10]]){case _$_527e[5]:moveLeft();break;case _$_527e[6]:moveRight();break;case _$_527e[7]:fireBullet();break;case _$_527e[8]:moveUp();break;case _$_527e[9]:moveDown();break};drawCircle()}function moveLeft(){w= false;a= true;s= false;d= false;circle[_$_527e[11]]-= circle[_$_527e[12]];if(circle[_$_527e[11]]< -37){circle[_$_527e[11]]= -37}}function moveRight(){w= false;a= false;s= false;d= true;circle[_$_527e[11]]+= circle[_$_527e[12]];if(circle[_$_527e[11]]> 425){circle[_$_527e[11]]= 425}}function fireBullet(){if(!onOff){bullet[_$_527e[13]]= circle[_$_527e[13]]- 30;bullet[_$_527e[11]]= circle[_$_527e[11]]+ 50;onOff= true;let _0xBF77=null;if(w){_0xBF77= _$_527e[14]}else {if(s){_0xBF77= _$_527e[15]}else {if(a){_0xBF77= _$_527e[16]}else {if(d){_0xBF77= _$_527e[17]}}}};bulletInterval= setInterval(()=>{if(_0xBF77=== _$_527e[14]){bullet[_$_527e[13]]-= bullet[_$_527e[12]]}else {if(_0xBF77=== _$_527e[15]){bullet[_$_527e[13]]+= bullet[_$_527e[12]]}else {if(_0xBF77=== _$_527e[16]){bullet[_$_527e[11]]-= bullet[_$_527e[12]]}else {if(_0xBF77=== _$_527e[17]){bullet[_$_527e[11]]+= bullet[_$_527e[12]]}}}};checkBulletCollision();if(bullet[_$_527e[11]]< -37|| bullet[_$_527e[11]]> 505|| bullet[_$_527e[13]]< -30|| bullet[_$_527e[13]]> 500){resetBullet()};drawCircle()},100)}}function moveUp(){w= true;a= false;s= false;d= false;circle[_$_527e[13]]-= 10;if(circle[_$_527e[13]]<= 40){circle[_$_527e[13]]= 40}}function moveDown(){w= false;a= false;s= true;d= false;circle[_$_527e[13]]+= 10;if(circle[_$_527e[13]]>= 500){circle[_$_527e[13]]= 500}}function drawCircle(){var _0xBEBD=document[_$_527e[19]](_$_527e[18]);var _0xBF1A=_0xBEBD[_$_527e[21]](_$_527e[20]);_0xBF1A[_$_527e[22]]= _$_527e[23];_0xBF1A[_$_527e[24]](0,0,500,500);_0xBF1A[_$_527e[22]]= _$_527e[25];_0xBF1A[_$_527e[24]](circle[_$_527e[11]]+ 36,circle[_$_527e[13]]- 40,40,40);_0xBF1A[_$_527e[24]](circle[_$_527e[11]]+ 48,circle[_$_527e[13]]- 55,15,45);_0xBF1A[_$_527e[24]](circle[_$_527e[11]]+ 48,circle[_$_527e[13]]- 27,15,45);_0xBF1A[_$_527e[24]](circle[_$_527e[11]]+ 48,circle[_$_527e[13]]- 27,45,15);_0xBF1A[_$_527e[24]](circle[_$_527e[11]]+ 20,circle[_$_527e[13]]- 27,45,15);_0xBF1A[_$_527e[22]]= _$_527e[26];_0xBF1A[_$_527e[24]](enemy[_$_527e[11]],enemy[_$_527e[13]],enemy[_$_527e[27]],enemy[_$_527e[28]]);_0xBF1A[_$_527e[22]]= _$_527e[29];_0xBF1A[_$_527e[24]](bullet[_$_527e[11]],bullet[_$_527e[13]],10,10);_0xBF1A[_$_527e[22]]= _$_527e[30];_0xBF1A[_$_527e[32]](_$_527e[31]+ score,10,20);_0xBF1A[_$_527e[32]](_$_527e[33]+ timeRemaining,10,40)}function checkBulletCollision(){if(bullet[_$_527e[13]]<= enemy[_$_527e[13]]+ enemy[_$_527e[28]]&& bullet[_$_527e[11]]>= enemy[_$_527e[11]]&& bullet[_$_527e[11]]<= enemy[_$_527e[11]]+ enemy[_$_527e[27]]){resetBullet();score++;teleportEnemy()}}function resetBullet(){bullet[_$_527e[13]]= 450;bullet[_$_527e[11]]= 1175;clearInterval(bulletInterval);onOff= false}function teleportEnemy(){enemy[_$_527e[11]]= Math[_$_527e[4]]()* (500- enemy[_$_527e[27]]);enemy[_$_527e[13]]= Math[_$_527e[4]]()* (500- enemy[_$_527e[28]])}function startGame(){score= 0;timeRemaining= gameDuration;drawCircle();gameTimer= setInterval(updateTimer,1000)}function updateTimer(){timeRemaining--;if(timeRemaining<= 0){endGame()};drawCircle()}function endGame(){clearInterval(bulletInterval);clearInterval(gameTimer);if(score> highScore){highScore= score;drawCircle()};alert(_$_527e[34]+ score+ _$_527e[35]+ highScore);resetGame()}function resetGame(){circle[_$_527e[11]]= 175;circle[_$_527e[13]]= 450;bullet[_$_527e[11]]= 1175;bullet[_$_527e[13]]= 450;enemy[_$_527e[11]]= Math[_$_527e[4]]()* 480;enemy[_$_527e[13]]= Math[_$_527e[4]]()* 480;drawCircle();startGame()}setInterval(teleportEnemy,5000);startGame()