hitscan?

BlitzMax Forums/BlitzMax Programming/hitscan?

Drakim(Posted 2008) [#1]
I tried searching, but no results on "hitscan" :(

So, what's the most effective way to make a hitscan test?

I wouldn't just use it for instant hit bullets, but also AI checks like "is target within view?"

So, how would I go about to make a function that checks if two of my objects have a clear path? I myself don't have a wildest idea.


tonyg(Posted 2008) [#2]
Off my head: I would put possible collision objects on a collision layer. I would then check a rect from the shooter to target against that layer (or multiple layers if necessary). If the number of returned objects >1 then you have hit something. If the number of returned objects = 1 then check it is the target.
Alternatively you might be able to adjust this .


Drakim(Posted 2008) [#3]
tonyg:
The link you provided is excellent help. Thank you