Commit cac65637 authored by liujiangnan's avatar liujiangnan

feat

parent 1d38a7a2
......@@ -117,8 +117,7 @@ cc.Class({
if (this.isGameStart !== true) {
const res = await asyncCallNetworkApiGet('/api/douyin/v1/getwords', {roomid: this.roomId, uid: this.uid});
this.data = JSON.parse(res);
this.preloadItem()
cc.find(`Canvas/ready`).active = false;
this.preloadItem();
this.isGameStart = true;
}
} else {
......@@ -558,6 +557,8 @@ cc.Class({
loadEnd() {
this.initData();
this.initView();
cc.find(`Canvas/ready`).active = false;
},
......@@ -1064,7 +1065,6 @@ cc.Class({
return
}
console.log('item.letter: ', item.letter);
this.canTouch = false;
const isRightLetter = this.checkLetterIsRight(item.letter);
......@@ -1084,12 +1084,17 @@ cc.Class({
const popDisTime = 0.03;
let popTime = (this.curPopArr.length) * popDisTime;
let tempScore = 0;
for (let i=0; i<this.curPopArr.length; i++) {
tempScore += (i+1);
this.delayCall(i * popDisTime, () => {
this.itemPop(this.curPopArr[i], i+1);
})
}
if (tempScore) {
// 上报成绩
asyncCallNetworkApiGet('/api/douyin/v1/score', {roomid: this.roomId, uid: this.uid, score: tempScore}).then(()=>{});
}
this.canTouch = false;
this.delayCall(popTime, () => {
......@@ -1285,7 +1290,6 @@ cc.Class({
fillEmptyItem() {
console.log(' in fillEmptyItem')
this.fillItemObj = {};
this.moveItemArr = [];
......@@ -1309,22 +1313,18 @@ cc.Class({
} else {
console.log('tileObj[X][Y].item: ', tileObj[X][Y].item);
if (moveCount > 0) {
this.moveItemArr.push({item:tileObj[X][Y].item, moveCount});
}
}
}
console.log('moveCount: ', moveCount);
if (moveCount > 0) {
this.needCreateArr.push({X, count: moveCount})
}
}
console.log("this.moveItemArr: ", this.moveItemArr);
this.moveItem();
this.fillItem();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment