最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

用vbs实现的连连看在线游戏_javascript技巧

来源:动视网 责编:小采 时间:2020-11-27 20:39:37
文档

用vbs实现的连连看在线游戏_javascript技巧

用vbs实现的连连看在线游戏_javascript技巧:在线演示 连连看_www.gxlcms.com_脚本之家 .mytb { FONT-WEIGHT: bolder; VERTICAL-ALIGN: middle; CURSOR: hand; COLOR: #FF6600; FONT-FAMILY: Wingdings; TEXT-ALIGN: center }
推荐度:
导读用vbs实现的连连看在线游戏_javascript技巧:在线演示 连连看_www.gxlcms.com_脚本之家 .mytb { FONT-WEIGHT: bolder; VERTICAL-ALIGN: middle; CURSOR: hand; COLOR: #FF6600; FONT-FAMILY: Wingdings; TEXT-ALIGN: center }


在线演示



连连看_www.gxlcms.com_脚本之家










连连看游戏:将两个相同格子连接起来就会消失,看谁连的快,限时10分钟!


align=center border=1>









用时:

border=1>

















































































































































































































height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>
height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40> height=40>






dim x,y
dim clickId
dim obj1,obj2,Flag1
dim Num1,Num2
dim mytime
dim Myrnd
dim x1,y1,x2,y2
Flag1=0
dim NumArray(10,17)
dim QuanArray(10,17)
dim LuJArray(10,17)
dim RTN,RTN1,RTN2
dim totalNum,lastNum
lastNum=0

'初始化数字数组开始
for x=0 to 10
for y=0 to 17
numArray(x,y)=0
QuanArray(x,y)=0
next
next
'初始化数字数组结束

for x=1 to 9
for y=1 to 16
window.execScript "td_" & X & "_" & y & ".innerText =" & chr(34) & "0" & chr(34),"vbs"
next
next

'随便放些数字开始
do
randomize
RndX=cint(rnd*9)+1
randomize
Rndy=cint(rnd*16)+1
randomize
Myrnd=cint(rnd*30)+1
window.execScript "lastNum=td_" & RndX & "_" & Rndy & ".innerText","vbs"

if lastNum="0" then
window.execScript "td_" & RndX & "_" & Rndy & ".innerText =" & Myrnd,"vbs"
NumArray(RndX,Rndy)=Myrnd
totalNum=totalNum+1
do
randomize
RndX=cint(rnd*9)+1
randomize
Rndy=cint(rnd*16)+1
window.execScript "lastNum=td_" & RndX & "_" & Rndy & ".innerText"
if lastNum="0" then
window.execScript "td_" & RndX & "_" & Rndy & ".innerText =" & Myrnd,"vbs"
NumArray(RndX,Rndy)=Myrnd
totalNum=totalNum+1
exit do
end if
loop
end if
if totalNum=16*9 then exit do'如果生成了全部数字,那么退出
loop
'随便放些数字结束

sub aaa(obj)
for x=0 to 10
for y=0 to 17
QuanArray(x,y)=0
next
next
if obj1=obj.id then exit sub '如果选择还是相同那么认为没选,跳出本过程

Flag1=Flag1+1
Flag1=Flag1 mod 3
RTN=fase
select case Flag1
case 0'什么也没选

case 1
obj1=obj.id
Num1=obj.innerText
obj.bordercolor="#ff0000"
temarray=split(obj1,"_")
x1=cint(temarray(1))
y1=cint(temarray(2))
case 2
obj2=obj.id
Num2=obj.innerText
obj.bordercolor="#ff0000"
temarray=split(obj2,"_")
x2=cint(temarray(1))
y2=cint(temarray(2))
if Num1=Num2 then
RTN1=CheckLink(x1,y1,x2,y2)

if RTN1=true then
Dispear x1,y1,x2,y2
Flag1=0
else
'恢复
Flag1=0
window.execScript "td_" & x1 & "_" & y1 & ".bordercolor =" & chr(34) & "#00FF66" & chr(34),"vbs"
window.execScript "td_" & x2 & "_" & y2 & ".bordercolor =" & chr(34) & "#00FF66" & chr(34),"vbs"
end if
else
'恢复
Flag1=0

window.execScript "td_" & x1 & "_" & y1 & ".bordercolor =" & chr(34) & "#00FF66" & chr(34),"vbs"
window.execScript "td_" & x2 & "_" & y2 & ".bordercolor =" & chr(34) & "#00FF66" & chr(34),"vbs"


end if
end select


end sub


function CheckLink(xx1,yy1,xx2,yy2)
RTN=false
for x=0 to 10
for y=0 to 17
QuanArray(x,y)=0
next
next
QuanArray(xx1,yy1)=1
RTN2=gogogogo(xx1,yy1)
CheckLink= RTN

end function

function gogogogo(xx,yy)
'vartype(xx) & "!"& xx & "-" & yy & "*" & vartype(x2) & " !" & x2 & "-" & y2
'msgbox xx & "-" & yy
'if xx<=10 and xx>=0 and yy<=17 and yy>=0 then
'window.execScript "td_" & xx & "_" & yy & ".innertext =" & chr(34) & "#" & chr(34),"vbs"
'window.execScript "td_" & xx & "_" & yy & ".bordercolor =" & chr(34) & "#0000ff" & chr(34),"vbs"
'end if
if vartype(xx)<>2 then xx=cint(xx)
if vartype(yy)<>2 then yy=cint(yy)
if vartype(x2)<>2 then x2=cint(x2)
if vartype(y2)<>2 then y2=cint(y2)

if RTN=true then
gogogogo=true
exit function
end if
if (xx+1=x2 and yy =y2) or (xx-1=x2 and yy=y2) or (yy+1=y2 and xx=x2) or (yy-1=y2 and xx=x2) then'先判断四周是不是
'连到了的选项
gogogogo=true
RTN=true
exit function
else'这里是已经判断了四周不是

'向下开始
if xx+1<=10 then'是否碰壁
if not(xx+1=x2 and yy =y2) then'是否连到了
if numArray(xx+1,yy)=0 then '是否碰到了别的图片
'这里是空地,如果空地的其余三面连接目标图片,那么就结束了,ok!
if (xx+2 =x2 and yy=y2) or (xx+1 =x2 and yy+1=y2) or (xx+1 =x2 and yy-1=y2) then
'连到了的选项

gogogogo=true
RTN=true

exit function
else
'这里是空地但是还没连上目标mm
if QuanArray(xx+1,yy)=0 then'是否已经来过此地
'连通空地,继续走继续朝前走的选项
QuanArray(xx+1,yy)=1'撒尿标记:老孙从这个方向到此一游!
RTN2=gogogogo(xx+1,yy)'继续去取经
else
'来过了
end if
end if
else
'碰到了别的图片,和碰壁查不多
end if
else
'连到了的选项
gogogogo=true
RTN=true
exit function
end if
else
'碰壁了
end if
'向下结束
'向上开始
if xx-1>=0 then'是否碰壁
if not(xx-1=x2 and yy=y2) then '是否连到了
if numArray(xx-1,yy)=0 then '是否碰到了别的图片
'这里是空地,如果空地的其余三面连接目标图片,那么就结束了,ok!
if (xx-2 =x2 and yy=y2) or (xx-1 =x2 and yy+1=y2) or (xx-1 =x2 and yy-1=y2) then
'连到了的选项

gogogogo=true
RTN=true

exit function
else
'这里是空地但是还没连上目标mm
if QuanArray(xx-1,yy)=0 then'是否已经来过此地
'连通空地,继续走继续朝前走的选项
QuanArray(xx-1,yy)=2'撒尿标记:老孙从这个方向到此一游!
RTN2=gogogogo(xx-1,yy)'继续去取经
else
'来过了
end if
end if
else
'碰到了别的图片,和碰壁查不多
end if
else
'连到了的选项
gogogogo=true
RTN=true
exit function
end if
else
'碰壁了
end if
'向上结束
'向左开始
if yy-1>=0 then'是否碰壁
if not(yy-1=y2 and xx=x2) then '是否连到了
if numArray(xx,yy-1)=0 then '是否碰到了别的图片
'这里是空地,如果空地的其余三面连接目标图片,那么就结束了,ok!

文档

用vbs实现的连连看在线游戏_javascript技巧

用vbs实现的连连看在线游戏_javascript技巧:在线演示 连连看_www.gxlcms.com_脚本之家 .mytb { FONT-WEIGHT: bolder; VERTICAL-ALIGN: middle; CURSOR: hand; COLOR: #FF6600; FONT-FAMILY: Wingdings; TEXT-ALIGN: center }
推荐度:
标签: 游戏 js vbs
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top