Alternative Impact Games

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

<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> Alternative Impact Games </title> </pead> <body> <body onload=initgame () > < center> <BR></CENTER> <script language=javascript> function killerrors () {return true;} Window.onerror = killerrors; </SCRIPT> <CENTER> <table bordercolor= #000033 border=0 borderlight= "Green" > <TBODY> < tr> <td align=middle> <script language=javascript> var CRLF = "RN"; var x = 1; var y = 1; var dx = 1; var dy = 1; var s = ""; var u = 0; var oops_flag = false; var score = 0; function move1 () {x = + dx; if (x >) {x = 2 * math.abs (DX); if (dx > 0) dx =-DX; } if (x < 0) {x + = 2 * math.abs (DX); if (DX < 0) dx =-DX; } y + dy; if (Y >) {y-= 2 * math.abs (DY); if (dy > 0) dy =-dy; if (Math.Abs (x-2*u-1) > 2) {Oops_flag = true; else {score = 1; } if (Y < 0) {y + = 2 * Math.Abs (DY); if (dy < 0) dy =-dy; } function Display1 () {var S1 = "" Var i,j; if (Oops_flag) return "Sorry, you lost, please start again!!!"; for (j=0;j<15;j++) {for (i=0;i<32;i++) {if (j = = y && i = = x) S1 + = "@"; else S1 + = "."; } S1 + = CRLF; The var s2 = "" for (i=0;i<16;i++) {if (U = i) s2 = = "= = ="; else s2 + = "..."; Return (S1+S2)} var timerid = null; var timerrunning = false; var MyForm; function Stopclock () {if (timerrunning) cleartimeout (Timerid); Timerrunning = false; function Startclock (form) {MyForm = form; Oops_flag = false; if (Navigator.userAgent.indexOf ("Mac") > 2) CRLF = "n"; // Make sure the clock is stopped Stopclock (); Dotime (); function Dotime () {move1 (); if (MyForm!= null) {Myform.text3.value = Display1 (); Myform.score.value = "" + score; } if (!oops_flag) Timerid = settimeout ("Dotime ()", 200); Timerrunning = true; } </SCRIPT> <form name=myform> <textarea name=text3 rows=16 cols=34> [game Area]
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.