iPhone:Learning Cocos2D project - iphone

I want to develop a game in a month by using the Cocos2D Open Source game engine. Learning Cocos2D is a bit hard and I don't know how to create my initial project by using the files provided by Cocos2D base project. I doubt whether it is possible?
Can I learn by using Cocos2D base project directly and modify it for my game application? Does the license allow me to use like that? ( Because I can't learn all OpenGL programming concepts and develop an application in a month, which is very hard. )
Appreciate your thoughts and advice.
Thank you.

, I have been programming games for iPhone for more than a year now! I started doing most of the things in Objective-C but then I learned that for most graphically ( or computation ) intensive games, Objective-C is not really the best option. There are a lot of paths like Pure Objective-C for logic, and inline C functions for the more "intensive" parts of your game, Obj-C does also let you use C++ files ( for the model classes for example ) with Obj-C++ (which is basically a .m Obj-c source code file but renamed to .mm for Obj-c++ ).
Having said that, Cocos-2D is in my opinion a wonderful library, it's mostly written in Obj-C but has pure C parts for the most CPU intensive stuff (physics it's chipmunk physics and Box2D, they also have a hash table library written in pure C to avoid calling NSDictionary a lot). Cocos2D is not hard to use, and you can get a nice game working quite fast!
You can embed the whole Cocos-2D to a project of yours, or just embed some useful parts of it (like Cocos-Live for On-Line scores, the Texture loaders, etc). You could also start working directly from the Cocos-2D Xcode project and remove what you don't need (like examples etc).
For a simple explanation of the Cocos-2D license , read Here !
About OpenGL, with Cocos you won't need to learn it deeply, unless you start getting into very custom stuff.
Having said all that, here are my recommendations :
1) GUI takes time, GUI can take a lot (even more than 50%) of your source code actually... so take that into consideration if you are going to have game menus, etc.. and adjust your time schedules to make the GUI coding fit!
2) When you have learned Cocos a bit, start playing with OpenGL, it's a wonderful ride, and it's really great to know a bit about the "Engine" of your "Car" so if your "Car" (Cocos2D) break's or doesn't do exactly what you want, you can always tweak here and there to make it work.

For what it's worth, I tried to pick up Objective C a few times over the last year but gave up pretty quickly each time (though I used to do C a lot in the early 90s). Just over a week ago, though, I watched some screencasts and eventually decided to start making my own game. I then discovered and gravitated toward using Cocos2D.
Now, 9 days later, I have a prototype of a game done (it's a kinda clone of Robotron 2084). It's been great fun doing it so far and while this is not the most up to date version (this was at the 1 week mark), this video will give you an idea of what I've achieved: http://www.youtube.com/watch?v=lzD6va1GiTI
I started by using the default Cocos2D project and just figuring it out and adding stuff as I went. I did a TON of Googling and often ended up here on Stack Overflow and on the Cocos2D iPhone forums (which are VERY useful). I've scratched my head a lot but it's been a fun experience (except for tracking down memory leaks ;-)).
Cocos2D is, I believe, LGPL licensed but has some extra clauses tagged on to make it even more free so you can use it in your iPhone game projects commercially or not without any problems.
I've found you don't need to learn much about OpenGL. I've copied and pasted some free snippets from here and there but they've been simple to figure out. Things like drawing lines and boxes, etc. I haven't learnt any "hard" OpenGL stuff. I've just stumbled and got a pretty long way, IMHO. I now feel pretty confident and am still finishing off this game to get it on the App Store and want to develop more!
Make sure to start with the latest Cocos2D 0.99-rc because they changed a lot of names and it'll annoy you if you have to upgrade in future. It's very stable and works fine. Go to http://www.cocos2d-iphone.org/download and download it, unpack, then run the template installer. Then create a project using the Cocos2D template in XCode and Build & Run it on the iPhone Simulator. You'll get a basic example that you can then dig around in. Read the Cocos2D iPhone "Programming Guide" on their site too and gradually figure out how to change the scene to do something you want it to do. Small steps, etc :-)

If you have programmed games before AND you have some experience with Objective-C THEN you could develop a game in a month. The complexity of the game is a big factor.

I think Cocos2d is a very good framework to help you get started in 2D game programming for the iPhone.
Here is a very nice tutorial that will get you started: link text

Related

Making games in iPhone

Can anyone tell me what should i use to make games for iPhone...
Actually i am a simple application programmer ...but never made complicated high graphics games...
i have made some games but only simple one...
Which tool is good for me to start....
i am aware of OPenGL...is it good to start with this ??
I'd say if you're reasonably competent with iOS & Objective-C, then it might be worth taking a peek at the likes of Cocos2D. There's also the iOS port of Flixel (which you can grab with the source to Canabalt which is sitting on Github), but compared to Cocos2D - it's a little less polished due to it only being recently out there.
Unity's great if you're familiar with C# or JavaScript and interested in wanting to do 3D games - and if you're not as interested in going the full-hog with learning OpenGL ES.
Corona is the best thing for you start looking into.
I'd suggest a trip to the bookstore, to find a book which speaks to you, regarding iPhone Game Dev. A quick look at Amazon reveals quite a number.
There's a lot to consider when making games, it's a huge topic.
You should check out Unity 3D.
For someone new to iPhone development and game dev in general, I'd say start with Cocoa Touch as it is simpler than OpenGL and you can create simple games (for example words games) with it. And even if you decide to develop an OpenGL app for the iOs you still need to work with Cocoa so there is no escape from learning it.
Once you get your head around objective-c/cocoa/xcode and iphone development in general, then start looking at OpenGL.

xcode basic game template

I am wondering if anyone knows of a open source or paid Xcode template.
It would be for a basic game, ( NOT COCOS2d ).
It would include simple items like profile management, load/save, Menu, Settings,
( perhaps include Openfeint/Game Center )
Something to use as a base for creating new games, things that get used over and over.
I am thinking about creating either a simple match three game, or maybe a card game.
Before I sat down and created one myself, I thought I would check to see if something
was available. ( No need to recreate the wheel right? )
Thanks everyone!
This isn't quite the solution you're looking for as it's not a game template, but it's worth checking out Sparrow - it's an open-source Objective C library so you don't need to learn anything new (unlike COCOS2D) and there's a nice Beginners Action Game tutorial you can follow.
Cheers..
If you don't want to use Cocos2D I guess you are thinking of 3D i.e. OpenGL ES games. If so, have a look at former question Alternative of Unity & SIO2. Maybe this is what you are looking for, but you should take SIO2 and Unity3D themselves into consideration. Especially Unity3D (I am just evaluating it the last 2 weeks) will save you a lot of work. SIO2 is a library using Blender for design and ships with customized exporter. It was open source since V1.4 but then they "convert" it into commercial software. What a pitty that the 1.4 source code is still not available at the according SF project.
There are two more engines: Unreal 3 Engine and Torque. I failed to find the pricing for Unreal now, but it might be something about 25% of your revenue or so. Torque stopped selling their 3D engine on iPhone and is now available in 2D only.
PS: Even for simple games I recommend using some kind of game engine, it will save you a lot of work compared to native XCode hacking.
You can use this template which is a well researched one available in the market.
http://www.binpress.com/app/ios-boilerplate-and-template/1597

Port Flash to iPhone

How hard would it be to port a flash game to the iPhone. Obviously Flash CS5 is no longer an options, I still would like to know if there's anything that can be reused? or do I have to write everything from scratch (Is Obj-C that different than ActionScript?) Is there any other shortcuts?
Also, if anyone has done this before please share your experience.
Flash is a very different platform, not only is the language change going to be an issue you're going to be going from Flash's renderer to presumably your own using OpenGL:ES.
Although another method may be to port your app to JavaScript. Both ActionScript and JavaScript are EMCAScript dialects, so very similar in that area, the APIs will be completely different though.
http://paulirish.com/work/gordon/demos/ interesting and slightly related, this is a implementation of Flash in JavaScript.
Note the new Apple T.O.S may affect you, but as far as I'm aware it's still a beta and I'm not Apple or a lawyer so I won't try and decipher it for you.
I am doing the same thing. I am using Cocos2d for iPhone. This is a pretty good 2d game engine. Actually, two apps created with it are in the current top 25. You are going to have to get down and dirty in Objective-C though. Objective-C is different from ActionScript but if you are use to object oriented programming you should be able to make the switch. Programming a Flash game is different than typical game programming done in Objective-C/C/C++. So, if you are familiar with how to do things in the Objective-C/C/C++ game programming world (render loop, capturing inputs, etc), you'll really be ok. If not, you'll have to get use to not having the Flash timeline, dealing with frames, etc. Good luck! You can do it!
read the statements from apple, no its not possible.
For my game Hudriks I used flash to build levels and some animations. For this an animation engine has been developed that supports motion tween, and then wrote JSFL scripts that goes through Flash objects and export to a format that can be parsed in my game.
For writing the JSFL - look for document called Extending Flash.
The rest was developed from scratch using Objective C with OpenGL. Do not see option of 'one-click' compilation or converting from Flash to iPhone (not considering CS5), but with developing extensions for Flash you could reuse some work.
It is hard, but it is possible. I am working on a automatic code converter now.

Quartz 2D vs OpenGL ES Learning Curve

I have been developing iPhone Applications for a couple of months. I would like to know your views about the Quartz vs OpenGL ES 1.x or 2.0 learning curve. You can tell your perspective. My Questions are
*I am a wannabe game developer, So is it a good idea to first develop in quartz , then move
on to OpenGL ES or does it not make an difference
*Can you please tell your experiences when you were having the similar question
Thanks :)
Quartz 2D is not applicable for game development IMHO. It is a software rendering API. It won't give you realtime rendering speed. It's good for drawing charts or vector text with shadows, or for blending several images together. Just not for games. Unless you want to make a game where few images are moving against a monochrome background and even in that case I doubt it will be really smooth on older devices. I've seen some games obviously coded with Quartz. A pitiful sight.
Sooner or later you'll end up using Open GL ES or a game framework build on top of it. I recommend you to check cocos2D, SIO2 engine, or examples from SDK.
With careful programming it is possible to make an Open GL ES game with parallax scrolling and relatively small amount of objects work at 60 FPS even on 2nd gen devices. Tiny Wings is an example of such game. And maintaining stable 30 FPS is not a problem at all.
I skipped Quartz and went right to OpenGL ES. I started with a 2D sprite based game. Thought it was pretty easy.
The key is having a good example to look at. I used the Lunar Lander clone (Crash Lander), but I don't think that's easy to find anymore. Maybe someone who has done it recently knows of a better, newer example that uses current best practices.
I'm in the same boat as you describe, although I have no programming background. (Although I don't know what your background is either) Currently, I am in the process of learning to code as I learn the various API's that are available. I'm an objective-c guy going backwards to the c-based Quartz API, and it's a little bit of a challenge. Luckily, Programming in Objective-C 2.0 by S. Kochan has a great chapter on underlying C features to keep you afloat.
I have taken a couple of stabs # OpenGLES, and I have to say, that from a conceptual standpoint, I'm not ready for it. The Quartz2d API is a bit easier to learn conceptually because it's very easy to get up & running with a few commands. Right now, I'm at the point where I can define shapes and point to point images with out too much trouble.
OpenGLES is going to be something in my future, but it takes such an enormous amount of code to configure the drawing view, set up buffers, etc. If you are familiar with everything the code is doing, then it's a bit easier. However, from a learning perspective, Quartz is an easier way to get going, quickly.
Resources I'm using: The aforementioned book, and an anemic amount of blogs containing tutorials, which are limited # best. At this point, make an appointment with the apple docs and get cozy, because it's about the best (free) stuff that's out there (& exhaustive) With that said, I'd love for someone to prove me wrong on this site by posting a great resource for learning, but that's about it. Good Luck.
I have been looking for the fundamental differences so I can decide between OpenGL (ES) or Quartz or a hybrid. The good news is that the hybrid is an option. Clearly Quartz is easier to master for O-O programming and the answer from Apple appears to be that OpenGL, "...is ideal for immersive types of applications..."
http://developer.apple.com/library/ios/#DOCUMENTATION/General/Conceptual/Devpedia-CocoaApp/DrawingModel.html
I don't want to limit the category to games as I believe any game UX can be applied to a business App, a productivity App, entertainment viewing, etc. By the same token, I fully expect the technology (both h/w and s/w) to advance to make either a choice.

What do I have to learn to get done with a 3D racing game for the iPhone? What Tools do I need?

I know Java pretty well. I know now most of the Basics in Objective-C.
I know nothing about Photoshop. I know how to use TurboCAD 10 Professional, so I do have some experience in 3D object modelling. Although not much.
What do I have to learn step-by-step, to come to 3D game Development for iPhone? What Tools do I need? Which Books help out? How long did you learn?
Learning the basic ins-and-outs of OpenGL ES on the iPhone took me about 3 weeks. I post some of my observations on the subject here. The source code to my Molecules iPhone application, which uses OpenGL ES, is available here. Maybe you'll be able to find something useful in that example. However, there's nothing in there that deals with textures, which you'll probably need for your game. Bill Dudney has posted source code for a Wavefront OBJ modeler on the iPhone that may help in that regard. For a good text on OpenGL ES, I'd recommend "Mobile 3D Graphics: with OpenGL ES and M3G".
When it comes to Cocoa development in general, it will take you a little while to get up to speed. For me, it was about 6 months before I felt comfortable with it, although that was in the more complex Mac desktop environment. I post some resources for learning Cocoa here, although that's by no means an exhaustive list.
I agree with diciu, this is a bit much for someone just starting out on the platform. I'd find a simpler application or series of targeted applications (that you may never even release) to help you learn the core concepts before you leap into 3-D game design.
Your goal is very ambitious - I think it's a very hard project to tackle as the first project on the iPhone and you'd be better off starting out with a couple of simple Cocoa touch applications to get a feel for the platform.
For a simulation game I would start with experimenting with some physics engine such as bullet. Bullet is C++ and you can use it from Objective-C++.
For rendering 3D you probably want to use OpenGL ES.
I guess that OpenGL is worth a look.