Migrating to cocos2d-iphone v3 - Tips & Tricks

On March 6, 2014, in idevblogaday, by Steffen Itterheim

This is a collection of Tips & Tricks for users who are migrating to cocos2d-iphone v3 from v2. Mostly refers to questions posted on stackoverflow.com.

Please excuse the short, bullet-pointed format. I’m a little short on time but didn’t want to miss out on another biweekly post like I did two weeks ago (first time in about 4 years, ouch).

General Tips

  • Many classes have been renamed…

“Use the source, Luke!” If you don’t find what you are looking for:
- Check the cocos2d API class reference
- Start typing the class or method name, see what suggestions Xcode autocomplete has for you
- Use part of the class name (ie “repeatforever”) and perform a “Find in Project” to search through all source code files

  • Tutorial XYZ won’t work with v3!

Yes, it won’t. Most likely it was written for cocos2d-iphone v2.
Question is: do you have to use v3? And do you have to use it right now?
Because if you’re in the process of learning cocos2d it’ll be easier to learn from and with v2 tutorials/books for the time being until more v3 tutorials have been published.

  • How to upgrade an existing cocos2d v2 project to v3?

Continue reading »

Kobold2D 2.0 is out now!

On June 30, 2012, in Kobold2D, by Steffen Itterheim

Go grab it here:

 
Download Kobold2D 2.0 and read the Release Notes here.

The Kobold2D and libraries API References are here.

You can use the Kobold2D API References even if you’re not using Kobold2D, since the API References of the 3rd party libraries are unmodified. For example this includes the only Box2D API Reference that’s available online, and separate API References for cocos2d (iOS) and cocos2d (Mac).

Continue reading »

Tagged with:  

Kobold2D v1.0.4 now available!

On February 22, 2012, in Kobold2D, by Steffen Itterheim

Kobold2D v1.0.4 is available from the Kobold2D Download page!

I’m terribly sorry for the hiccup with v1.0.3. There was an absolute path causing build failures for others, which of course worked on my systems so I didn’t catch it. I retracted v1.0.3 shortly after publishing it. The fixed version is now v1.0.4. If you happen to have downloaded v1.0.3 I recommend to upgrade to v1.0.4 right away.

The most important improvements in this version are Xcode 4.3 compatibility and working around a “file not found ../libkobold2d-ios.a” issue caused by the Xcode 4 Build Location setting “Locations Specified by Targets” (in Xcode 4.3 this setting is now appropriately named “Legacy”).

The Release Notes lists all the changes.

Continue reading »

Tagged with:  

Kobold2D v1.0.2 now available

On January 27, 2012, in Kobold2D, by Steffen Itterheim

Kobold2D v1.0.2 is now available from the Kobold2D Download page!

Read the Release Notes for detailed list of changes. Most of them are minor as this is a maintenance release, but there’s a bug fix in KKInput’s gesturePanRecognizer that fixes the incorrect translation and velocity values. If you’re using the pan gesture I recommend to upgrade.

I’ve also taken the time to attempt to clarify what Kobold2D is about with this … imagram:

I’ve been reading and enjoying blah blah blah (not to be confused with blah blah blah) which prompted me to try a more visual approach. I highly recommend reading Dan Roam’s book! I’m sure you can’t draw either, but you should do it anyway. Or try Xmind.

Hmmm … have you ever noticed how many great things start or end with an x?

Tagged with:  

This quick comparison sheet gives you all the info to decide whether to use Cocos2D 1.x or Cocos2D 2.x. Contrary to most programs, a higher version number doesn’t infer “better” or “more”. There are pros and cons for both versions.

At the time of this writing the decision really only boils down to whether you want to use shaders and whether you must be able to deploy your app to 1st & 2nd generation devices. See for yourself, it’s that simple:

Cocos2D v1.x

(+) compatible with all iOS devices
(+) compatible with all libraries
(-) no OpenGL ES 2.0 shader programs

Cocos2D v2.x

(+) OpenGL ES 2.0 shader programs
(-) incompatible with armv6 CPU devices:
iPhone, iPhone 3G, iPod Touch 1G & 2G
(-) incompatible with these libraries:
Cocos3D 0.x.x, Chipmunk SpaceManager 0.1.2

All other differences to this day are minor, and most new features and bugfixes have been migrated back and forth between versions. For beginners I strongly recommend using v1.x as there’s a lot more documentation available for this version. Those who have no interest in writing shader programs can also safely use the v1.x branch without missing out.

Continue reading »

Whaaaaaat?

You heard right: if you want to forget about using retain, release and autorelease in your code, then the newly introduced automatic reference counting (ARC) mechanism (aka “automatic memory management”) is the way to go. And guess what?

Kobold2D Preview 6 fully supports ARC out of the box!

Download Kobold2D Preview 6

You may have heard that Cocos2D is incompatible with ARC at this time, and you’re right. However, the Cocos2D version in Kobold2D Preview 6 released just now has been improved to work with ARC. This post explains the most important changes to make Cocos2D compatible with ARC. All 15 Kobold2D example projects compile with and without ARC, just like the other libraries Kobold2D makes use of!

Continue reading »

Learn Cocos2D 2nd Edition: What’s New & Release Date

On September 30, 2011, in book, cocos2d, Kobold2D, by Steffen Itterheim

Scheduled for release on November 7th, 2011.

Continue reading »

Kobold2D: Upgrading your Projects is easy!

On September 3, 2011, in cocos2d, Kobold2D, tools, by Steffen Itterheim

A couple months ago I wrote a tutorial explaining how to upgrade Cocos2D in an existing project.

I was able to cut the description down to only five concrete steps, but there’s still a lot of text to follow and caveats to consider. I designed Kobold2D exactly to make it easy to solve the issue of upgrading projects to newer versions of the game engine.

Continue reading »

Tagged with:  
Page 1 of 212