tags:

views:

1158

answers:

4

Hello all,

I want to learn and develop game using Cocos2D free project in a month. Learning Cocos2D is a bit hard and i don't know how to create my project initially same like Cocos2D project and use the files from Cocos2D project to my project. I doubt whether it is possible? Can i learn and use Cocos2D project itself directly and modify it for my game application? Is it free license 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 advise me.

Thank you.

A: 

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.

willc2
No. I want to develop OpenGL game only as my game will have 2D/3D graphics and i don't want to develop using CoreAnimation.
Yes, you can use 3D stuff in cocos2d too. Cocos2d primarily focuses on making 2D games easier but nevertheless it allows you to use full OpenGL with no restrictions and even has some support for 3D effects like transitions, ripples and a camera.Our soon to be released game Black Hole was written with cocos2d and uses 3D objects for all the asteroids and the Earth, because this allowed us to do smooth animations with only a fraction of the memory usage of 2D images.I'm running a cocos2d FAQ at my site http://www.learn-cocos2d.com and will add a lesson about using 3D features with cocos2d.
GamingHorror
+3  A: 

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 :-)

Peter Cooper
Great explanations. Right to go! Creating a separate project and picking all necessary files from Cocos2d and adding into my project is giving lot of errors(>2000 errors), couldn't even figured out the errors. So I've used the same Cocos2d project itself and removed all unnecessary items by keeping only one project finally, and modifying that based on my requirement. Can i go ahead?
+6  A: 

Hello! , 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 to use C++ files ( for the model classes for example ) with Obj-C++ (which is basically a .m obj-c source coude file but renamed to .mm for obj-c++ ).

Ok, after that, Cocos-2D in my opinion is a wonderful library, it's mostly written in Obj-C but has pure C parts for expensive stuff ( physics it's chipmunk physics and Box2D, they also have a hash table part written in pure C to avoid calling NSDictionary a lot ). Cocos 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 can 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, a Games GUI can take a lot ( even 50%! ) of your source code actually... so consider that if you are going to have menus, etc 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" (cocos) break's or doesn't do exactly what you want, you can always tweak here and there.

I hope this proves helpful for you.

Mr.Gando
Wonderful Mr.Gando. Thank you very much.
A: 

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

gpyles
Cocos2d is only for 2d programming not for 3d programming? Can't we use 3d programming concepts too in Cocos2d project?