Beginning Box2D Physics Engine

What Is It? Cocos2d comes with two physics engines. One is called Chipmunk and the other is called Box2d. Chipmunk sounds cuter and is written in C, whereas Box2D is written in C++. I chose to learn Box2d because it seems to be the more popular and mature of the two. Instead of trying to … [READ THE FULL ARTICLE]

 

Although it has gotten better with the new generation of the iPhone, programmers must continue to be vigilant when it comes to memory usage if they want to avoid their applications crashing mysteriously. The best way to avoid the didReceiveMemoryWarning is to minimize memory usage from the get-go. Safest sex being abstinence and all that… … [READ THE FULL ARTICLE]

 

While playing around with various sample codes downloaded from the interwebs, I noticed that the addAnimation method of CCSprite has been deprecated. Though it continues to compile and run without a hitch, my OCD comes to the rescue. If you refer to the API reference for version 0.99.5 of Cocos2D (here if anyone is interested), … [READ THE FULL ARTICLE]

 
Part 2 of 2: Cocos2D Animation Using a Texture Sheet / Texture Atlas

This is a continuation of yesterday’s entry Animation in Cocos2D (running across the screen). I want to achieve the same animation but use a texture atlas instead of loading individual sprites. What is it? A texture atlas (sometimes called a texture sheet) is simply a single image which contains all (or some) of the sprites … [READ THE FULL ARTICLE]

 
Part 1 of 2: Cocos2D Animation (running across the screen)

Introduction I have always been mesmerized by video games and have wanted to make games since I started programming. The kind of games that I wanted to make were the kinds that were being produced by big studios with multi-million dollar budgets. So every time I tried to venture into it, I let myself get … [READ THE FULL ARTICLE]

 
Better Logging than NSLog

Here is a very simple but a useful tip. Instead of using NSLog to print out debugging information, define a custom macro that prints out the message along with the class name from which it is being printed only when it is in debug mode. This is very convenient because you do not have to … [READ THE FULL ARTICLE]

 
Unknown class CLASS NAME in Interface Builder file

Every now and then I run into a issue that ends up taking disproportionately inordinate amount of time to the simplicity of the problem. I ran into such an issue a couple days ago. I checked and rechecked but I continued to get an error message in my console whenever I ran the project. The … [READ THE FULL ARTICLE]

 

I told myself that I would keep this blog updated, but I’ve been derelict in keeping my self-made promise. So I am putting forth the effort to post more regularly. Even before the iPhone was released to the public, I saw a demo video of the iPhone and one of the things that blew me … [READ THE FULL ARTICLE]

 

It is trivially easy to trim beginning and trailing spaces in Java. You just call 1 " some string ".trim() and that’s the end of it. It’s not hard in Objective-C, but it’s a bit more verbose. 1 2 3 4 NSString *s = @" I am a string to be trimmed "; NSString *trimmed= … [READ THE FULL ARTICLE]

 

So there isn’t a real way to write private methods in Objective-C. What I tried to for a while is to just write the methods in the .m file and simply omit the declarations in the .h file. This would be quite annoying when you call the private methods before they are defined in the … [READ THE FULL ARTICLE]

© 2012 Uchidacoonga Suffusion theme by Sayontan Sinha