Commit cac65637 authored by liujiangnan's avatar liujiangnan

feat

parent 1d38a7a2
...@@ -117,8 +117,7 @@ cc.Class({ ...@@ -117,8 +117,7 @@ cc.Class({
if (this.isGameStart !== true) { if (this.isGameStart !== true) {
const res = await asyncCallNetworkApiGet('/api/douyin/v1/getwords', {roomid: this.roomId, uid: this.uid}); const res = await asyncCallNetworkApiGet('/api/douyin/v1/getwords', {roomid: this.roomId, uid: this.uid});
this.data = JSON.parse(res); this.data = JSON.parse(res);
this.preloadItem() this.preloadItem();
cc.find(`Canvas/ready`).active = false;
this.isGameStart = true; this.isGameStart = true;
} }
} else { } else {
...@@ -558,6 +557,8 @@ cc.Class({ ...@@ -558,6 +557,8 @@ cc.Class({
loadEnd() { loadEnd() {
this.initData(); this.initData();
this.initView(); this.initView();
cc.find(`Canvas/ready`).active = false;
}, },
...@@ -1064,7 +1065,6 @@ cc.Class({ ...@@ -1064,7 +1065,6 @@ cc.Class({
return return
} }
console.log('item.letter: ', item.letter);
this.canTouch = false; this.canTouch = false;
const isRightLetter = this.checkLetterIsRight(item.letter); const isRightLetter = this.checkLetterIsRight(item.letter);
...@@ -1084,12 +1084,17 @@ cc.Class({ ...@@ -1084,12 +1084,17 @@ cc.Class({
const popDisTime = 0.03; const popDisTime = 0.03;
let popTime = (this.curPopArr.length) * popDisTime; let popTime = (this.curPopArr.length) * popDisTime;
let tempScore = 0;
for (let i=0; i<this.curPopArr.length; i++) { for (let i=0; i<this.curPopArr.length; i++) {
tempScore += (i+1);
this.delayCall(i * popDisTime, () => { this.delayCall(i * popDisTime, () => {
this.itemPop(this.curPopArr[i], i+1); 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.canTouch = false;
this.delayCall(popTime, () => { this.delayCall(popTime, () => {
...@@ -1285,7 +1290,6 @@ cc.Class({ ...@@ -1285,7 +1290,6 @@ cc.Class({
fillEmptyItem() { fillEmptyItem() {
console.log(' in fillEmptyItem')
this.fillItemObj = {}; this.fillItemObj = {};
this.moveItemArr = []; this.moveItemArr = [];
...@@ -1309,22 +1313,18 @@ cc.Class({ ...@@ -1309,22 +1313,18 @@ cc.Class({
} else { } else {
console.log('tileObj[X][Y].item: ', tileObj[X][Y].item);
if (moveCount > 0) { if (moveCount > 0) {
this.moveItemArr.push({item:tileObj[X][Y].item, moveCount}); this.moveItemArr.push({item:tileObj[X][Y].item, moveCount});
} }
} }
} }
console.log('moveCount: ', moveCount);
if (moveCount > 0) { if (moveCount > 0) {
this.needCreateArr.push({X, count: moveCount}) this.needCreateArr.push({X, count: moveCount})
} }
} }
console.log("this.moveItemArr: ", this.moveItemArr);
this.moveItem(); this.moveItem();
this.fillItem(); 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