1 Reply Latest reply on Jun 12, 2006 9:44 AM by Newsgroup_User

    Find nearby sprites

    EdwardST
      I have a sort of bullet sprite that travells in a straight line, but im unsure of how to detect the collision between another sprite, and if there are any sprites nearby. So is there any way to 'get' the sprites in a rect or preferably a radius?
        • 1. Re: Find nearby sprites
          Level 7
          You get the best accuracy if test 2 bitmap sprites using matte ink using
          the intersect function, you could have a circle bitmap in a dedicated
          channel which you hae hidden, perhaps by setting blend to 0, your lingo
          cide than can position and perhaps scale this radius test sprite in the
          are of interest.


          One has to test for intersections sprite by sprite


          on checkIntersects circleSprite
          intersectList = []
          repeat with i = 6 to 20 -- range of interest
          if sprite i intersects circleSprite then apppend intersectList, i
          end repeat
          return
          end


          intersectCount = count(intersectList(5)