13、模拟跳舞游戏

13、模拟跳舞游戏

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var agt=navigator.userAgent.toLowerCase();

if (agt.indexOf("mac") != -1)

var a="\r";

else

var a="\n";

var max=0;

function tlist() {

max=tlist.arguments.length;

for (i=0; i<max; i++)

this[i]=tlist.arguments[i];

}

tl = new tlist(

"   o"+a+

"  /|\\"+a+

" */ \\*        跳舞"+a,

 

"   o_"+a+

"  \<| *"+a+

"  *\>\\         跳舞"+a,

 

"  _o/*"+a+

" * |"+a+

"  / \\         跳舞"+a,

 

" *\o_"+a+

"  /  *"+a+

" \<\\           跳舞"+a,

 

"  _o/*"+a+

" * |"+a+

"  / \\         跳舞"+a,

 

" *\\c/*"+a+

"   )"+a+

"  / \>         跳舞"+a,

 

"     *"+a+

"  \\__/c"+a+

"   \> \\*       跳舞"+a,

 

"   __/"+a+

"    (o_*"+a+

"     \\*       跳舞"+a,

 

"      \\ /"+a+

"       |"+a+

"     */o\\*    跳舞"+a,

 

"       \\_"+a+

"       ("+a+

"     */o\\*    跳舞"+a,

 

"        \<_"+a+

"      __("+a+

"     * o|*    跳舞"+a,

 

"         /_"+a+

"      __("+a+

"     * o|*   跳舞"+a,

 

"         ___"+a+

"      *\/ \>"+a+

"       o|*    跳舞"+a,

 

"        *"+a+

"       o|_/"+a+

"      */  \\   跳舞"+a,

 

"        *"+a+

"      _o|_"+a+

"     *   \>\\   跳舞"+a,

 

"       _o/*"+a+

"      * |"+a+

"       / \\    跳舞"+a,

 

"      *\\o/*"+a+

"        |"+a+

"       / \\    跳舞"+a,

 

"      c/*"+a+

"      \<\\"+a+

"      */\\     跳舞"+a,

 

"      c__"+a+

"      \<\ *"+a+

"      */\\     跳舞"+a,

 

"      c__"+a+

"      /\ *"+a+

"     * /\>     跳舞"+a,

 

"      c/*"+a+

"     /(__"+a+

"    * /       跳舞"+a,

 

"    __o/*"+a+

"    * (__"+a+

"      \<       跳舞"+a,

 

"      __o_"+a+

"     * /  *"+a+

"      \<\\      跳舞"+a,

 

"     *_o_"+a+

"       | *"+a+

"      \< \\     跳舞"+a,

 

"     *_c_*"+a+

"       |"+a+

"       \>\\     跳舞"+a,

 

"     *_c_*"+a+

"       |__"+a+

"       \>      跳舞"+a,

 

"     *_c_*"+a+

"     __|__"+a+

"              跳舞"+a,

 

" "+a+

"     *_c_*"+a+

"     __)__    跳舞"+a,

 

" "+a+

"     *\\c/*"+a+

"     __)__    跳舞"+a

 

);

var x=0;

function tick() {

document.animation.cheerleader.value = " " + a +

tl[x];

x++;

if (x != max)

setTimeout("tick()", 200);

else

x = 0;

}

//  End -->

</script>

<form name=animation>

<textarea name=cheerleader rows=5 cols=20&rt;</textarea&rt;

<br>

<input type=button value="Start Again" onClick = "javascript:tick()">

</form>

 

 

 

第二步:<body>区域中的内容改为:

<BODY bgcolor="#fef4d9" OnLoad="tick()">

 

Write a comment

Comments: 1
  • #1

    hao136 (Tuesday, 29 December 2009 21:55)

    请问一下 <BODY bgcolor="#fef4d9" OnLoad="tick()">
    这句在什么地方改啊,?谢谢