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?
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..