您好,欢迎来到模板无忧!
登录
注册
闂傚倸鍊搁崐宄懊归崶顒€违闁逞屽墴閺屾稓鈧綆鍋呭畷宀勬煛瀹€鈧崰鏍€佸☉妯峰牚闁告劗鍋撳В澶嬩繆閻愵亜鈧垿宕曟繝姘闁跨噦鎷�
闂傚倸鍊搁崐鐑芥嚄閸洖绠犻柟鎹愵嚙鐟欙箓鎮楅敐搴″闁搞劍绻堥獮鏍庨鈧俊鑲╃棯閹佸仮闁哄被鍔戦幃銈夊磼濞戞﹩浼�
闂傚倸鍊搁崐椋庢濮橆兗缂氬┑鐘崇閳锋棃鏌涢弴銊ヤ航闁绘柨妫欐穱濠囶敍濮樸儱浠洪悷婊呭鐢寮查幖浣圭叆闁绘洖鍊圭€氾拷
闂傚倸鍊烽悞锕傛儑瑜版帒鏄ラ柛鏇ㄥ灠閸ㄥ倸鈹戦崒婧撳湱绮eΔ鍛厸鐎广儱鍟俊浠嬫煕濞嗗繒绠婚柡灞诲姂閹倝宕掑☉姗嗕紦
模板无忧
网页特效
每日更新
|
TOP排行榜
|
Tag标签
|
充值
无忧首页
网页模板
程序模板
建站教程
视频教程
网页特效
图标素材
字体下载
站长工具
站长问答
关闭顶部
展开顶部
网页特效
菜单导航
图片特效
文本链接
层和布局
页面背景
表单按钮
日期时间
计算转换
键盘鼠标
浏览器
游戏娱乐
综合其它
常用代码
jQuery特效
Prototype
Ajax/JavaScript
ExtJS
CSS特效
在线编辑器
Mootools
HTML
JS广告代码合集
站长工具
站长常用软件
网站综合查询
Alexa排名查询
Google PR查询
域名Whois查询
网站收录查询
友情链接查询
CSS2中文手册
CSS精简优化工具
AI閻忓繐绻楁禒锟� 闁煎疇妫勯崯鎾村濮樿鲸鏆�
闁糕晝鍠庨幃锟�
闁规亽鍔忓畷锟�
展开边栏
关闭边栏
网页特效代码
模板无忧
>
网页特效
>
游戏娱乐特效代码
>
收藏
分享
查看评论
游戏娱乐
演示
双人围格子游戏_游戏娱乐特效
查看演示效果
特效Tag:
双人
格子
添加
缂備礁娲﹂埅绀慹deCMS閻熸瑥妫濋。鍫曞极濞嗘垟鏌�
濞戞梹澹嗛埞鏍⒒閿燂拷 缂佸鍠愬﹢鍥礉閳ヨ櫕鐝� 闂侇偄顦辩紞澶屾兜閺囨氨闉嶉柤杈ㄦ缁憋拷
闁哄啰濮撮崪鏍博濞嗘挻姣愮€规悶鍎遍崣锟�,闁谎勫劤鐎规娊寮堕崘顔兼濞戞挴鍋撻梺娆惧枛閸欏繘寮婚敓锟�!
双人围格子游戏,您可以先修改部分代码再运行.
<head><script> function ShowMenu(bMenu) { document.all.idFinder.style.display = (bMenu) ? "none" : "block" document.all.idMenu.style.display = (bMenu) ? "block" : "none" idML.className = (bMenu) ? "cOn" : "cOff" idRL.className = (bMenu) ? "cOff" : "cOn" return false } </script> <script> <!-- function addList(url,desc) { if ((navigator.appName=="Netscape") || (parseInt(navigator.appVersion)>=4)) { var w=window.open("","_IDHTML_LIST_","top=0,left=0,width=475,height=150,history=no,menubar=no,status=no,resizable=no") var d=w.document if (!w._init) { d.open() d.write("<TITLE>Loading...</TITLE><EM>Loading...</EM>") d.close() d.location.replace("/assist/listing.asp?url="+escape(url)+"&desc="+escape(desc)) w.opener=self window.status="Personal Assistant (Adding): " + desc } else { window.status=w.addOption(url,desc) w.focus() } } else alert("Your browser does not support the personal assistant.") return false } // --> </script> <style> <!-- A.cOn {text-decoration:none;font-weight:bolder} #article {font: 12pt Verdana, geneva, arial, sans-serif; background: white; color: black; padding: 10pt 15pt 0 5pt} #article P.start {text-indent: 0pt} #article P {margin-top:0pt;font-size:10pt;text-indent:12pt} #article #author {margin-bottom:5pt;text-indent:0pt;font-style: italic} #pageList P {padding-top:10pt} #article H3 {font-weight:bold} #article DL, UL, OL {font-size: 10pt} --> </style> <style> #board {font-family: arial} .dot {position: absolute; width: 5px; height: 5px; font-size: 0pt; background: black} #line {position: absolute; font-size: 0pt; height: 5px} .p1 {position: absolute; font-size: 0pt;background: navy} .p2 {position: absolute; font-size: 0pt; background: red} .p1B {position: absolute; font-size: 8pt; color: navy;text-align: center; font-weight: bold} .p2B {position: absolute; font-size: 8pt; color: red; text-align: center; font-weight: bold} </style></head><body><table width="90%" border="1"> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="44%" height="11" align="center"><font color="#FF0000"><b>红方得分:</b></font></td> <td id="red" height="11" width="6%">0</td> <td width="44%" height="11" align="center"><font color="#0000CC"><b><font color="#003399">蓝方得分:</font></b></font></td> <td id="navy" height="11" width="6%">0</td> </tr> </table> </td> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="35%" align="right">游戏大小:</td> <td width="15%"> <input type="Text" value="5" id="setSize" size="2" name="Text2"> </td> <td align="center" width="50%"> <input type="button" onClick="createGame()" value="重新开始" name="button2"> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr align="center"> <td height="30"> <p class="start" id="message">蓝方先走!!!</p> </td> </tr> <tr align="center"> <td> <script> /* DHTML Dots is copyright 1998 insideDHTML.com, LLC. All rights reserved. DHTML Dots cannot be reproduced in any manner without prior consent from insideDHTML.com */ var scale= 25 var size = 5 var totalSize = ((size+1)*scale) + 6 var cache = new Object() var move=0,point=0 var player = true function initCache() { cache.x = 0 cache.y = 0 cache.red = 0 cache.navy = 0 move=0,point=0 } function updateScore() { document.all.red.innerText = cache.red document.all.navy.innerText = cache.navy if ((cache.red+cache.navy)==((size-1)*(size-1))) { board.onclick = null document.all.message.innerText = "游戏结束!" } } function fillPos(x,y) { document.all.board.insertAdjacentHTML("beforeEnd","<DIV class=" + (player ? "p1B" : "p2B") + " ID=\"point"+point+"\">" + (player ? "N" : "R") + "</DIV>") var el = document.all["point"+point].style el.pixelTop = (y*scale)+5 el.pixelLeft = (x*scale)+5 el.pixelWidth = scale - 5 el.pixelHeight = scale - 5 } function checkBoard(x,y,dir, player) { var piece=0 if ("vertical"==dir) { if ((x==size) || (x>1)) { var bPos = boardArray[x-1][y] var nextV = boardArray[x-1][y+1] if ((bPos["vertical"]) && (bPos["horizontal"]) && (nextV["horizontal"])) { point++ piece++ fillPos(x-1,y) } } if ((x==1) || (x<size)) { var nextV = boardArray[x+1][y] var nextH = boardArray[x][y+1] if ((nextV["vertical"]) && (nextH["horizontal"]) && (boardArray[x][y]["horizontal"])) { point++ piece++ fillPos(x,y) } } } else { if ((y==size) || (y>1)) { var nextV = boardArray[x+1][y-1] var bPos = boardArray[x][y-1] if ((bPos["vertical"]) && (bPos["horizontal"]) && (nextV["vertical"])) { point++ piece++ fillPos(x,y-1) } } if ((y==1) || (y<size)) { var nextV = boardArray[x+1][y] var nextH = boardArray[x][y+1] if ((nextV["vertical"]) && (nextH["horizontal"]) && (boardArray[x][y]["vertical"])) { point++ piece++ fillPos(x,y) } } } if (piece>0) { if (player) cache.navy+=piece else cache.red+=piece document.all.message.innerText = "得分! 继续走." updateScore() return player } else return !player } function doMouseMove() { if (event.srcElement.className!="dot") { var x = Math.floor(event.offsetX / scale) var y = Math.floor(event.offsetY / scale) var dirX = (event.offsetX % scale) var dirY = (event.offsetY % scale) if ((x<size+1) && (y<size+1) && (y>0) && (x>0)) { if (dirX>=dirY) { if (x<size) { line.style.pixelHeight = 5 line.style.pixelWidth = scale - 5 line.style.pixelTop = (y * scale) line.style.pixelLeft = (x * scale) + 5 cache.direction = "horizontal" } } else { if (y<size) { line.style.pixelWidth = 5 line.style.pixelHeight = scale - 5 line.style.pixelTop = (y * scale) + 5 line.style.pixelLeft = x * scale cache.direction = "vertical" } } cache.x = x cache.y = y } } } function doClick() { if (cache.x==0) return if (boardArray[cache.x][cache.y][cache.direction]) document.all.message.innerText="错误!请重新选择。" else { document.all.board.insertAdjacentHTML("beforeEnd","<DIV class=" + (player ? "p1" : "p2") + " ID=move"+move+"></DIV>") var el = document.all["move"+move] el.style.top = line.style.top el.style.left = line.style.left el.style.width = line.style.width el.style.height = line.style.height boardArray[cache.x][cache.y][cache.direction]=true var nextPlayer = checkBoard(cache.x,cache.y,cache.direction, player) if (nextPlayer!=player) { player = nextPlayer if (player) { document.all.message.innerText = "轮到蓝方走" line.style.border = "1px navy solid" } else { document.all.message.innerText = "轮到红方走" line.style.border = "1px red solid" } } } move++ } function buildDiv(x,y, scale) { return ("<DIV CLASS=dot STYLE=\"top:" + (x*scale) + "; left: " + (y*scale) + "\"></DIV>") } var boardArray = new Object function buildBoard() { initCache() board = ("<DIV ID=line STYLE=\"border: 1px navy solid; width: 0; height: 0\"></DIV>") boardArray = new Object() for (var x=1; x < size+1; x++) { boardArray[x] = new Object() for (var y=1; y < size+1; y++) { boardArray[x][y] = new Object boardArray[x][y]["vertical"] = false boardArray[x][y]["horizontal"] = false board+=(buildDiv(x,y, scale)) } } return board } function createGame() { size=parseInt(document.all.setSize.value) if (size>12) size=12 if (size<3) size=3 document.all.setSize.value = size document.all.board.innerHTML = buildBoard() document.all.board.onclick = doClick totalSize = ((size+1)*scale) + 6 document.all.board.style.pixelWidth = totalSize document.all.board.style.pixelHeight = totalSize document.all.message.innerText = "蓝方先走!!!" updateScore() } document.write("<DIV ID=board STYLE=\"position: relative; height: "+ totalSize + "; width:" + totalSize + "; border: 1px black solid\">" + buildBoard() + "</DIV>") document.all.board.onmousemove = doMouseMove document.all.board.onclick = doClick </script> </td> </tr> <tr> <td> </td> </tr> </table> </td> </tr> <tr> <td colspan="2">游戏提示:此游戏为一双人游戏,蓝方先走,看谁围的格子多。</td> </tr> </table></body>
所属频道:
游戏娱乐特效
/
更新时间:2013-05-04
[收藏]
[报错]
[返回列表]
评论加载中....
相关
游戏娱乐特效
:
扫雷游戏脚本版
贪吃蛇游戏
健康值测试
看谁围的框子多
电梯
猜数字
鼠标点击速度测试游戏
猜数字游戏
选择喜欢的女孩子类型噢~
速算训练 看看你的心算能力够不够好
试试你的运气找好东东
21点(黑杰克)
游戏娱乐特效Rss订阅
特效代码搜索
游戏娱乐特效推荐
健康值测试
爱情游戏测试
JavaScript猜数字游戏
类似于乒乓球的网页游戏
JavaScript撞球游戏
填空游戏 (不简单哟)
魔方游戏网页版
测测反应速度
你永远都别想碰到我,Js小游戏
钻石棋网页游戏代码
猜你也喜欢看这些
表格排序
页面保护 可以禁止某些IP的访问
在网页上显示腾讯天气预报的JS代码
常用的弹出广告及背投广告代码
JS大画幅遮屏广告
冒泡型事件
随屏幕滚动的带缓冲效果的右下角广告
Js获取适时获取鼠标坐标值并显示
滚动公告代码
有时间间隔的退弹窗口效果,JS代码
相关链接:
复制本页链接
|
搜索双人围格子游戏
特效说明:
游戏娱乐模板
-
双人围格子游戏
。
闂佽 鍋撻柟顖滃椤ワ拷&闂佸憡甯掑Λ鏃堟閿燂拷
QQ缂備礁鏈钘壩涢敓锟�
闂佸搫鍊绘晶妤€顫濋纰卞殫妞ゆ梻鍘х憴锟�
闂佺厧鐏氬畷姗€顢欓崱妤婂殫妞ゆ梻鍘х憴锟�
婵炲瓨绮忓銊バф径宀€纾鹃柨鐕傛嫹
閻庢鍠掗崑鎾荤叓閸パ冩殶缂傚稄鎷�
闂佽皫鍕姢閻庤濞婇獮鏍р堪閸℃﹩妫�
婵犮垼娉涚粔鎾春濡ゅ啰纾鹃柟瀛樼箖缁诧拷
闂佸搫娲﹀ḿ娆撍囬敓锟�...