Source code from the book Learning Cocos2D modified to work with Cocos2D 2.0