I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Designer's Studio (/forum-6.html)
+--- Thread: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... (/thread-8285.html)
I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - stansoft - Nov 9, 2010 03:36 PM
Hello good people.
I have an interesting idea (at least in my mind) for an iPhone game and for the game to work, I would need to have the pinch-to-zoom (and pinch-to-zoom-out) functionality similar to the one you see in say the Google Maps app.
The game "Angry Birds" for instance also has this functionality and you can zoom-in and zoom-out of the game by the way of pinching...
Since my game will take place in a city similar to this one and will have an identical view from on top (http://www.istockphoto.com/stock-illustration-12650327-town-plan.php), players will need to be able to zoom-in and zoom-out of it, and so my question is, how is this functionality achievable in an iPhone game and do I have to draw the game in a certain program (for instance Illustrator) to make it work?!
I need to do the game in such a way that if you zoom in, the buildings will become larger, etc., if you zoom-out, they become smaller, etc.
Please let me know everything you know about this!!
Your answers will be greatly appreciated!!
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - skyhawk - Nov 9, 2010 05:38 PM
1) you don't draw games in programs (like illustrator). You'd most likely use opengl.
2) pinch and zoom is very easy to implement with apple's touch events and opengl.
Also I'm taking it that you've never looked at game designing in your life, and thus do not know the basics. At the very least, you have the most basic idea of a requirement in your mind.
Let us help you flesh out your idea.
1) What's the goal of the player?
2) Is there a scoring mechanism?
3) what's the point of zooming in and out? Does it add to the game?
4) Is it single player or multiplayer?
5) Sprite based or vector based or a combination?
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - stansoft - Nov 9, 2010 11:28 PM
You're right man, I have never looked at game designing in my life and this will my first iPhone game, so please be patient with me!! I'm a fast learner though
Now to answer your questions:
1. The goal of the player is to visit as many houses as possible within a certain time frame.
2. Yes, if you pick up different things along the way and avoid bad roads you will get bonus points for that and so at the end of the level players will see their final scores...
3. The point of zooming in and zooming out is to see which houses you already visited and which you still need to visit on a single screen!
4. I was thinking single player at first and then adding multiplayer down the road.
5. Probably a combination. I'm guessing I will need sprite for things such as the car, right?!
Also, do you think "Angry Birds" was designed using opengl?!
Also, can I design the levels on paper or using Illustrator and then re-do them on opengl or what would you recommend?! Basically where do I go from here?!
Thanks in advance!!
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - OneSadCookie - Nov 10, 2010 12:54 AM
Find yourself a programmer who's willing to work with you. Make sure you check that they've actually shipped an iPhone game before. Ideas are a dime a dozen and most people would rather work on their own ideas than someone else's, so you'll have to offer *something*. Royalty split probably isn't enough, judging by responses around here, though if you're providing the artwork then you might get somewhere like that.
They'll listen to your game design, evaluate how hard it will be to build, make some technical decisions about feasibility and implementation details, and tell you what format they want your artwork in. Whatever they specify, it'll be bitmaps they want, though there may be benefits to working in a vector drawing program, still. They may ask for compromises for ease of implementation or for performance. For example, the picture you linked has houses everywhere and arbitrarily curvy roads, which will make the implementation significantly harder than an approach based on small square tiles.
Or, if you don't mind waiting a few years to ship your game, you could learn to program. I didn't get the impression that's what you were looking at, though.
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - stansoft - Nov 10, 2010 01:36 PM
@ OneSadCookie: Thanks for the tips! I want to learn programming but not right now.
OK, if I'm providing the artwork (which I am) in what program do I have to create it, so that the programmers can then take my artwork and put it into a game, make it interactive, etc?!
Can I draw the levels say in Illustrator and then give it to somebody who works with opengl so that this somebody can re-create the levels I did in opengl?! Basically please let me know what should I do in regards to this matter and how do I go about creating the levels?! The levels are the most important part of the game so if I have them ready, everything else will be much easier... I think...
P.S. As for finding a programmer, that will not be a problem as there are a lot of companies such as http://www.sourcebits.com that will do the app from start to finish and for a surprisingly low price... not to mention freelance sites such as oDesk.com, etc
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - OneSadCookie - Nov 10, 2010 02:15 PM
what program you use to draw in makes no difference. Chances are your programmer will want PNGs to work with, but anything that can export a PNG is fair game.
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - stansoft - Nov 10, 2010 11:00 PM
@OneSadCookie: Got it. Yeah, I don't think there will be an issue with converting illustrator files to PNG...
But how will this work? So let's say I have all the levels ready in PNG, so what's next?! How will the programmer do the pinch-to-zoom functionality in PNG and how will he make the car drivable on the roads, etc?! Will he need to convert PNG files to some other format to make it work or what?!
Please explain in as many detail as possible!!
Thanks in advance!!
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - ThemsAllTook - Nov 10, 2010 11:21 PM
There are many (infinite) ways to implement this sort of thing. I can try to give a few examples...
PNGs can be loaded with libpng, UIImage, or several other options. The result is that the pixels in the image are decompressed and loaded into memory in a way that allows them to be manipulated and drawn using OpenGL or UIKit.
For pinch zooming, if the game's graphics are drawn with OpenGL, one would presumably use UIPinchGestureRecognizer to detect pinches and adjust the OpenGL modelview matrix to zoom in or out. If drawn with UIKit, UIScrollView's built-in pinch zoom functionality could be used.
As far as making cars drive on roads, you may need to do some additional markup to differentiate regions of your image for game behavior. You could use a specially colored image that's not actually displayed but matches up to what the user sees, where a particular pixel color represents "driveable road", "solid object", etc. From a programmer's perspective, you'd then test the color of the pixel the car was on and determine its behavior based on that. (This is a simplified a bit, but that's the gist of it.)
Hope that gives you some useful perspective.
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - skyhawk - Nov 10, 2010 11:25 PM
(Nov 10, 2010 11:00 PM)stansoft Wrote: @OneSadCookie: Got it. Yeah, I don't think there will be an issue with converting illustrator files to PNG...no...
What you're asking is like trying to explain a combustion engine to a secretary. We can explain, but I don't think you will understand what we're saying.
1) You don't "pinch-to-zoom" the png. You will detect the pinch (via touch events), and adjust your opengl view appropriate such that you are closer or farther to your image.
2) Likely you will need a mechanism from the user to determine how to steer the car. Either "Touch and your car will drive here" which will involve pathfinding, or simulate a directional pad. This of course does not take into account wheel physics, but the realism you want is up to your design.
3) Well, the PNG will likely be converted to a texture and just be in world space. If you're smart and you don't draw everyone in one picture, then it will be drawn in layers: terrain, objects/houses, car, overhead (clouds? Trees?), optional HUD.
I mean, what I've described are just high level concepts. If you want to see code, search the forums for other issues people have had, and observe.
Alternatively, pick up a book or check out a website that has a tutorial about designing games. I really don't feel like doing your basic 101 homework for you.
RE: I have a game idea for an iPhone, and have a question in regards to pinch-to-zoom... - stansoft - Nov 11, 2010 02:03 AM
@ThemsAllTook: WOW, thanks for all the great insight man, I appreciate it!!
@skyhawk: Well, I did understand what "ThemsAllTook" was talking about because like I said, I'm a fast-learner.
1. Got it.
2. The mechanism will be simple - touch and drag the car, to drive it with you finger...
3. So basically create different layers in PNG and then make them all work together in opengl, right?
Also, I did start reading about all the basics on a few sites, so I am doing what you mentioned! It's a fascinating world I must add!! I'm loving it!!