A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: how to check if line segments form closed polygon

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    3

    how to check if line segments form closed polygon

    im developing a game that need player to draw a shape around target object.. im stuck on how to check if the line draw is a closed shape or not.. can someone help me?

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    The end coordinates of previous line have to match the start coordinates of the next line, so the last line needs to overlap the first line.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    thanks for your reply.. may i know how to make that? can u give me the sample code?

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Please write the code for making the lines.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    actually i have not made any code because i cant find the logic.. my application is quite complicated.. kepong.jpg
    this is a 2 players game.. players have to click the joint red line in turn.. after clicked a dot will appear.. 1st player blue dot, 2nd player black dot.. if blue dot successfully surrounded the black dots blue line will automatically appear just like picture i uploaded.. the problem is i dont know how to make that blue line appear if blue dots successfully trap black dots and how to calculate the number of black dots trapped..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center