a BFS method create for cocos2dx