随笔分类 - cocosCreator
摘要:``` const webSocketHelper = cc.Class({ extends: cc.Component, createWs(){ this.ws = new WebSocket("ws://127.0.0.1:8888"); this.ws.onopen = function (event) { console.log("已连接."); }.bind(this); this.ws
阅读全文
摘要:``` searchRoad(start_x,start_y,end_x,end_y){ var openList=[], //开启列表 closeList=[], //关闭列表 result=[], //结果数组 result_index; //结果数组在开启列表中的序号 openList.push({x:start_x,y:start_y,G:0});//把当前点加入到开启列表中,并且G是0
阅读全文
摘要:``` const HttpHelper = cc.Class({ extends: cc.Component, /** * get请求 * @param {string} url * @param {function} callback */ get(url, callback) { var xhr = cc.loader.getXMLHttpRequest(); console.log("St
阅读全文

浙公网安备 33010602011771号