Commit dbd87590 authored by Tt's avatar Tt

效果调整

parent 56afab1e
...@@ -266,13 +266,11 @@ cc.Class({ ...@@ -266,13 +266,11 @@ cc.Class({
} }
//copy-start 把物品的父节点换到中间的box上。 //copy-start 把物品的父节点换到中间的box上。
const box_mid = cc.find('Canvas/bg/box_mid'); const box_mid = cc.find('Canvas/bg/box_mid');
cc.tween(optionNode).to(0.2, { x: 0, y: 420 }, cc.easing.quadOut).call(() => {
optionNode.parent = box_mid; optionNode.parent = box_mid;
}).to(0.2, { x: 0, y: 100 }, cc.easing.quadOut).start();
//copy-end //copy-end
cc.tween(optionNode)
.to(0.2, { x: 0, y: 100 }, cc.easing.quadOut)
.start();
this.boxJump(); this.boxJump();
optionNode.optionData.selected = true; optionNode.optionData.selected = true;
...@@ -303,7 +301,13 @@ cc.Class({ ...@@ -303,7 +301,13 @@ cc.Class({
this.optionJump(btnSubmit, 0.05); this.optionJump(btnSubmit, 0.05);
this.playEffect('submit'); this.playEffect('submit');
const box = cc.find('Canvas/bg/box'); const box = cc.find('Canvas/bg/box');
if (box.children.every(child => child.optionData.selected == child.optionData.is_right)) {
//copy-start 把物品的父节点换到中间的box上。
const box_mid = cc.find('Canvas/bg/box_mid');
let children = box.children.concat(box_mid.children);
if (children.every(child => child.optionData.selected == child.optionData.is_right)) {
//copy-end
this.onAnswerRight(); this.onAnswerRight();
} else { } else {
this.coolCatSpeakWrong(() => { this.coolCatSpeakWrong(() => {
...@@ -376,6 +380,22 @@ cc.Class({ ...@@ -376,6 +380,22 @@ cc.Class({
.start(); .start();
}); });
//copy-start 把物品的父节点换到中间的box上。
const box_mid = cc.find('Canvas/bg/box_mid');
box_mid.children
.filter(child => child.optionData.selected)
.forEach(child => {
child.optionData.selected = false;
cc.tween(child)
.to(0.2, { x: child.startPos.x, y: child.startPos.y })
.call(() => {
child.parent = box;
})
.start();
});
//copy-end
this.playEffect('flyBackAll'); this.playEffect('flyBackAll');
}, },
......
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