02-14-2012, 03:01 PM
It was my fault, it was an array over-run
:oops:
here is a distance function to make up for it:
this bresenham line drawing algorithm lets you do line-of-sight to see if 2 units can see each other in a game
:oops:
here is a distance function to make up for it:
Code:
Function distance (x1 as Integer, y1 as Integer, x2 as Integer, y2 as Integer) as Integer
Dim x as Integer
x=ABS(x1-x2)
Dim y as Integer
y=ABS(y1-y2)
Return Sqr((x^2)+(y^2))
End Function
this bresenham line drawing algorithm lets you do line-of-sight to see if 2 units can see each other in a game