Commit 038f81bd authored by Tt's avatar Tt

init

parent 8d989163
...@@ -333,12 +333,11 @@ cc.Class({ ...@@ -333,12 +333,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');
optionNode.parent = box_mid; cc.tween(optionNode).to(0.2, { x: 0, y: 420 }, cc.easing.quadOut).call(() => {
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();
...@@ -371,10 +370,11 @@ cc.Class({ ...@@ -371,10 +370,11 @@ 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 ( const box_mid = cc.find('Canvas/bg/box_mid');
box.children.every( let children = box.children.concat(box_mid.children);
(child) => child.optionData.selected == child.optionData.is_right if (children.every(
) (child) => child.optionData.selected == child.optionData.is_right
)
) { ) {
this.onAnswerRight(); this.onAnswerRight();
} else { } else {
...@@ -525,6 +525,21 @@ cc.Class({ ...@@ -525,6 +525,21 @@ 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