📄 vsdazhang.txt
字号:
declare sub main()
declare sub Actions(AX,AY,Action,Face,Player)
declare sub ClsActions(AX,AY,Action,Face,Player)
declare sub Blasts(BX,BY,Face,Player)
declare function Hit(HP,HP1,Player)
declare sub JianMP(MP,MP1,Player)
sub main()
cls
locate(3,7):print "加载中..."
MyX=20
MyY=64
HisX=130
HisY=64
MyHP=56
MyMP=56
HisHP=56
HisMP=56
MyBlast=0
HisBlast=0
Action_Me=1
Action_He=1
MyFace=2
HisFace=1
JiZhong=0
BeiJi=0
MyGuard=0
HisGuard=0
MyActionUp=0
MyActionA=0
MyActionS=0
MyActionD=0
HisActionUp=0
HisActionA=0
HisActionS=0
HisActionD=0
timer=0
MyActionDown=0
HisActionDown=0
MyBlastX=0
MyBlastY=71
HisBlastX=0
HisBlastY=71
MyBlastFace=0
HisBlastFace=0
MyHitX=0
HisHitX=0
Win=0
cls
x=1
y=1
gosub H
x=147
y=1
gosub H
x=1
y=10
gosub M
x=147
y=10
gosub M
x=7
y=1
gosub P
x=153
y=1
gosub P
x=7
y=10
gosub P
x=153
y=10
gosub P
fillrect(14,3,71,6)
fillrect(14,12,71,15)
fillrect(87,3,144,6)
fillrect(87,12,144,15)
goto DrawFloor
H:
line(x,y,x,y+6)
line(x+4,y,x+4,y+6)
line(x,y+3,x+4,y+3)
return
M:
line(x,y,x,y+6)
line(x+4,y,x+4,y+6)
pset(x+1,y+2,1)
pset(x+3,y+2,1)
line(x+2,y+3,x+2,y+5)
return
P:
line(x,y,x,y+6)
line(x,y,x+3,y)
line(x,y+3,x+3,y+3)
line(x+4,y+1,x+4,y+2)
return
DrawFloor:
line(0,95,158,95)
line(0,92,158,92)
line(0,89,158,89)
for x=2 to 152 step 10
line(x,89,x,92)
line(x+5,92,x+5,95)
next x
REM -----------
REM putpct(73,1,13,15,PicVS!)
REM -----------
Actions(MyX,MyY,Action_Me,MyFace,1)
Actions(HisX,HisY,Action_He,HisFace,2)
do
k=keydetect()
if k>0 then
k=getkey()
if k=128 then
if MyY<64 then goto Here
MyGuard=0
ClsActions(MyX,MyY,Action_Me,MyFace,1)
Action_Me=4
MyActionUp=3
MyY=MyY-35
Actions(MyX,MyY,Action_Me,MyFace,1)
else if k=129 then
if MyY<64 then goto Here
MyGuard=1
ClsActions(MyX,MyY,Action_Me,MyFace,1)
Action_Me=7
MyActionDown=1
Actions(MyX,MyY,Action_Me,MyFace,1)
else if k=131 then
ClsActions(MyX,MyY,Action_Me,MyFace,1)
if MyActionDown>0 then
MyActionDown=0
MyGuard=0
Action_Me=1
end if
if MyX<10 then
MyX=2
else
MyX=MyX-8
end if
if MyX>HisX then
MyFace=1
HisFace=2
else
MyFace=2
HisFace=1
end if
Actions(MyX,MyY,Action_Me,MyFace,1)
else if k=130 then
ClsActions(MyX,MyY,Action_Me,MyFace,1)
if MyActionDown>0 then
MyActionDown=0
MyGuard=0
Action_Me=1
end if
if MyActionA>0 or MyActionS>0 or MyActionD>0 then
if MyX>127 then MyX=135
else
if MyX>138 then
MyX=146
else
MyX=MyX+8
end if
end if
if MyX>HisX then
MyFace=1
HisFace=2
else
MyFace=2
HisFace=1
end if
Actions(MyX,MyY,Action_Me,MyFace,1)
else if k=97 then
if MyY<64 then goto Here
ClsActions(MyX,MyY,Action_Me,MyFace,1)
if MyFace=1 then
if MyX>10 then
MyX=MyX-11
else
MyX=0
end if
MyHitX=MyX
else
if MyX>137 then MyX=137
MyHitX=MyX+21
end if
if MyActionDown>0 then
MyActionDown=0
MyGuard=0
end if
Action_Me=2
MyActionA=1
Actions(MyX,MyY,Action_Me,MyFace,1)
else if k=115 then
if MyY<64 then goto Here
ClsActions(MyX,MyY,Action_Me,MyFace,1)
if MyFace=1 then
if MyX>10 then
MyX=MyX-11
else
MyX=0
end if
MyHitX=MyX
else
if MyX>137 then MyX=137
MyHitX=MyX+21
end if
if MyActionDown>0 then
MyActionDown=0
MyGuard=0
end if
Action_Me=3
MyActionS=1
Actions(MyX,MyY,Action_Me,MyFace,1)
else if k=100 then
if MyY<64 then goto Here
if MyBlast>0 then goto Here
if MyMP<10 then goto Here
ClsActions(MyX,MyY,Action_Me,MyFace,1)
if MyFace=1 then
if MyX>10 then
MyX=MyX-11
else
MyX=0
end if
MyBlastX=MyX+5
MyBlastFace=1
else
if MyX>137 then MyX=137
MyBlastX=MyX+16
MyBlastFace=2
end if
if MyActionDown>0 then
MyActionDown=0
MyGuard=0
end if
Action_Me=5
MyActionD=1
MyBlast=1
JianMP(MyMP,10,1)
MyMP=MyMP-10
Actions(MyX,MyY,Action_Me,MyFace,1)
end if
end if
Here:
inc timer
if timer MOD 2=0 then
if ((MyBlast>0 and abs(MyBlastX-HisX)<20) or abs(MyHitX-HisX)<20) and HisY=64 then
He=rnd(200)
else
hh=rnd(300)
if hh<200 then
He=rnd(300)
if He<100 then
He=250
else if He>99 and He<200 then
He=350
else if He>=200 then
He=450
end if
else
He=rnd(700)
end if
end if
if He<100 then
if HisY<64 then goto There
HisGuard=0
ClsActions(HisX,HisY,Action_He,HisFace,2)
Action_He=4
HisActionUp=3
HisY=HisY-35
Actions(HisX,HisY,Action_He,HisFace,2)
else if He>99 and He<200 then
if HisY<64 then goto There
HisGuard=1
ClsActions(HisX,HisY,Action_He,HisFace,2)
Action_He=7
HisActionDown=1
Actions(HisX,HisY,Action_He,HisFace,2)
else if He>499 and He<600 then
ClsActions(HisX,HisY,Action_He,HisFace,2)
if HisActionDown>0 then
HisActionDown=0
HisGuard=0
Action_He=1
end if
if HisX<10 then
HisX=2
else
HisX=HisX-8
end if
if MyX>HisX then
MyFace=1
HisFace=2
else
MyFace=2
HisFace=1
end if
Actions(HisX,HisY,Action_He,HisFace,2)
else if He>599 and He<700 then
ClsActions(HisX,HisY,Action_He,HisFace,2)
if HisActionDown>0 then
HisActionDown=0
HisGuard=0
Action_He=1
end if
if HisActionA>0 or HisActions>0 or HisActiond>0 then
if HisX>127 then HisX=135
else
if HisX>138 then
HisX=146
else
HisX=HisX+8
end if
end if
if MyX>HisX then
MyFace=1
HisFace=2
else
MyFace=2
HisFace=1
end if
Actions(HisX,HisY,Action_He,HisFace,2)
else if He>199 and He<300 then
if HisY<64 then goto There
ClsActions(HisX,HisY,Action_He,HisFace,2)
if HisFace=1 then
if HisX>10 then
HisX=HisX-11
else
HisX=0
end if
HisHitX=HisX
else
if HisX>137 then HisX=137
HisHitX=HisX+21
end if
if HisActionDown>0 then
HisActionDown=0
HisGuard=0
end if
Action_He=2
HisActionA=1
Actions(HisX,HisY,Action_He,HisFace,2)
else if He>299 and He<400 then
if HisY<64 then goto There
ClsActions(HisX,HisY,Action_He,HisFace,2)
if HisFace=1 then
if HisX>10 then
HisX=HisX-11
else
HisX=0
end if
HisHitX=HisX
else
if HisX>137 then HisX=137
HisHitX=HisX+21
end if
if HisActionDown>0 then
HisActionDown=0
HisGuard=0
end if
Action_He=3
HisActionS=1
Actions(HisX,HisY,Action_He,HisFace,2)
else if He>399 and He<500 then
if HisY<64 then goto There
if HisBlast>0 then goto There
if HisMP<10 then goto There
ClsActions(HisX,HisY,Action_He,HisFace,2)
if HisFace=1 then
if HisX>10 then
HisX=HisX-11
else
HisX=0
end if
HisBlastX=HisX+5
HisBlastFace=1
else
if HisX>137 then HisX=137
HisBlastX=HisX+16
HisBlastFace=2
end if
if HisActionDown>0 then
HisActionDown=0
HisGuard=0
end if
Action_He=5
HisActionD=1
HisBlast=1
JianMP(HisMP,10,2)
HisMP=HisMP-10
Actions(HisX,HisY,Action_He,HisFace,2)
end if
end if
There:
if timer MOD 5=0 then
inc MyMP
inc HisMP
if MyMP>56 then MyMP=56
if HisMP>56 then HisMP=56
line(14+MyMP,12,14+MyMP,15)
line(144-HisMP,12,144-HisMP,15)
end if
if MyBlast>0 then
Blasts(MyBlastX-3,MyBlastY,MyBlastFace,1)
clspart(MyBlastX-3,MyBlastY,MyBlastX+4,MyBlastY+7)
if MyBlastFace=1 then
MyBlastX=MyBlastX-10
else if MyBlastFace=2 then
MyBlastX=MyBlastX+10
end if
if MyBlastX<3 or MyBlastX>154 then
MyBlast=0
else
Blasts(MyBlastX-3,MyBlastY,MyBlastFace,1)
end if
if MyBlastX>=HisX and MyBlastX<=HisX+10 and HisY=64 then
JiZhong=1
MyBlast=0
clspart(MyBlastX-3,MyBlastY,MyBlastX+4,MyBlastY+7)
end if
if HisBlast>0 and MyBlast>0 then
if abs(MyBlastX-HisBlastX)<6 then
clspart(MyBlastX-3,MyBlastY,MyBlastX+4,MyBlastY+7)
clspart(HisBlastX-3,HisBlastY,HisBlastX+4,HisBlastY+7)
MyBlast=0
HisBlast=0
end if
end if
end if
if HisBlast>0 then
Blasts(HisBlastX-3,HisBlastY,HisBlastFace,2)
clspart(HisBlastX-3,HisBlastY,HisBlastX+4,HisBlastY+7)
if HisBlastFace=1 then
HisBlastX=HisBlastX-10
else if HisBlastFace=2 then
HisBlastX=HisBlastX+10
end if
if HisBlastX<3 or HisBlastX>154 then
HisBlast=0
else
Blasts(HisBlastX-3,HisBlastY,HisBlastFace,2)
end if
if HisBlastX>=MyX and HisBlastX<=MyX+10 and MyY=64 then
BeiJi=1
HisBlast=0
clspart(HisBlastX-3,HisBlastY,HisBlastX+4,HisBlastY+7)
end if
if MyBlast>0 and HisBlast>0 then
if abs(MyBlastX-HisBlastX)<6 then
clspart(MyBlastX-3,MyBlastY,MyBlastX+4,MyBlastY+7)
clspart(HisBlastX-3,HisBlastY,HisBlastX+4,HisBlastY+7)
MyBlast=0
HisBlast=0
end if
end if
end if
if MyActionUp>0 or MyActionA>0 or MyActionS>0 or MyActionD>0 then
if MyActionUp>0 then
dec MyActionUp
if MyActionUp=0 then
ClsActions(MyX,MyY,Action_Me,MyFace,1)
MyY=64
Action_Me=1
Actions(MyX,MyY,Action_Me,MyFace,1)
end if
end if
if MyActionA>0 then
MyActionA=0
ClsActions(MyX,MyY,Action_Me,MyFace,1)
Action_Me=1
MyX=MyX+6
Actions(MyX,MyY,Action_Me,MyFace,1)
if MyHitX>=HisX and MyHitX<=HisX+10 and HisY=64 then JiZhong=1
end if
if MyActionS>0 then
MyActionS=0
ClsActions(MyX,MyY,Action_Me,MyFace,1)
Action_Me=1
MyX=MyX+6
Actions(MyX,MyY,Action_Me,MyFace,1)
if MyHitX>=HisX and MyHitX<=HisX+10 and HisY=64 then JiZhong=1
end if
if MyActionD>0 then
MyActionD=0
ClsActions(MyX,MyY,Action_Me,MyFace,1)
Action_Me=1
MyX=MyX+6
Actions(MyX,MyY,Action_Me,MyFace,1)
end if
end if
if HisActionUp>0 or HisActionA>0 or HisActionS>0 or HisActionD>0 then
if HisActionUp>0 then
dec HisActionUp
if HisActionUp=0 then
ClsActions(HisX,HisY,Action_He,HisFace,2)
HisY=64
Action_He=1
Actions(HisX,HisY,Action_He,HisFace,2)
end if
end if
if HisActionA>0 then
HisActionA=0
ClsActions(HisX,HisY,Action_He,HisFace,2)
Action_He=1
HisX=HisX+6
Actions(HisX,HisY,Action_He,HisFace,2)
if HisHitX>=MyX and HisHitX<=MyX+10 and MyY=64 then BeiJi=1
end if
if HisActionS>0 then
HisActionS=0
ClsActions(HisX,HisY,Action_He,HisFace,2)
Action_He=1
HisX=HisX+6
Actions(HisX,HisY,Action_He,HisFace,2)
if HisHitX>=MyX and HisHitX<=MyX+10 and MyY=64 then BeiJi=1
end if
if HisActionD>0 then
HisActionD=0
ClsActions(HisX,HisY,Action_He,HisFace,2)
Action_He=1
HisX=HisX+6
Actions(HisX,HisY,Action_He,HisFace,2)
end if
end if
if JiZhong>0 then
if HisGuard>0 then
Win=Hit(HisHP,1,2)
HisHP=HisHP-1
else
Win=Hit(HisHP,6,2)
HisHP=HisHP-6
end if
if Win=2 then
locate(3,9):print "胜利!"
pause
end
end if
JiZhong=0
end if
if BeiJi>0 then
if MyGuard>0 then
Win=Hit(MyHP,1,1)
MyHP=MyHP-1
else
Win=Hit(MyHP,6,1)
MyHP=MyHP-6
end if
if Win=1 then
locate(3,9):print "失败!"
pause
end
end if
BeiJi=0
end if
ClsActions(MyX,MyY,Action_Me,MyFace,1)
ClsActions(HisX,HisY,Action_He,HisFace,2)
Actions(MyX,MyY,Action_Me,MyFace,1)
Actions(HisX,HisY,Action_He,HisFace,2)
MyHitX=1000
HisHitX=1000
loop
end sub
sub Blasts(BX,BY,Face,Player)
if Face=1 then
if Player=1 then
box(BX,BY,BX+7,BY+7)
line(BX,BY,BX+7,BY+7)
line(BX+7,BY,BX,BY+7)
else if Player=2 then
box(BX,BY,BX+7,BY+7)
line(BX,BY+3,BX+7,BY)
line(BX,BY+4,BX+7,BY+7)
end if
else if Face=2 then
if Player=1 then
box(BX,BY,BX+7,BY+7)
fillrect(BX+2,BY+2,BX+5,BY+5)
else if Player=2 then
box(BX,BY,BX+7,BY+7)
line(BX,BY,BX+7,BY+3)
line(BX,BY+7,BX+7,BY+4)
end if
end if
end sub
function Hit(HP,HP1,Player)
if Player=1 then
for a=14+HP to 15+HP-HP1 step -1
if a=14 then
Hit=1
goto 1
end if
clspart(a,4,a,5)
next a
else if Player=2 then
for a=144-HP to 143-HP+HP1
if a=144 then
Hit=2
goto 1
end if
clspart(a,4,a,5)
next a
end if
1 if Hit<=0 then Hit=0
end function
sub JianMP(MP,MP1,Player)
if Player=1 then
for a=14+MP to 15+MP-MP1 step -1
clspart(a,13,a,14)
next a
else if Player=2 then
for a=144-MP to 143-MP+MP1
clspart(a,13,a,14)
next a
end if
end sub
sub Actions(AX,AY,Action,Face,Player)
if Player=1 then
if Face=1 then
if Action=1 then
box(AX,AY,AX+10,AY+24)
box(AX,AY+3,AX+5,AY+7)
else if Action=2 then
box(AX+11,AY,AX+21,AY+24)
box(AX,AY+3,AX+11,AY+7)
else if Action=3 then
box(AX+11,AY,AX+21,AY+24)
box(AX,AY+17,AX+11,AY+21)
else if Action=4 then
box(AX,AY,AX+10,AY+24)
line(AX+5,AY+13,AX+5,AY+24)
box(AX,AY+3,AX+5,AY+7)
else if Action=5 then
box(AX+11,AY,AX+21,AY+24)
box(AX,AY+5,AX+11,AY+12)
line(AX,AY+8,AX+11,AY+8)
else if Action=7 then
box(AX,AY,AX+10,AY+24)
fillrect(AX,AY,AX+5,AY+5)
end if
else if Face=2 then
if Action=1 then
box(AX,AY,AX+10,AY+24)
box(AX+6,AY+3,AX+10,AY+7)
else if Action=2 then
box(AX,AY,AX+10,AY+24)
box(AX+11,AY+5,AX+21,AY+10)
else if Action=3 then
box(AX,AY,AX+10,AY+24)
box(AX+11,AY+15,AX+21,AY+20)
else if Action=4 then
box(AX,AY,AX+10,AY+24)
line(AX+5,AY+13,AX+5,AY+24)
box(AX+5,AY+5,AX+10,AY+9)
else if Action=5 then
box(AX,AY,AX+10,AY+24)
box(AX+11,AY+5,AX+21,AY+13)
line(AX+11,AY+9,AX+21,AY+13)
else if Action=7 then
box(AX,AY,AX+10,AY+24)
fillrect(AX+7,AY,AX+10,AY+5)
end if
end if
else if Player=2 then
if Face=1 then
if Action=1 then
box(AX,AY,AX+10,AY+24)
box(AX,AY+3,AX+5,AY+7)
else if Action=2 then
box(AX+11,AY,AX+21,AY+24)
box(AX,AY+3,AX+11,AY+7)
else if Action=3 then
box(AX+11,AY,AX+21,AY+24)
box(AX,AY+17,AX+11,AY+21)
else if Action=4 then
box(AX,AY,AX+10,AY+24)
line(AX+5,AY+13,AX+5,AY+24)
box(AX,AY+3,AX+5,AY+7)
else if Action=5 then
box(AX+11,AY,AX+21,AY+24)
box(AX,AY+5,AX+11,AY+12)
line(AX,AY+8,AX+11,AY+8)
else if Action=7 then
box(AX,AY,AX+10,AY+24)
fillrect(AX,AY,AX+5,AY+5)
end if
else if Face=2 then
if Action=1 then
box(AX,AY,AX+10,AY+24)
box(AX+6,AY+3,AX+10,AY+7)
else if Action=2 then
box(AX,AY,AX+10,AY+24)
box(AX+11,AY+5,AX+21,AY+10)
else if Action=3 then
box(AX,AY,AX+10,AY+24)
box(AX+11,AY+15,AX+21,AY+20)
else if Action=4 then
box(AX,AY,AX+10,AY+24)
line(AX+5,AY+13,AX+5,AY+24)
box(AX+5,AY+5,AX+10,AY+9)
else if Action=5 then
box(AX,AY,AX+10,AY+24)
box(AX+11,AY+5,AX+21,AY+13)
line(AX+11,AY+9,AX+21,AY+13)
else if Action=7 then
box(AX,AY,AX+10,AY+24)
fillrect(AX+7,AY,AX+10,AY+5)
end if
end if
end if
end sub
sub ClsActions(AX,AY,Action,Face,Player)
if Action=1 or Action=4 or Action=7 then
clspart(AX,AY,AX+10,AY+24)
else if Action=2 or Action=3 or Action=5 then
clspart(AX,AY,AX+21,AY+24)
end if
end sub
cls
locate(3,8):print "VS大战"
locate(6,4):print "程序:Cool&Easy"
pause
cls
locate(1,6):print "[按键说明]"
print "上->跳 下->防御"
print "左->左移 右->右移"
print "A->出拳 S->出腿"
print "D->发射气功波"
pause
main()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -