lunes, 7 de enero de 2013

The beginning: Cocos2D

I didn't have any previous knowledge of Objective-C before I started programming with the framework Cocos2d. I only read a tutorial of the basics of this programming language which was provided by our mentors in the Praktikum I was starting.

It wasn't difficult for me because of my experience in C and OOP in Java. The most difficult thing was remembering the order of the arguments and colons in the signature ;-)

For me it was important to learn on demand. Do you like (or just know, it may be sufficient) functional programming in Haskell? I'm like lazy evaluation ;-) No, just kidding... But it's true in some sense. I started in small team and each one had assigned some tasks with features to be developed. I looked for it in the internet, in my book, ask teammates, ...
The first week I learnt how to set the scene and characters, the next one, how to make an animation with frames, ... All of this tasks were surely not completely correct at the beginning but the knowledge have grown with my experience and I still like learning new ways of doing what I had implemented before.
Thus, my tip for you would be to think a simple game or app and try to develop it in order to learn.

Installing Cocos2D is not difficult, just download from the official site, read the instructions contained in the folder and run the instal-templates.sh.
Now, creating a project using this framework is really easy: You just have to choose a Cocos2D template. There are three options:



Which one should you use? It depends on your needs and your programming skills on C or C++:

  • The basic "cocos2d": recommended for beginners and for projects without physics. Don't be confused with the name, professional games have been developed with this template.
  • Cocos2d with Box2D: the most widely used in projects with physics because it's written in C++. It demands a change of the extension to .mm to all files importing this library. An advantage of this library is that there are a lot of documentation, tutorials, ...
  • Cocos2d with Chipmunk: my favorite for projects with physics. It doesn't affect the code and you don't need to change any extension. It's simple, easy and it's written in C.


The main bibliography I've used as reference are:
  • The tutorial I mentioned at the beginning of the post
  • A digital version of a Cocos2D book
Also, it's very useful to check in the oficial site forum and sometimes at the Apple's web for developers (like this). This last one only as reference. 


But this is just the beginning. The fun starts now...

No hay comentarios:

Publicar un comentario