Added refactored version with upgrade to cocos2d-x-2.1.4