📄 月光软件站 - 编程文档 - script - javascript 寫遊戲 俄羅斯方塊.htm
字号:
(NewBlock[k][i][y].toString().match(/\d+/)==null)?0:NewBlock[k][i][y].join('').match(/\d+/).toString().length;<BR> }<BR>NewBlock[k][i].lg
= 1;<BR>for(var
y=0;y<NewBlock[k][i].length;y++){<BR> NewBlock[k][i].lg =
Math.max(NewBlock[k][i][y].lg,NewBlock[k][i].lg);<BR> }<BR>}</P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P>function
document.onkeydown(){<BR>switch(event.keyCode){<BR> case
34:clearInterval(GoTime);oSpeed+=10;if(GoTime>0){Dir(0,1);GoTime=setInterval('Dir(0,1)',oSpeed)};break;//page
up<BR> case
33:if(oSpeed-10>0){clearInterval(GoTime);oSpeed-=5};if(GoTime>0){Dir(0,1);GoTime=setInterval('Dir(0,1)',oSpeed);};break;//page
down<BR> case
38:if(GoTime>0)GoTime2=setInterval("Dir(0,1)",1);break;//up<BR> case
37:CheckKeyDown(-1,0,150,20);break;//left<BR> case
39:CheckKeyDown(1,0,150,20);break;//right<BR> case
40:CheckKeyDown(0,1,150,20);break;//down<BR> case
96:if(GoTime>0)ChangeBlock();break;//0<BR> case
83:CheckStart();break;<BR> }<BR>}</P>
<P> </P>
<P>function document.onkeyup(){<BR>DoKeyDown=false<BR>}</P>
<P>function CheckKeyDown(x,y,t1,t2){<BR>if(GoTime>0 &&
!DoKeyDown){<BR> Dir(x,y)<BR> DoKeyDown=true<BR> setTimeout("if(DoKeyDown)KeyDownAgain("+x+","+y+","+t2+");",t1)<BR> }<BR>}</P>
<P>function KeyDownAgain(x,y,t2){<BR>if(GoTime>0 &&
DoKeyDown){<BR> Dir(x,y)<BR> setTimeout("KeyDownAgain("+x+","+y+","+t2+")",t2)<BR> }<BR>}</P>
<P> </P>
<P><BR>function CheckStart(){<BR>if(GoTime ==
-1){<BR> CheckBlockAppear();<BR> GoTime =
0;<BR> ReadyForDown(Obj2,ReadyBlockDiv);<BR> }<BR>if(!GoTime){<BR> Dir(0,1);<BR> GoTime
=
setInterval('Dir(0,1)',oSpeed);<BR> }<BR>else{<BR> clearInterval(GoTime);<BR> GoTime
= 0;<BR> }<BR>}</P>
<P><BR>var Map = [];<BR>var NewBlock = [];<BR>var Areas = 0;<BR>var
GoTime = -1, GoTime2;<BR>var FullString = '';<BR>var Obj1 = new
Object();<BR>var Obj2 = new Object();<BR>var DoKeyDown=false</P>
<P> </P>
<P>window.focus();<BR>var iHtml = '';<BR>var BaseWidth =
Cells*ObjW;<BR>var BaseHeight = Rows*ObjH;<BR>var MainMapWidth =
2*BaseBW+Cells*ObjW;<BR>var MainMapHeight =
2*BaseBW+Rows*ObjH;<BR>document.body.innerHTML += "<font
color=red>press \"s\" button to Star or Stop<br>press \"0\"
button to Change Quadrel into Another Shape<br>press \"Page
Up\" to Speed up<br>press \"Page Down\" to Speed
down</font><span
style='position:absolute;left:"+(document.body.clientWidth-MainMapWidth)/2+";top:"+(document.body.clientHeight-MainMapHeight)/2+";width:"+MainMapWidth+";height:"+MainMapHeight+";overflow:visible;border:"+BaseBW+"
inset #0000CC;'><span
style='position:absolute;left:0;top:0;width:"+BaseWidth+";height:"+BaseHeight+";filter:glow(color="+GlowColor+",strength="+GlowStrength+");'><span
id='BaseDiv'
style='position:absolute;left:0;top:0;width:"+BaseWidth+";height:"+BaseHeight+";filter:flipv;'></span></span><span
id=SkinDiv style='position:absolute;'></span><span
id='ReadyBlockDiv'
style='position:absolute;left:"+MainMapWidth+";top:0;'></span><span
id=ScoreDiv
style='position:absolute;left:"+(MainMapWidth+50)+";top:"+(MainMapHeight-20)+";'>"+Scores+"</span></span>";<BR>for(var
i=0,k=Cells*Rows;i<k;i++){iHtml += "<span
style='width:"+ObjW+";height:"+ObjH+";border:"+BlockBW+" "+BlockBS+"
"+BlockBC+";overflow:hidden;visibility:hidden;'></span>"}<BR>for(var
i=0;i<Block.length;i++) NewBlock[i]=[]<BR>FullString = new
Array(Cells+1).join("1")<BR>for(var
y=0;y<Rows;y++){<BR> Map[y] = [];<BR> for(var
x=0;x<Cells;x++) Map[y][x]=' ';<BR> }<BR>Areas =
Cells*(Rows-1);<BR>BaseDiv.innerHTML =
iHtml;<BR>ReadyForDown(Obj2,ReadyBlockDiv);</P>
<P></script><BR></P><IMG height=1
src="月光软件站 - 编程文档 - Script - JavaScript 寫遊戲 俄羅斯方塊.files/down_info.htm"
width=1 border=0><BR><BR></TD></TR>
<TR>
<TD width="100%" bgColor=#cccccc height=1></TD></TR>
<TR>
<TD width="100%"><BR><B>相关文章</B>:
<P><B>相关软件</B>:</P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></DIV>
<CENTER>
<SCRIPT src="月光软件站 - 编程文档 - Script - JavaScript 寫遊戲 俄羅斯方塊.files/bottom.js"
type=text/javascript></SCRIPT>
</CENTER>
<DIV id=objbottom align=center>
<CENTER>
<SCRIPT type=text/javascript>
var arrBaiduCproConfig=new Array();
arrBaiduCproConfig['uid'] =43125;
arrBaiduCproConfig['n'] ='williamlongcpr';
arrBaiduCproConfig['tm'] ='22';
arrBaiduCproConfig['cm'] ='72';
arrBaiduCproConfig['um'] ='22';
arrBaiduCproConfig['w'] ='728';
arrBaiduCproConfig['h'] ='90';
arrBaiduCproConfig['wn'] ='4';
arrBaiduCproConfig['hn'] ='1';
arrBaiduCproConfig['ta'] ='right';
arrBaiduCproConfig['tl'] ='bottom';
arrBaiduCproConfig['bu'] ='0';
arrBaiduCproConfig['bd'] ='#ffffff';
arrBaiduCproConfig['bg'] ='""';
arrBaiduCproConfig['tt'] ='#444444';
arrBaiduCproConfig['ct'] ='#000000';
arrBaiduCproConfig['url'] ='#000000';
arrBaiduCproConfig['bdl'] ='#ffffff';
arrBaiduCproConfig['rad'] =1;
</SCRIPT>
<SCRIPT src="月光软件站 - 编程文档 - Script - JavaScript 寫遊戲 俄羅斯方塊.files/ui.js"
type=text/javascript charset=gbk>
</SCRIPT>
<SCRIPT type=text/javascript>
<!--
document.write(baiduCproIFrame());
-->
</SCRIPT>
</CENTER></DIV>
<SCRIPT language=javascript>
if(document.all.item("objtop") != null)
{
objtop.innerHTML = objbottom.innerHTML
}
</SCRIPT>
<BR><BR><BR>
<DIV align=center>
<CENTER>
<TABLE style="FONT-SIZE: 9pt" cellSpacing=0 cellPadding=1 width=770 border=0>
<TBODY>
<TR>
<TD width=770 bgColor=#000000 height=1></TD></TR>
<TR>
<TD width=770 height=5></TD></TR>
<TR>
<TD align=middle width=770><A href="http://www.moon-soft.com/"
target=_top>月光软件</A>┊<A href="http://www.moon-soft.com/download/"
target=_top>程序下载</A>┊<A href="http://www.moon-soft.com/doc/"
target=_top>编程文档</A>┊<A href="http://www.moon-soft.com/book/"
target=_top>电脑教程</A>┊<A href="http://www.moon-soft.com/web/"
target=_top>网站设计</A>┊<A href="http://www.moon-soft.com/site/"
target=_top>网址导航</A>┊<A href="http://www.moon-soft.com/art/"
target=_top>网络文学</A>┊<A href="http://www.moon-soft.com/game/"
target=_top>游戏天地</A>┊<A href="http://www.moon-soft.com/joke/"
target=_top>幽默笑话</A>┊<A href="http://www.moon-soft.com/life/"
target=_top>生活休闲</A>┊<A href="http://www.moon-soft.com/picture/"
target=_top>美女图片</A>┊<A href="http://www.moon-soft.com/guestbook/"
target=_top>意见反馈</A><BR><A
href="http://www.moon-soft.com/program/bbs/docelite1105.htm">电脑技术</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite405353.htm">编程开发</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite25188.htm">网络专区</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite10811.htm">谈天说地</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite113108.htm">情感世界</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite872697.htm">游戏元素</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite50820.htm">分类游戏</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite166458.htm">热门游戏</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite42994.htm">体育运动</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite872698.htm">手机专区</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite28075.htm">业余爱好</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite34403.htm">影视沙龙</A><BR><A
href="http://www.moon-soft.com/program/bbs/docelite872701.htm">音乐天地</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite872702.htm">数码广场</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite121902.htm">教育园地</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite872703.htm">科学大观</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite991826.htm">古今纵横</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite49868.htm">谈股论金</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite55064.htm">人文艺术</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite165391.htm">医学保健</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite115338.htm">动漫图酷</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite872704.htm">二手专区</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite112364.htm">地方风情</A>┊<A
href="http://www.moon-soft.com/program/bbs/docelite165368.htm">各行各业</A><BR><BR><A
href="http://www.moon-soft.com/">月光软件站</A>·<A
href="http://www.moon-soft.com/sitemap.htm" target=_blank>版权所有</A>
</TD></TR></TBODY></TABLE></CENTER></DIV><BR><BR><BR><BR><BR><BR><!-- */ //--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -