# Help with dynamic drawing and collision detection

**URL:** <https://forum.kirupa.com/t/help-with-dynamic-drawing-and-collision-detection/170575>\
**Category:** Uncategorized\
**Created:** [November 27, 2005, 9:00pm UTC](https://forum.kirupa.com/t/help-with-dynamic-drawing-and-collision-detection/170575 "2005-11-27T21:00:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ceglia](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@ceglia](https://forum.kirupa.com/u/ceglia)\
**Post date:** [November 27, 2005, 9:00pm UTC](https://forum.kirupa.com/t/help-with-dynamic-drawing-and-collision-detection/170575/1 "2005-11-27T21:00:53Z")

</div>

[font=Arial][size=2][color=navy][color=navy][font=Arial][/font][/color][/color][/size][/font]Picture a stage filled with multiple instances of a circular movieclip. I want to be able to:

[font=Arial][size=2][color=navy][color=navy][font=Arial][/font][/color][/color][/size][/font] [font=Arial][size=2][color=navy][color=navy]font=Arial[font=Times New Roman][size=1][font=Times New Roman] [/font][/size][/font][/font][/color][/color][/size][/font][font=Arial][size=2][color=navy][color=navy][font=Arial]dynamically draw a path from any one instance X to any other instance Z, but that path cannot cross any instance Y that happens to fall in between instances X and Z (a kind of dynamic drawing with collision detection). if an instance Y sits between X and Z, the path should curve around Y to get from X to Z. I’m able to draw a path from X to Z using the drawing API, but I’m not sure how to perform a hit test on the path and every other instance because I can’t seem to limit the hit area of the hit test to the actual shape of the path (as opposed to its bounding box).[/font][/color][/color][/size][/font]

[font=Arial][size=2][color=navy][color=navy]font=Arial[font=Times New Roman][size=1][font=Times New Roman] [/font][/size][/font][/font][/color][/color][/size][/font][font=Arial][size=2][color=navy][color=navy][font=Arial]use a tapered, brush-like stroke for the line style. I have had mixed results with this. I can get it to taper (although not very smoothly), but I have a hard time getting it to twist and wind in a convincing fashion.[/font][/color][/color][/size][/font]

[font=Arial][size=2][color=navy][color=navy][font=Arial] [/font][/color][/color][/size][/font]

[font=Arial][size=2][color=navy][color=navy][font=Arial]Thanks![/font][/color][/color][/size][/font]
