Skip to main content
Participant
February 19, 2008
Question

Calculating weapon range in a game

  • February 19, 2008
  • 1 reply
  • 249 views
Hi,

I'd like to ideally have a movieclip and calculate either the radius around the movieclip based on the range of the weapon or, if I have to, the number of squares ahead of the movieclip corresponding to the range of the weapon. How would I go about doing this?

Thanks.
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
February 20, 2008
if there are few objects on-stage, loop through the objects of interest and see if any are in requisite proximity of your weapon. if there are many objects of interest you should probably use a proximity manager class to partition your stage, allocate your objects to the partition and check for objects in the partitions in the requisite proximity of your weapon.