lol
This commit is contained in:
parent
829f923ccb
commit
e80ae27e00
@ -11,6 +11,7 @@ linenb=10
|
|||||||
colnb=20
|
colnb=20
|
||||||
win=false
|
win=false
|
||||||
score=0
|
score=0
|
||||||
|
|
||||||
robx=fix(rnd*colnb)
|
robx=fix(rnd*colnb)
|
||||||
roby=fix(rnd*linenb)
|
roby=fix(rnd*linenb)
|
||||||
kitx=fix(rnd*colnb)
|
kitx=fix(rnd*colnb)
|
||||||
@ -18,20 +19,21 @@ kity=fix(rnd*linenb)
|
|||||||
kitchar = charget
|
kitchar = charget
|
||||||
amount = 5
|
amount = 5
|
||||||
thrash = array("{0:{}}")
|
thrash = array("{0:{}}")
|
||||||
|
map={}
|
||||||
|
|
||||||
rem prg start
|
rem prg start
|
||||||
genThrash(amount)
|
genThrash(amount)
|
||||||
|
borderscr()
|
||||||
rem grafx loop waiting for win
|
rem grafx loop waiting for win
|
||||||
repeat
|
repeat
|
||||||
if robx = kitx AND roby = kity then
|
if robx = kitx AND roby = kity then
|
||||||
win=true
|
win=true
|
||||||
|
locate linenb,1
|
||||||
|
print " You found kitten!"
|
||||||
fi
|
fi
|
||||||
printrob()
|
|
||||||
printobj()
|
printobj()
|
||||||
printkit()
|
|
||||||
printui()
|
printui()
|
||||||
|
printrob()
|
||||||
collscan()
|
collscan()
|
||||||
|
|
||||||
if inkey = nil then
|
if inkey = nil then
|
||||||
@ -52,10 +54,11 @@ sub remtrash(nb,x,y)
|
|||||||
end
|
end
|
||||||
|
|
||||||
sub collscan()
|
sub collscan()
|
||||||
for local i = 1 to amount
|
for i = 1 to amount
|
||||||
if robx=thrash[i].x and roby=thrash[i].y then
|
if robx=thrash[i].x and roby=thrash[i].y then
|
||||||
locate linenb+1,1
|
locate linenb+3,2
|
||||||
print thrash[i].text
|
print thrash[i].text
|
||||||
|
thrash[i].active = false
|
||||||
fi
|
fi
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@ -86,6 +89,8 @@ sub kbctrl()
|
|||||||
robx = robx+1
|
robx = robx+1
|
||||||
dir="y+"
|
dir="y+"
|
||||||
fi
|
fi
|
||||||
|
case "q"
|
||||||
|
break
|
||||||
end select
|
end select
|
||||||
printrob()
|
printrob()
|
||||||
end
|
end
|
||||||
@ -102,19 +107,20 @@ sub printrob()
|
|||||||
print "@"
|
print "@"
|
||||||
end
|
end
|
||||||
|
|
||||||
sub printkit()
|
|
||||||
locate kity,kitx
|
|
||||||
print kitchar
|
|
||||||
end
|
|
||||||
|
|
||||||
sub printobj()
|
sub printobj()
|
||||||
rem print thrash
|
rem print thrash
|
||||||
for it=1 to amount
|
for it=1 to amount
|
||||||
|
if thrash[it].active then
|
||||||
local objx = thrash[it].x
|
local objx = thrash[it].x
|
||||||
local objy = thrash[it].y
|
local objy = thrash[it].y
|
||||||
locate objy,objx
|
locate objy,objx
|
||||||
print thrash[it].ch
|
print thrash[it].ch
|
||||||
|
fi
|
||||||
next
|
next
|
||||||
|
locate kity,kitx
|
||||||
|
print kitchar
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
func charget()
|
func charget()
|
||||||
@ -137,7 +143,8 @@ sub genthrash(amount)
|
|||||||
thrash[index].x = tx
|
thrash[index].x = tx
|
||||||
thrash[index].y = ty
|
thrash[index].y = ty
|
||||||
thrash[index].ch = charget
|
thrash[index].ch = charget
|
||||||
thrash[index].text = textget
|
thrash[index].text = "lazy"
|
||||||
|
thrash[index].active = true
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user