refactored to use cocos2d-html5 3.0 alpha