BFS for cocos2dx