Commit 7dc86ead authored by linzhiguo's avatar linzhiguo

+ 完成判定

+ 强制完成,测试使用
parent f350e187
......@@ -5685,8 +5685,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "button",
"_N$string": "button",
"_string": "强制完成",
"_N$string": "强制完成",
"_fontSize": 20,
"_lineHeight": 40,
"_enableWrapText": false,
......
......@@ -233,9 +233,13 @@ cc.Class({
let ot = node.getComponent(cc.js.getClassByName('WordOption'));
ot.copyValues(selected);
ot.selected(true);
kind.showCorrect(node);
kind.showCorrect(node, ()=>{
if (this.tryFinish())
this.pageFinish();
});
selected.target.removeFromParent();
selected.target = null;
break;
}
}
......@@ -566,6 +570,18 @@ cc.Class({
//this.resetData();
},
tryFinish(){
let item, op, len = this._move_area.childrenCount;
for(let i = 0; i < len; i++){
item = this._move_area.children[i];
op = item.getComponent(cc.js.getClassByName('WordOption'));
if (op.kind_id >= 0){
return false;
}
}
return true;
},
update (dt) {
if (!this._moved)
return;
......
......@@ -97,7 +97,7 @@ cc.Class({
playDragonBoneAnimation(this.animate_node, 'newAnimation', 1, cb);
},
showCorrect(ot){
showCorrect(ot, cb){
ot.x = 0;
ot.y = 0;
let item = ot.getComponent(cc.js.getClassByName('WordOption'));
......@@ -118,7 +118,7 @@ cc.Class({
.call(()=>{
option.adjustPicSize();
console.log(option);
cb && cb();
})
.start();
this.show_node.active = false;
......
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