Cocos2D Training Requirements?

I would like to make a 2D game for the iPhone, I did some research, and Cocos2D really seems to be the best option, I'm just wondering how much knowledge about Objective-C I need before I do Cocos2D. I know the basics of programming in Objective-C - I can create a basic command line tool application. I did some tutorials on the iOS SDK, but I did not know how to make an iOS application if asked, because the tutorials that I am currently running are about three years old.

What is required as pre-training before using Cocos2D and does anyone know any good resources? I'm more of a visual student, so I find the video more useful than books or blog posts.

Thank you in advance for your time and any help :)

+4
source share
5 answers

No prior training required. Use it. If you're stuck on something, look google or ask a question.

Meaning: Do not waste time studying general concepts without actually being in a situation of the need to apply them.

Analogy: you do not need a graduate student in mechanical engineering to drive a car, although this can help in case of any problems. But in this case, just do what 99% of all people do: seek help. It hardly makes sense to first examine the potential problems that may arise with the car, you deal with them as they arise.

Also: disappointment is part of the game, and this cannot be avoided. :)

+3
source

how much knowledge of objective-c will i need

A lot of. You need to master Objective-C before trying to make such a large project.

And to understand Objective-C, you need to have a very solid knowledge of C.

(Also, to use third-party Cocos2D lile frameworks, make sure you understand the basic default libraries such as Foundation and UIKit.)

+1
source

To create games like Free flow, all you need is an average knowledge of Objective-C. But if you plan to do something like Temple Run, then you need really good knowledge of Objective-C, Open-Gl and cocos2d ..

The site I would recommend is raywenderlich.com, where I started, and they have tutorials from a really basic level to a really advanced level.

Hope this helps

0
source

The answer to this depends on who you are, your work ethic, and how much effort you are willing to agree to. I would say that if you have solid foundations with other OO languages ​​/ frames, your quest is possible. I would start by “repurposing” a freely available game (you will find many good examples and tutorials from Ray Wenderlich , as well as Steffen Itterheim . Choose a sample project that is not too “removed” from your game specification, and reprogram it. In doing so, you will hack objective-C and some of the basic frameworks that you need to understand. Mastery will follow if you are committed to this and stick to it. Also, SO rules: many answers are available here: relevant questions will give a lot of useful tips and solutions to solve i have problems.

ps. My biggest learning curve turned out to be xCode, a truly mysterious and dogmatic IDE. I have since switched to a different IDE, and my performance has returned to decent levels.

0
source

I recently selected Objective-C and cocos2d at the same time. At first, I read a lot about Objective-C to give me a tutorial. Besides syntax, most of this knowledge remains unused in my game. The most important things to learn about Objective-C before you start learning cocos2d are memory management and debugging.

Managing the counter’s memory can take about a minute to get used to what languages ​​you are in. The general rule is that if you wrote / copied (without autorelease) or saved it, you should release it at some point, and if you need to use something outside the current area, you must save it. You can see from some cocos2d examples of rewriting the dealloc method of objects to free up everything that you created / saved.

Debugging took me a minute to get used to. This helps if you add a high-level try / catch block that you can use to catch thrown exceptions, otherwise some of your errors will give you little information to continue. You can also research / ruin some parameters of your project to provide a better trick of errors, for example, including zombies. The big cause of crashes in Objective-C is sending messages to already freed objects. As soon as you encounter a badaccess error that you cannot understand, basically you will be forced to get a knee in this material to find out the reason.

Some other useful Objective-C knowledge that comes in handy is very familiar with how NSArray and NSDictionary work, how they automatically save / release, and how they can hold objects (without primitive values). To work with float / int and arrays / dictionaries, you need to convert the primitives into something like an NSNumber object, which can be done quite easily with a little research. Another useful task is to know how to save / load layers. Convenient methods exist for this in NSArray and NSDictionary objects. This, along with a little knowledge of NSFileManager, should be enough to help you save / load game states. If you want to get some fantasy / clarity in coding, you'll also learn about observers in objective-c. KVO can be great for automatically updating your user interface when changing the properties of certain objects. For example, my HUD KVOs are for the player’s life, so when the life value changes, the HUD is automatically updated. This may allow you to make a cleaner application like MVC. You can also register to listen to other types of messages (not just property changes), just make sure you unregister your listeners when you are finished listening.

My final tip is to always pay attention to Xcode warnings. If you get it and you don’t know why, you should find out why. Some simple ones that you might ignore, others may cause errors that you cannot track in any other way. For example, I once used the max () function in my code, and xcode gave me a strange warning that I did not understand. This caused chaos in my program, damaging the stack. When I changed max () to MAX (), three or four inexplicable errors instantly disappeared. Things like this can help you go back and seriously comb every part of your code if you don't understand it right away.

You can basically find out the rest by looking at the code / examples of cocos2d. Good luck.

0
source

All Articles