changed file

This commit is contained in:
ascii benefactor 2021-06-24 01:02:24 -04:00
parent 51f886a8ee
commit 3b19e00caa
1 changed files with 58 additions and 30 deletions

View File

@ -30,21 +30,23 @@ map={}
rem prg start rem prg start
genThrash(amount) genThrash(amount)
borderscr() borderscr()
dbinit()
rem grafx loop waiting for win rem grafx loop waiting for win
repeat repeat
' if win
if robx = kitx AND roby = kity then if robx = kitx AND roby = kity then
win=true win=true
endgame=true endgame=true
locate linenb,1 locate linenb,1
print " You found kitten!" print " You found kitten!"
fi fi
kbctrl()
printobj() printobj()
printui() printui()
printrob() printrob()
collscan() itemcolscan()
kbctrl
until win until win
@ -56,17 +58,18 @@ sub remtrash(x,y)
locate thrash[y].y,thrash[x].x locate thrash[y].y,thrash[x].x
? " " ? " "
end end
' scan if ypur om the same tile as item
sub collscan() sub itemcolscan()
for 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+3,2 locate linenb+3,2
print thrash[i].text print thrash[i].text
thrash[i].active = false thrash[i].onscreen = false
fi fi
next next
end end
' KEYBOARD CMD and scr bounds scan
sub kbctrl() sub kbctrl()
kb = inkey kb = inkey
' delete old rob ' delete old rob
@ -76,16 +79,16 @@ sub kbctrl()
case "h" case "h"
if robx > 0 then if robx > 0 then
robx = robx-1 robx = robx-1
dir="x-"
fi fi
' if monstscan(dirP
case "j" case "j"
if roby < linenb then if roby < linenb then
roby = roby+1 roby = roby+1
dir="x+"
fi fi
case "k" case "k"
if roby > 0 then if roby > 0 then
roby = roby-1 roby = roby-1
dir="y-" dir="y-"
fi fi
case "l" case "l"
@ -94,8 +97,12 @@ sub kbctrl()
dir="y+" dir="y+"
fi fi
case "q" case "q"
' debug show all continupusly updated content on screen
locate 3,3
print "testt" print "testt"
end select end select
' print again to show changes
printrob() printrob()
end end
@ -108,6 +115,11 @@ sub printui()
print pl.name print pl.name
end end
sub monscan(arg)
end
sub printrob() sub printrob()
locate roby,robx locate roby,robx
print "@" print "@"
@ -117,20 +129,20 @@ 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 if thrash[it].onscreen 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
else else
' put the item in the unaccesible region of screen
thrash[it].x = 0 thrash[it].x = 0
thrash[it].y = 0 thrash[it].y = 0
fi fi
next next
rem print kitty rem and aftr print kitty
locate kity,kitx locate kity,kitx
print kitchar print "@"
end end
func charget() func charget()
@ -144,36 +156,45 @@ func charget()
case 4 case 4
return "?" return "?"
case 5 case 5
return "÷" return "+"
case 6 case 6
return "$" return "$"
end select end select
end end
rem Items are represented by thrash rem Items are represented by thrash so this func also gens items stats
' assisigning it to the thrash[x].obj object. which will then go as such in the pl inv
sub genthrash(amount) sub genthrash(amount)
for index = 1 to amount for index = 1 to amount
local tx = fix(rnd*colnb) local tx = fix(rnd*colnb)
local ty = fix(rnd*linenb) local ty = fix(rnd*linenb)
thrash[index].obj = weap.knife
itnam=thrash[index].obj.name
thrash[index].x = tx thrash[index].x = tx
thrash[index].y = ty thrash[index].y = ty
thrash[index].ch = charget thrash[index].ch = charge
thrash[index].text = "lazy" thrash[index].text = itnam
thrash[index].active = true thrash[index].onscreen = true
rem thrash[index].item = get
next next
func genitem()
local proto={}
proto = weap.knife
return proto
end
end end
func textget() func dbinit()
r = rnd()*len(dict) ' tload weapdb.dat, byref weap
return 'placeholder' weap={}
weap.knife = {name:knife,dmg:3}
end end
sub borderscr() sub borderscr()
cls cls
for i = 0 to linenb+1 for i = 0 to linenb+1
locate i+1,colnb+1 locate i+1,colnb+1
? "X" ? "#"
for i2 = 0 to colnb+1 for i2 = 0 to colnb+1
locate linenb+1,i2 locate linenb+1,i2
print "X" print "X"
@ -183,6 +204,13 @@ end
func genmob(lvl) func genmob(lvl)
for i = 0 to amob for i = 0 to amob
pmob[i] = {hp:30,name:jello} pmob[i] = {dmg:2,hpx:30}
pmob[i] = {hp:
30,name:jello}
pmob[i].x = fix(rnd*colnb)
pmob[i].y =fix(rnd*linenb)
pmob[i].alive = true
pmob[i].onscreen = true
next next
end end