VBS小游戏

得把编码改成utf-16

SET Wshell=CreateObject("Wscript.Shell")
set fso=wscript.createobject("scripting.filesystemobject")
if lcase(right(Wscript.fullName,11)) = "wscript.exe" then
    Wshell.run "cmd /k cscript.exe //nologo " & chr(34) & wscript.scriptfullname & chr(34)
    Wscript.quit
else
    msgbox "1号用ctrl+alt+w/a/s/d来操控方向,用ctrl+alt+z攻击"
    msgbox"2号用ctrl+alt+上/下/左/右 来操控方向,用ctrl+alt+l攻击"
    dim a(59,28),dname(3),ldname(3),all(9),zd(1),iline(100),liline(100)
    dname(0)="a"
    dname(1)="s"
    dname(2)="d"
    dname(3)="w"
    ldname(0)="left"
    ldname(1)="down"
    ldname(2)="right"
    ldname(3)="up"
    all(0)="a"
    all(1)="s"
    all(2)="d"
    all(3)="w"
    all(4)="z"
    all(5)="up"
    all(6)="down"
    all(7)="left"
    all(8)="right"
    all(9)="l"
    zidan=15
    lzidan=15
    xueliang=3
    lxueliang=3
    for i= 0 to 59
        for j= 0 to 27
            a(i,j)="█ "
        next
    next
    m=2
    n=2
    p=57
    q=24
    direction="d"
    ldirection="left"
    a(m,n)="◎"
    a(p,q)="◎"
    strDesktop=WShell.SpecialFolders("Desktop")
    for name=0 to 9
        set open=fso.opentextfile(strdesktop&"\"&all(name)&".vbs",2,true)
        open.write("set fso=wscript.createobject("&chr(34)&"scripting.filesystemobject"&chr(34)&")"&vbcrlf&"set f=fso.opentextfile("&chr(34)&strdesktop&"\"&all(name)&".txt"&chr(34)&",1,true)")
        open.close
        if fso.fileexists(strdesktop&"\"&all(name)&".txt") then
            fso.deletefile(strdesktop&"\"&all(name)&".txt")
        end if
        set oShellLink = WShell.CreateShortcut(strDesktop & "\"&all(name)&".lnk")
        oShellLink.TargetPath = strdesktop&"\"&all(name)&".vbs"
        oShellLink.Hotkey = "ctrl+alt+"&all(name)
        oShellLink.WorkingDirectory = strdesktop
        oShellLink.Save
    next
    wshecho()
    for ztime=1 to 1000000
        for xxxx=0 to 100
            iline(xxxx)=""
            liline(xxxx)=""
        next
    for name=0 to 3
        if fso.fileexists(strdesktop&"\"&dname(name)&".txt") then
            direction=dname(name)
            runaswd=true
            for i= 0 to 59
                for j= 0 to 27
                    a(i,j)="█ "
                next
            next
            fso.deletefile(strdesktop&"\"&dname(name)&".txt")
        end if
    next
    for name=0 to 3
        if fso.fileexists(strdesktop&"\"&ldname(name)&".txt") then
            ldirection=ldname(name)
            lrunaswd=true
            for i= 0 to 59
                for j= 0 to 27
                    a(i,j)="█ "
                next
            next
            fso.deletefile(strdesktop&"\"&ldname(name)&".txt")
        end if
    next
    if fso.fileexists(strdesktop&"\z.txt") then
        if zidan=0  then
        elseif z then
        else
            z=true
            zidan=zidan-1
        end if
        fso.deletefile(strdesktop&"\z.txt")
    end if
    if fso.fileexists(strdesktop&"\l.txt") then
        if lzidan=0  then
        elseif lz then
        else
            lz=true
            lzidan=lzidan-1
        end if
        fso.deletefile(strdesktop&"\l.txt")
    end if
    if ztime mod 1000=0 then
        zidan=zidan+1
        lzidan=lzidan+1
    end if
    select case direction
        case "w"
            if runaswd then
                n=n-1
                runaswd=false
            end if
            if z then
                for g=0 to n-3
                    a(m,g)="◙ "
                    iline(g)=m&g
                next
                z=false
            end if
            if n=1 then
                n=n+1
            end if
            a(m,n)="◙ "
            dimar
            a(m,n-2)="△"
        case "a"
            if runaswd then
                m=m-1
                runaswd=false
            end if
            if z then
                for g=0 to m-3
                    a(g,n)="◙ "
                    iline(g)=g&n
                next
                z=false
            end if
            if m=1 then
                m=m+1
            end if
            a(m,n)="◙ "
            dimar
            a(m-2,n)="◁"
        case "d"
if runaswd then
            m=m+1
runaswd=false
end if
if z then
for g&#

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值