2 many bugs clone for iphone help - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: 2 many bugs clone for iphone help (/thread-8444.html)
2 many bugs clone for iphone help - Chris - Dec 21, 2010 07:35 AM
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!
RE: 2 many bugs clone for iphone help - backslash - Dec 21, 2010 11:00 AM
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.
RE: 2 many bugs clone for iphone help - Chris - Dec 21, 2010 02:54 PM
Thanx for taking time to explain this.
it sounded a bit complicated. I´m not sure if I understood all of it.