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 »

Cocos2D v2.1 and Storyboards: Done Right!

On May 17, 2013, in idevblogaday, by Steffen Itterheim

Screen Shot 2013-05-17 at 01.05.51There are many Cocos2D + Storyboard tutorials, it’s about time to do another one that’s done right. Also, this one’s backwards: we’ll start with a Cocos2D template and then add Storyboards to it. The tutorial will work for existing Cocos2D projects to which you wish to add Storyboards, too!

I’ll show you how to add Storyboards to a Cocos2D v2.1 project, with ARC enabled of course. This approach will take a little more work, but the solution will be complete and you gain a fair understanding of how things work together. Plus two custom but reusable View and Navigation controller classes, and I’ll show you what changes you need to make to the AppDelegate.

The resulting project will work with iOS 5 and iOS 6 and autorotation. The navigation and cocos view controllers are separated, and you will be able to subclass them for code customizations as is customary in Cocoa. Cool? Cool, cool, cool!

As usual you can grab the example project (Cocos2D + Box2D + Storyboards with ARC enabled) from github. I’ll also be adding a Storyboards template project to KoboldTouch in the next update, and document what’s special about the KoboldTouch solution.

Oh, only one thing … this tutorial is part of Essential Cocos2D. Head on over and enjoy!

There are two classes of scrolling, "fake" and "real".

Altogether there are four ways to create a scrolling view in Cocos2D: with CCCamera, with CCFollow, manually moving a layer and "faking it".

I’ll discuss each approach and show their advantages and disadvantages as well as point out for which types of games they work best.

The example projects for this article can be downloaded from github.

Fake Scrolling - Creating the Illusion of Movement

Ideal for "endless scrolling" games. Typical genres include jumping or running games like Doodle Jump and Canabalt, as well as shoot’em ups.

These games mainly scroll along one axis, often scrolling only in one direction. The other axis has a limited range or is not scrolled at all. The fake scrolling approach prevents the coordinates of game objects to "explode" to similarly infinite coordinate points. This could introduce rounding errors in floating point values which may accumulate over time, causing inaccuracies at later stages of the game.

To create the illusion of scrolling, at least two background image sprites are needed. Four are needed if you also want to scroll a little along the minor scrolling axis. The background images must be repeating seamlessly, and each must be at least the size of the screen. The trick is to use the two or four images and move them in the opposite direction of where the player is supposedly heading.

Continue reading »

For one week only (until Tuesday, December 18th) CartoonSmart runs an exclusive offer for Learn Cocos2D readers:

You get 50% off on the Angry Ninjas, Wave Attack and Awesome E-Book Starter Kits Bundle!

The bundle also includes several Tutorial Videos plus free bonuses: the Isometric Pixel Art Tutorial for Photoshop, the royalty free Vector Art Collection and the first 120 pages of the interactive Cocos2D iOS Game Programming iBook.

The iOS App Development & Starter Kit Bundle normally sells for $100 but you can get it for $49.95 until Tuesday, December 18th.

This is an affiliate link - if you make a purchase I’ll receive a commission. It’ll help me pay off my new iMac (still working with a 2009 model). :)

Line-Drawing Starter Kit still 50% off

While I’m at it: my Line-Drawing Starterkit’s Xmas Sale (50% off to $49.95) still has some of the 100 coupon codes left!

I keep forgetting that if I don’t keep mentioning it, sales slow down dramatically. It’s called marketing (in my case: not doing enough of it). If you have a product that doesn’t sell as much as you expect - perhaps you need to mention it more? You would be surprised how much of a difference frequent blog posts or tweets can make.

So here you go. This new iMac is rather expensive. :)

KoboldTouch vs cocos2d-iphone Architecture Comparison

On November 7, 2012, in KoboldTouch, by Steffen Itterheim

I posted a KoboldTouch vs cocos2d-iphone architecture comparison chart to the KoboldTouch product page.

It’s only a start to better explain how KoboldTouch compares with cocos2d-iphone.

KoboldTouch Mini-Game

I’m now working on a KoboldTouch mini-game to showcase the KoboldTouch workflow and features. It’ll be the basis for the KoboldTouch Introduction Tutorial.

I’ll post a video presentation of the project and key points once it’s done. If you’re interested you can follow KoboldTouch development via PivotalTracker.

The mini-game project is also very important to “eat my own dogfood”. Even just a simple game made several things that didn’t feel right obvious, and presents opportunities for improvement.

I’m happy that the KoboldTouch users requested this simple game tutorial.

Excellent Growth

Speaking of members: leaving aside the initial 2-day launch rush, on average two new members sign up every day.

If KoboldTouch continues to grow at this rate, it will have 100 members before Xmas! That would be a major milestone I did not expect to achieve before February/March!

You can help KoboldTouch by taking 5 minutes of your time to complete the Cocos2D Developer Survey. I’ll post the results in a week and what they mean for KoboldTouch.

New Cocos2D & iOS Products Hot Off The Keyboard!

On September 20, 2012, in Marketing, by Steffen Itterheim

Learn cocos2d 2 is hot off the press and it once again entered Apress’ weekly bestseller chart (see banner on far right).

Now with iOS 6 released it’s about time I updated my Affiliate Products page.

Because there have been some awesome new products released. In order of most recently released:

 

iOS 6 by Tutorials

iOS 6 by Tutorials

Ray Wenderlich and his team wasted no time in releasing this massive 1,500 pages tutorial double-whopper that’s actually a 5-star iOS 6 gourmet menu!

For a limited time the book is 10% off ($44) and you can also get it in a bundle with the previous iOS 5 by Tutorials book.

 

Commander Cool Game Starter Kit

Create your own platformer game for iOS and Mac with this game kit made with Cocos2D. As always with CartoonSmart products, you get an hour-long video documentation. Jump, run and be cool!

Commander Cool is available in both a personal license ($100) and a developer license ($350) which allows you to build apps for clients based on the kit.

 

Paralaxer: Cross-Platform Platformer Kit

        

 
Paralaxer is possibly the first commercial game kit available that uses Cocos2D-X. Ported to iOS, Android, Windows and Mac it also comes with a free ebook “How to Make a Platformer Game With Cocos2D-X” by Nat Weiss - who previously created the iPhone Action RPG engine.

If you’re working with Cocos2D-X you should spend $49 (limited time) on this excellent starter kit!

It’s a worthy investment, and so far the only really good example code plus documentation resource for Cocos2D-X you can find.

KoboldTouch - 2D Game Development

On September 14, 2012, in , by Steffen Itterheim

 

KoboldTouch brings you the best 2D game development experience for Apple’s platforms!

KoboldTouch is the only Objective-C, ARC-enabled 2D game engine built on the Model-View-Controller (MVC) design pattern. Write ambitious games with greater ease!

KoboldTouch is also a continuously evolving, customer driven game development framework for iOS & Mac OS X, designed by game industry veterans to incorporate game development best practices and decades of experience.


Learn more about KoboldTouch features and what’s in it for you:

Open the “About KoboldTouch” Page for Details


Not quite ready for KoboldTouch yet?

Fill out the KoboldTouch Survey. Let us know what you think of KT and how to make it better.


Get KoboldTouch!

KoboldTouch is available as a subscription program that entitles you to updates and support.

Choose Your Support & Updates Plan

Recurring billing may be cancelled at any time. The yearly plan is non-recurring.

Monthly

$14.95


You will be charged $14.95 every month.

Quarterly

$39.95


You will be charged $39.95 every 3 months.

One Year

$119.95


You will be charged $119.95 once. No automatic rebills.

 

60-Day Money Back Guarantee

If you’re not satisfied you can request a refund within 60-days from the date of purchase, directly via Clickbank.



Learnflash: Great OpenGL ES 2.0 Tutorials & References

On July 13, 2012, in Programming, by Steffen Itterheim

Right now I’m trying to freshen up what little I know of OpenGL ES 1.1 so I’m up to speed with OpenGL ES 2.0. I keep using the old ES 1.1 functions, so I thought I’d take the opportunity to re-learn OpenGL ES 2.0 from the ground up.

This OpenGL ES 2.0 Primer is helpful if you want to gain an understanding what’s different (and cool) about OpenGL ES 2.0 when compared to 1.1. It won’t teach you how to use OpenGL ES 2.0 though. The High-End 3D Graphics with OpenGL ES 2.0 PDF covers the concepts in greater detail, and quickly runs you through all important processes from initialization to compiling shaders to shutting down OpenGL ES 2.0. Again I didn’t learn how to program but it helped me understand the GL ES 2.0 concepts.

But what I really wanted was to learn how to do things with OpenGL in the context of cocos2d. Which means I just need to draw stuff, I don’t need to know how to load textures and setup the viewport and things like that. Nevertheless, Ray Wenderlich has done a great job explaining how to create a OpenGL ES 2.0 iPhone project from scratch. And Jeff LaMarche covered ES 2.0 shaders in great detail.

Continue reading »

Tagged with:  
Page 1 of 41234