随笔分类 -  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 阅读全文
posted @ 2020-04-14 10:00 剑小破 阅读(883) 评论(1) 推荐(0)
摘要:``` 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 阅读全文
posted @ 2020-04-06 15:46 剑小破 阅读(964) 评论(0) 推荐(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 阅读全文
posted @ 2020-03-19 14:18 剑小破 阅读(2427) 评论(0) 推荐(0)