@Agent/Powerfang...if I where you I would edit your posts above and remove your mail addys before a bot trawls em and starts sending you spam, once it starts it never stops
Mentor.
ps heres a simple pathfinder for you, this example code was made to be inserted into any program, you make a grid of your play area, then it calculates all the possible paths to your specified target location, so you can get several units to go to the players location for example.
you check the array coresponding to the objects location and according to the number for that array location move the object left/right/forwards/back to the next location, then get the direction code for that location etc
dim a(26,26)
rem start main proggy with this
arrayini:
for l=0 to 26
for i=0 to 26
read x
a(i,l)=x
next i
next l
return
rem gosub this to load array with data for current map,
rem you can pick what data you need by useing restore <label>
rem before you call this, so for example for level 1 you could put
rem restore level1:gosub arrayini (you need 27x27 data)
rem in the array any number under 10 means the location is blocked
settarg:
restore targdat
if a(targx,targy)<>0 then goto targdat
for l=-1 to 1
for i=-1 to 1
read sval
if a(targx+i,targy+l)=0 then a(targx+i,targy+l)=sval
next i
next l
targdat:
data 12,13,11,12,15,11,12,14,11
return
rem call this with the position of targx and targy set by your selection
rem routine, if you have selected a wall then it returns without doing
rem anything, so you don`t get a path
makepath:
count=1:lastcount=1
do
for i=1 to 26
for l=1 to 26
if a(i+1,l)=0 and a(i,l)>10 then a(i+1,l)=11:inc count
if a(i-1,l)=0 and a(i,l)>10 then a(i-1,l)=12:inc count
if a(i,l+1)=0 and a(i,l)>10 then a(i,l+1)=14:inc count
if a(i,l-1)=0 and a(i,l)>10 then a(i,l-1)=13:inc count
next i
next l
if lastcount=count then goto escloop
lastcount=count
loop
escloop:
return
rem call this to make the path, you must reset the array with the data for
rem the level if you call this again for a new path, IE: to call once...
rem gosub settarg
rem gosub makepath
rem to call again
rem gosub arrayini
rem gosub settarg
rem gosub makepath
rem it needs a fresh array every time you call for a new path
rem 11 is left, 12 right, 13 down, 14 up
PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.