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?
Printable View
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?
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.
thanks for your reply.. may i know how to make that? can u give me the sample code?
Please write the code for making the lines.
actually i have not made any code because i cant find the logic.. my application is quite complicated.. Attachment 74085
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..