2 many bugs clone for iphone help

Nibbie
Posts: 2
Joined: 2010.12
Post: #1
Hey guys!

Have you heard of the flash game 2 Many bugs?
(If not then here´s the URL for the game: http://www.flashgames247.com/play/622.html.

The game is about capturing bugs and making them merge into one to gather points. You do that by drawing a circle around them and if the bugs are of the same species then they merge and you get points)

I´m trying to develop a clone of this game for iphone but I´m stuck.

The thing is that I don´t know how to get the code to "feel" when the startpoint (of the touch) and the endpoint (where I lift up my finger after drawing the circle) are connected. I cannot get the code as well to "know" if there is anything inside that specific circle so it could see if they are of the same species or not.

I´ve gooled and I´ve checked at the iphonedev site but nothing.

Can anyone help me or even maybe know what to look for to be able to get this to work?

Thanx in advance!
Quote this message in a reply
Member
Posts: 245
Joined: 2005.11
Post: #2
Well, the startpoint and endpoint would be the same (or at least close together) when they were connected. As for knowing what is inside the loop, you'd have to check the coordinates of the various bugs in you game world and work out which ones were inside the area. Defining "inside the area" for this test would be the tricky part.
Perhaps you could describe the loop as a series of vector. For each bug, find the edge it is closest to, and then work out which side of the vector it is on. If the loop goes clockwise and your bug lies on the right of the vector then it is inside the loop.
I'm sure someone else will come along with a fantastically easy way of doing this now, but that's the first approach that comes to mind.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2010.12
Post: #3
Thanx for taking time to explain this. Smile

it sounded a bit complicated. I´m not sure if I understood all of it. Smile
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  how to make a Castlevania/metroid clone Rhade 1 3,981 Jun 11, 2008 08:26 PM
Last Post: kodex