?? 月光軟件站 - 編程文檔 - script - javascript 寫遊戲 搬運(yùn)工.htm
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0038)http://www.moon-soft.com/doc/14582.htm -->
<HTML><HEAD><TITLE>月光軟件站 - 編程文檔 - Script - JavaScript 寫遊戲 : 搬運(yùn)工</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="Script,JavaScript 寫遊戲 : 搬運(yùn)工,編程,文章,下載" name=keywords>
<META content="JavaScript 寫遊戲 : 搬運(yùn)工" name=description>
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<CENTER>
<SCRIPT src="月光軟件站 - 編程文檔 - Script - JavaScript 寫遊戲 搬運(yùn)工.files/top.js"
type=text/javascript></SCRIPT>
</CENTER>
<DIV id=header align=center>
<CENTER>
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=750
border=0>
<TBODY>
<TR>
<TD width="100%">您的位置:<A href="http://www.moon-soft.com/">首頁</A>-> <A
href="http://www.moon-soft.com/doc/index.htm">編程文檔</A>-> <A
href="http://www.moon-soft.com/doc/7_1.htm">Script</A>-> JavaScript 寫遊戲
: 搬運(yùn)工</TD></TR></TBODY></TABLE></CENTER></DIV>
<DIV id=main align=center>
<CENTER>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0
cellPadding=0 width=750 border=0>
<TBODY>
<TR>
<TD vAlign=top width=165>
<TABLE style="BORDER-COLLAPSE: collapse" height="100%" cellSpacing=0
cellPadding=0 width=165 bgColor=#f4f4f4 border=0>
<TBODY>
<TR>
<TD vAlign=top width="100%">
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=3
width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" bgColor=#000000>
<P align=center><B><FONT
color=#ffffff>Script</FONT></B></P></TD></TR>
<TR>
<TD width="100%">
<P align=center></P></TD></TR>
<TR>
<TD width="100%" bgColor=#000000>
<P><IMG height=13
src="月光軟件站 - 編程文檔 - Script - JavaScript 寫遊戲 搬運(yùn)工.files/d_1.gif"
width=13 align=middle border=0><FONT color=#ffffff>
本類閱讀TOP10</FONT></P></TD></TR>
<TR>
<TD width="100%">·<A
href="http://www.moon-soft.com/doc/19348.htm">可編輯的 HTML
JavaScript 表格控件 DataGrid II</A><BR>·<A
href="http://www.moon-soft.com/doc/18902.htm">JavaScript通用庫(一)</A><BR>·<A
href="http://www.moon-soft.com/doc/19592.htm">一個(gè)簡單的javascript菜單</A><BR>·<A
href="http://www.moon-soft.com/doc/19471.htm">層遇到select框時(shí)</A><BR>·<A
href="http://www.moon-soft.com/doc/19355.htm">javascript表單之間的數(shù)據(jù)傳遞!</A><BR>·<A
href="http://www.moon-soft.com/doc/19305.htm">在網(wǎng)頁中控制wmplayer播放器</A><BR>·<A
href="http://www.moon-soft.com/doc/19610.htm">網(wǎng)站流量統(tǒng)計(jì)代碼</A><BR>·<A
href="http://www.moon-soft.com/doc/19343.htm">讓網(wǎng)頁自動(dòng)穿上外套</A><BR>·<A
href="http://www.moon-soft.com/doc/2484.htm">24點(diǎn)終結(jié)者(javascript)</A><BR>·<A
href="http://www.moon-soft.com/doc/13758.htm">搜索gb2312漢字在網(wǎng)上的頻率</A><BR></TD></TR></TBODY></TABLE><BR>
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=3
width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" bgColor=#111111><FONT color=#ffff00>→</FONT>
<FONT color=#ffffff>分類導(dǎo)航</FONT></TD></TR>
<TR>
<TD width="100%">
<TABLE cellSpacing=3 cellPadding=0 width="99%" border=0>
<TBODY>
<TR align=middle>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/1_1.htm"><FONT
color=#000000>VC語言</FONT></A></TD>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/2_1.htm"><FONT
color=#000000>Delphi</FONT></A></TD></TR>
<TR align=middle>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/3_1.htm"><FONT
color=#000000>VB語言</FONT></A></TD>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/4_1.htm"><FONT
color=#000000>ASP</FONT></A></TD></TR>
<TR align=middle>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/5_1.htm"><FONT
color=#000000>Perl</FONT></A></TD>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/6_1.htm"><FONT
color=#000000>Java</FONT></A></TD></TR>
<TR align=middle>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/7_1.htm"><FONT
color=#000000>Script</FONT></A></TD>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/8_1.htm"><FONT
color=#000000>數(shù)據(jù)庫</FONT></A></TD></TR>
<TR align=middle>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/9_1.htm"><FONT
color=#000000>其他語言</FONT></A></TD>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/10_1.htm"><FONT
color=#000000>游戲開發(fā)</FONT></A></TD></TR>
<TR align=middle>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/11_1.htm"><FONT
color=#000000>文件格式</FONT></A></TD>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/12_1.htm"><FONT
color=#000000>網(wǎng)站制作</FONT></A></TD></TR>
<TR align=middle>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/13_1.htm"><FONT
color=#000000>軟件工程</FONT></A></TD>
<TD width="50%"><A
href="http://www.moon-soft.com/doc/14_1.htm"><FONT
color=#000000>.NET開發(fā)</FONT></A></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=3 cellPadding=0 width="99%" border=0>
<TBODY>
<TR align=middle>
<TD>
<FORM action=search.asp><INPUT
style="BORDER-RIGHT: #42a5f7 1px dotted; BORDER-TOP: #42a5f7 1px dotted; BORDER-LEFT: #42a5f7 1px dotted; BORDER-BOTTOM: #42a5f7 1px dotted"
size=12 name=k> <INPUT type=image
src="月光軟件站 - 編程文檔 - Script - JavaScript 寫遊戲 搬運(yùn)工.files/d_search.gif"
align=absMiddle value=submit border=0><INPUT type=hidden
value=info name=type></FORM></TD></TR></TBODY></TABLE>
<SCRIPT
src="月光軟件站 - 編程文檔 - Script - JavaScript 寫遊戲 搬運(yùn)工.files/js_ads_left.js"
type=text/javascript></SCRIPT>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top width=8
background="月光軟件站 - 編程文檔 - Script - JavaScript 寫遊戲 搬運(yùn)工.files/bg_shadow.gif"
bgColor=#ffffff></TD>
<TD vAlign=top width=595 height=2>
<TABLE style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse"
cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=article_title align=middle height=30><B>JavaScript 寫遊戲 :
搬運(yùn)工</B></TD></TR>
<TR>
<TD align=middle width="100%" bgColor=#888888 height=1></TD></TR>
<TR>
<TD width="100%" height=2></TD></TR>
<TR>
<TD width="100%" height=38>
<P align=center><B>作者</B>:未知 <B>來源</B>:月光軟件站<!--未知-->
<B>加入時(shí)間</B>:2005-2-28 月光軟件站</P></TD></TR>
<TR>
<TD vAlign=top width="100%">
<P><!-- <BR><A href="http://dwin.net/">http://dwin.net/</A><BR><A
href="http://dewin.tk/">http://dewin.tk/</A></P>
<P><BR>Copyright(c) 1998-2004 dewin all rights reserved</P>
<P>Start 2002-10-02 17:50<BR>Finish 2002-10-15
22:41<BR>Last Edit 2003-06-11
18:55<BR>--><BR><body><BR><style><BR>.Ground{}<BR>.Floor{}<BR>.Wall{border:2px
outset
#ADFF2F;background-color:#888888;z-index:0}<BR>.Aim{background-color:#FF69B4;filter:Alpha(opacity=100,FinishOpacity=0,Style=3);z-index:0}<BR>.Box{background-color:#87CEFA;filter:Alpha(opacity=0,FinishOpacity=100,Style=3);z-index:1}<BR>.Man{background-color:red;z-index:1;filter:filpv}<BR></style><BR><textarea
id=Info
rows=20>rddlllllluurrrDulllddrrRRRRuulDLrrdLulDDDldRuuurururrddLLLulDDDlddrrULuuuurrurDrdLLLulDDDDrddlluRuuuulllluurrrDulllddrrRurDDDDDldRuuuuuulullDldRRRurDDDDuuuululDldRRurDDDlDR</textarea><br><BR><input
type=button value='copy'
onclick='Info.select();document.execCommand("Copy")'><BR><input
type=button value='paste'
onclick='Info.focus();if(!/[^(l|r|u|d|L|R|U|D)]/g.exec(window.clipboardData.getData("Text")))document.execCommand("Paste")'><BR><input
type=button value='Auto Run'
onclick='Run()'><br><br></P>
<P>Boxes has Moved<br><input id=BoxMoveInfo readonly>
Steps<br><BR>Man has Moved<br><input id=ManMoveInfo
readonly> Steps</P>
<P><span id=Base
style='position:absolute;overflow:hidden'></span><BR><script></P>
<P>function init(){<BR>MainMap = [];</P>
<P>RePlayTime = 10 //million second<BR>MapW = MapH =
30;<BR>PushScrollNo = 30;<BR>BoxCompletes = 0;<BR>TotalBox = 0;</P>
<P>Timer = null;<BR>canMove = true<BR>BoxMoves = 0;<BR>Count =
-1;<BR>BackRecord = [];<BR>BoxMoveInfo.value =
0;<BR>ManMoveInfo.value = 0;<BR>}</P>
<P>/*<BR>W = Wall<BR>0 = Box<BR>@ = Box on Aim<BR>* = Man<BR># = Man
on Aim<BR>. = Aim<BR> = Space<BR>*/</P>
<P> </P>
<P>Map = [];<BR>Map[0] = [<BR>'WWWWWWWWWWW',<BR>'W
W* W',<BR>'W 00000 0
W',<BR>'W
W',<BR>'WWWWW WWWWW',<BR>' W .W
',<BR>' W .W ',<BR>'
W...W ',<BR>' W .W
',<BR>' WWWWW '<BR>]</P>
<P><BR>function ReadMap(k){<BR>init();<BR>Base.innerHTML =
'';<BR>var w=Map[k][0].length*MapW<BR>var
h=Map[k].length*MapW<BR>Base.style.width = w;<BR>Base.style.height =
h;<BR>Base.style.left =
(w>document.body.clientWidth)?0:(document.body.offsetWidth-w)/2;<BR>Base.style.top
= 10;<BR>for(var y=0;y<Map[k].length;y++){<BR> MainMap[y] =
[];<BR> for(var x=0;x<Map[k][y].length;x++){<BR>
MainMap[y][x] = Map[k][y].charAt(x);<BR>
if(MainMap[y][x]=='W')iHtml(x,y,'Wall');<BR>
else{<BR>
//if(MainMap[y][x]=="|"){iHtml(x,y,'Floor');MainMap[y][x]='
'}<BR> //else iHtml(x,y,'Ground');<BR>
iHtml(x,y,'Ground');<BR>
switch(MainMap[y][x]){<BR> case
'0':iBox(x,y,0);break;<BR> case
'.':iHtml(x,y,'Aim');break;<BR> case <A
href="mailto:'@':iHtml(x,y,'Aim');iBox(x,y,1);BoxCompletes++;break">'@':iHtml(x,y,'Aim');iBox(x,y,1);BoxCompletes++;break</A>;<BR>
case '*':iMan(x,y,0);break;<BR> case
'#':iHtml(x,y,'Aim');iMan(x,y,1);break;<BR>
}<BR> }<BR> }<BR> }<BR>}</P>
<P>function
iHtml(x,y,k){<BR>Base.insertAdjacentHTML("beforeEnd","<span
style='position:absolute;left:"+x*MapW+";top:"+y*MapH+";width:"+MapW+";height:"+MapH+"'
class='"+k+"' x="+x+" y="+y+">");<BR>}</P>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -