fsm engine for cocos2dx