JS Game-playing airplane game code

Source: Internet
Author: User
Tip: You can modify some of the code before running

JS Game-Play airplane game code <script language= "JavaScript" > var timerid = null; <!--Set Variable--> var patno = 1; <!--Set Variable--> var cr = "RN"; <!--Set Variable--> var spcf1 = ""; <!--Set Variable--> var spcf2 = ""; <!--Set Variable--> var spcf3 = ""; <!--Set Variable--> var hitflag = 0; <!--Set Variable--> var score = 0; <!--Set Variable--> var selec = 0; <!--Set Variable--> var rsmiss = ""; <!--Set Variable--> function array1 (ARN) {this.length = ARN; for (var ar1 = 0; ar1 <= Arn; ar1++) <!--set the bees to fly down--> {this[ar1] = 1; function init () {blankx = new array1 (63); <!--set array--> for (var makeblank = 0; Makeblank < makeblank++) {Blankx[makeblank] = ""; for (var addblank = 0; Addblank < Makeblank; addblank++) {Blankx[makeblank] = Blankx[makeblank] + "";}} Faker = new Array1 (24); <!--set array--> face = new Array1 (2); <!--set array--> face[1] = "(o_o)"; <!--set Bee style--> face[2] = "(o_o)"; <!--set Bee style--> mestotal = new Array1 (4); <!--set array--> interval1 (); function Restarter () {inplay = 0; blankno = 0; Totalblank = ""; LR = 1; Lowerlf = ""; DOWNLF = ""; Downno = 0; Missilex = 99; <!--set X-axis position--> Missiley = 99; <!--set Y-axis position--> Mychrx = 1; Myblank = ""; Mymove = 0; <!--set Mobile position--> Selec = 1; Starter (); Function Starter () {document.fmark.win.value=cr+cr+cr+cr+cr+cr+cr+cr+cr+cr+ "Play bee Game" +cr+cr+cr+ "please click Launch start Game"; <!--setting hint information--> Selec = 1; function Goleft () <!--set Move functions--> {mymove = 0; mychrx = mychrx-1; <!--set X axis left--> if (mychrx <= 0) {mychrx = 1;}} function GoRight () <!--set Move functions--> {mymove = 0 Mychrx = mychrx + 1; <!--set X axis to right--> if (Mychrx >=) {mychrx = 55;}} function Golmax () <!--set Move functions--> {if (InPlay = 1) {mymove =-1; <!--set X axis to move maximum-->}} function Gormax () <!--set Move function--> {if (InPlay = = 1) {mymove = 1; <!--set the x axis to the right to move the maximum-->}} function Fire () <!--set Firing function--> {if (inpla y = = 0) {if (Selec = = 1) {Selec = 9; inplay = 1; init ();}} else {if (Missiley = = 99) <!--determine the current position--> {Missiley = Missilex = Mychrx + 3;}} function Gameover () <!--set Game end functions--> {score = 0; for (var enerme = 1; enerm e < 25; enerme++) {if (faker[enerme] = = 1) <!--each knock off a bee--> {score = score + 1; <!---->} if (score = = 0) {Document.fmark.win.value = cr+cr+cr+cr+cr+cr+cr+cr+ "Congrat Ulations! " +cr+cr+ "You STOPPED the enemy squad!!"; <!--set the winning information-->} else {document.fmark.win.value=cr+cr+cr+cr+cr+cr+cr+cr+ "GAME over" +CR+CR + "" +sCore+ "Invaders GOT through"; <!--game end and show score-->} inplay = 0; function Interval1 () {if (Missiley!=) {Missiley = missiley-1;} Mychrx = Mychrx + mymove; <!--judge the mobile position--> if (mychrx <= 0) <!--to determine the current position--> {Mychrx = 1;} Blankno = Blankno + lr; Totalblank = Blankx[blankno]; if (Blankno >=) {lr =-1; downno = Downno + 1; blankno =;} if (Blankno <= 0) {lr = 1; downno = Downno + 1; Blankno = 0; } if (Downno >=) {Gameover ();} DOWNLF = ""; for (var upperspc = 0; upperspc < Downno; upperspc++) {if (Missiley = upperspc) {DOWNLF = DOWNLF + blankx[missilex]+ "|" +CR; else {DOWNLF = DOWNLF+CR;}} if (InPlay = = 1) {Patno = Patno + 1; if (Patno >= 3) {patno = 1;} for (var addline = 1; addline < 5; addline++) { Mestotal[addline] = Totalblank; Rsmiss = ""; for (var addfaker = 1; addfaker < 7; addfaker++) {(faker[(addline*6) +addfaker-6] = = 1) { Mestotal[addline] = Mestotal[addline]+face[patno]; }} spcf1 = CR; SPCF2 = CR; SPCF3 = CR; Lowerlf = ""; for (var lowerspc = 0; lowerspc < (11-downno); lowerspc++) {if (Missiley = (DOWNNO+7+LOWERSPC)) {Lowerlf = Lowerlf+b lankx[missilex]+ "|" +CR; else {Lowerlf = LOWERLF+CR;}} Myblank = Blankx[mychrx]; Document.fmark.win.value = downlf+mestotal[1]+cr+spcf1+mestotal[2]+cr+spcf2+mestotal[3]+cr+spcf3+mestotal[4]+cr+ lowerlf+myblank+ "" +cr+myblank+ "=!="; Timerid = settimeout ("Interval1 ()", 250); } </script> <center> <form method=post name=fmark> <table border=1 cellspacing=0 cellpadding=0 > <tr><td align=center> <textarea name=win rows=20 cols=63 wrap=virtual> -->
-->
Tip: You can modify some of the code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.