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 v1.0 Preview 5 released!

On October 12, 2011, in Announcements, cocos2d, Kobold2D, by Steffen Itterheim

To put it in Apple’s words: “Taking Cocos2D to a whole new level.” I can’t brag with 200+ new features though I have a few in store that should make a big bang for no bucks! 😀

So, here speaketh the market crier for Kobold2D. What’s new and noteworthy about this version of Kobold2D, you ask?

Built-In Gesture Recognition

Recognizing gestures has never been this easy. No (speak: zero) iOS SDK knowledge required! All gesture recognizers provided by the iOS SDK are implemented:
Tap, Double-Tap, Long-Press, Swipe, Pan, Rotation and Pinch.

Continue reading »

Kobold2D: Polling User Input with KKInput

On September 15, 2011, in cocos2d, Kobold2D, Programming, by Steffen Itterheim

Kobold2D is about solving annoying, recurring problems, or simply making all things Cocos2D more convenient. The new KKInput class does both! (*)

Continue reading »

[Solved] weird scene changing bug…

On July 27, 2010, in cocos2d, by Steffen Itterheim

I need help. I’ve run into strange problems with a very simple cocos2d v0.99.4 project created from the cocos2d project template. It’s two scenes with a layer each, much like the regular HelloWorldScene layer. Each scene is simply supposed to replace itself with the other scene, on touch. What happens is that the first scene started with runWithScene is never deallocated after the first scene change. So it stays in memory and keeps receiving the touches, which means a touch is always behaving as if switching from the first to the second scene.

What’s more, if I add the onEnter and onEnterTransitionDidFinish methods to the first scene, without adding any code to them, the first scene/layer doesn’t receive any touch events at all. The second scene doesn’t show this behavior and works fine with these methods implemented.

Maybe I’m just overlooking the very obvious, if you could take a look and let me know if there’s anything I’m doing wrong with this code please let me know! Thank you.

Download the code here: ScenesAndLayers02

Tagged with: