It seems like a no-brainer to most computer-affiniados and gamers: eventually, all video games will be distributed online. The question is only, when? To retailers this seems to be a whole different story. Most of them are in denial, as I can tell from occasionally reading retail game publishing magazines. They’ll be in for quite [...]
This continues and concludes the previous post of the Fast Pixel-Perfect Collision Detection for Cocos2D with Example Code (1/2) article. Testing for pixelMask collision with a rectangle Testing for an individual point is simple, testing for a rectangle such as the bounding box of another node requires more work. Not just to write the code, [...]
Detecting collisions on pixel-perfect boundaries is the holy grail of collision detection in 2D games. As such, it seems like the ideal, if not to say perfect, solution to collision detection in general. Yet, it’s also quite complicated and the straightforward solutions don’t perform very well until you start optimizing the code. This first post [...]
Cocos2D’s CCRenderTexture class is shrouded in mysteries. Part of it because it has a low-level aura to it, and most certainly because it simply works differently than most Cocos2D nodes. In this tutorial you’ll learn all about CCRenderTexture and what you can use it for. The CCRenderTexture demo project will guide you through basic uses [...]
I took Mike Ash’s performance measuring code from 2008 with the improvements made by Stuart Carnie in early 2010 and turned that into a performance measuring project for 2012. I know it’s still 2011, consider this a forward-looking statement. In any case, the test project is available for download, ready to run, includes Cocos2D v1.0.1 [...]
I have no doubt that automatic reference counting (ARC) is the next big leap forward for Objective-C since the introduction of Objective-C 2.0. ARC allows you to put the burden of memory management on the (Apple LLVM 3.0) compiler, and never think about retain, release and autorelease ever again. Since many user’s first experiences with [...]
I haven’t been able to find a list of all Objective-C @ compiler directives in one place. We all know the keywords like @interface and @implementation but others like @dynamic and @encode are lesser known, and possibly even much less understood. Although I know most of them already, I couldn’t shake the feeling that I [...]
What do you do if your app doesn’t behave as it should, or even crashes? Answer A: Post your problem in just about every programming forum. Answer B: Use the Xcode Debugger to analyze what’s going wrong. Since most of you already know how to do A I’ll focus on B in this Xcode 4 [...]
Most developers have heard of the phrase “Eat your own dog food”. It refers to the habit of actually using what you’re creating. A typical example would be a company building Yet-Another-Issue-Tracking-Tool™ while using said issue tracker to manage their Yet-Another-Issue-Tracking-Tool™ project. And you’ll surely have heard of a game engine that was initially only [...]
While writing the Learn Cocos2D book I was surprised to find that Cocos2D’s CCSpriteBatchNode was only able to increase the performance of several hundred bullet sprites on screen by about 10-15% (20 to 22.5 fps). I wanted to re-visit that scenario for a long time because as far as I understood, the more sprites I [...]


































































