This is a lightning source code, find online, but part of js no matter together or apart, useless, what is this excuse me?
<script>
//start game
The function start () {
//alert (" start ");
FighterMove ();//call fighter move way
//fireBullet ();//call the fire Bullet way
EnemyMove ();//call the enemy move way
BackgroundMove ();//call background loop moving way
Timer=setInterval (fireBullet "()", 100);
Timers=setInterval (enemyFiredBullet "()", 2000);
}
//background loop moving
j=0;
The function backgroundMove () {
//alert (" backgroundMove ");
j++;
Interface. Style. BackgroundPosition="0" + j;
SetTimeout (backgroundMove "()", 16);
}
//control fighter move
The function fighterMove () {
//alert (" fighterMove ");
Document. The onkeydown=keydown;
The function keydown (e) {
Var keyName=String. FromCharCode (e.w hich);
//alert (keyName);
//turn up
If (keyName=="& amp;" & & ParseInt (fighter. Style. Top) & gt; 50) {
//alert (" up ");
Top -=10;
Fighter. Style. The top=parseInt (fighter. Style. Top) - 10;
}
//turn down
If (keyName=="(" & amp; & ParseInt (fighter. Style. Top) & lt; 470) {
//alert (" down ");
Top +=10;
Fighter. Style. The top=parseInt (fighter. Style. Top) + 10;
}
//turn left
If (keyName=="%" & amp; & The parseInt (fighter. Style. Left) & gt; 10) {
//alert (" left ");
Left -=10;
Fighter. Style. Left=parseInt (fighter. Style. Left) - 10;
}
//turn right
If (keyName=="'" & amp; & The parseInt (fighter. Style. Left) & lt; 360) {
//alert (" right ");
Left +=10;
Fighter. Style. Left=parseInt (fighter. Style. Left) + 10;
}
//the fighter fire bullet
//if (keyName=="A") {
//alert (" bulletFire ");
//fireBullet ();
//}
}
}
//the fire bullet
Var top="440";
Var left="220";
The function fireBullet () {
Var bullets;
//alert (" fireBullet ");
CreateBullet ();
//create bullet
The function createBullet () {
Bullets=document. The createElement method (" div ");
Bullets. Style. The width="5 px";
Bullets. Style. Height="5 px";
Bullets. Style. Background="red";
//alert (" ok ");
Bullets. Style. The position="absolute";
Bullets. Style. The top=top;
Bullets. Style. Left=left;
Document. The body. The appendChild (bullets);
//alert (document. The body. The appendChild (bullets));
}
Time=setInterval (function () {
//alert (" time ");
Bullets. Style. The top=parseInt (bullets. Style. Top) - 10;
If (parseInt (bullets. Style. Top) & lt; 30) {
//alert (" none ");
Bullets. Style. The display="none";
}
//bullet hit the enemy, change image
If (parseInt (bullets. Style. Top) - parseInt (enemy. Style. Top) & lt; 50
& & The parseInt (bullets. Style. Left) - parseInt (enemy. Style. Left) & lt; 30
& & ParseInt (bullets. Style. Top) & gt; The parseInt (enemy. Style. Top)
& & The parseInt (bullets. Style. Left) & gt; The parseInt (enemy. Style. Left)) {
//alert (" burst ");
Enemy. Style. Background="url (hong2. PNG)";
}
If (parseInt (bullets. Style. Top) - parseInt (enemy1. Style. Top) & lt; 50
& & The parseInt (bullets. Style. Left) - parseInt (enemy1. Style. Left) & lt; 30
& & ParseInt (bullets. Style. Top) & gt; The parseInt (enemy1. Style. Top)
& & The parseInt (bullets. Style. Left) & gt; The parseInt (enemy1. Style. Left)) {
//alert (" burst ");
Enemy1. Style. Background="url (hong2. PNG)";
}
If (parseInt (bullets. Style. Top) - parseInt (enemy2. Style. Top) & lt; 50
& & The parseInt (bullets. Style. Left) - parseInt (enemy2. Style. Left) & lt; 30
& & ParseInt (bullets. Style. Top) & gt; The parseInt (enemy2. Style. Top)
& & The parseInt (bullets. Style. Left) & gt; The parseInt (enemy2. Style. Left)) {
//alert (" burst ");
Enemy2. Style. Background="url (hong2. PNG)";
}
If (parseInt (bullets. Style. Top) - parseInt (enemy3. Style. Top) & lt; 50
& & The parseInt (bullets. Style. Left) - parseInt (enemy3. Style. Left) & lt; 30
& & ParseInt (bullets. Style. Top) & gt; The parseInt (enemy3. Style. Top)
& & The parseInt (bullets. Style. Left) & gt; The parseInt (enemy3. Style. Left)) {
//alert (" burst ");
Enemy3. Style. Background="url (hong2. PNG)";
}
}, 60);
}
//enemy move
The function enemyMove () {
//alert (" enemyMove ");
Var left1=parseInt (Math. The random () * 3);
Var left2=parseInt (Math. The random () * 3);
Times=setInterval (function () {
Enemy. Style. The top=parseInt (enemy. Style. Top) + 4;
Enemy1. Style. The top=parseInt (enemy1. Style. Top) + 3;
Enemy2. Style. The top=parseInt (enemy2. Style. Top) + 3;
Enemy3. Style. The top=parseInt (enemy3. Style. Top) + 2;
//enemy2. Style. Left=parseInt (enemy2. Style. Left) + left1;
//enemy3. Style. Left=parseInt (enemy3. Style. Left) - left2;
If (parseInt (enemy. Style. Top) & gt; 450) {
//alert (" stop ");
Var num=parseInt (Math. The random () * 350);
//alert (num);
Enemy. Style. The top=50;
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull