PDA

View Full Version : making enemies fire when player is in range



rsugar
May 1st, 2005, 07:03 PM
I cant find any tutorials anywhere that show how to find distance to an object.
ex. i want a "turret" or "tank" to not fire until my"helicopter" is in range"
im in 8th grade and my school doesnt offer trig... :(.
could someone please give me an example or a piece of code and explain it to me?
thnx

Prancer
May 1st, 2005, 08:05 PM
I believe this should do the trick Rsugar:
Link (http://www.kirupa.com/developer/actionscript/calculating_distance.htm) :thumb:

rsugar
May 17th, 2005, 07:38 PM
THanks!:smile:

nathan99
May 18th, 2005, 03:54 AM
or u could jus basically use something like if the turret is at a certain X position it would fire.... seems to be the easiest option t me