Commit b941090d authored by Tt's avatar Tt

fix

parent 489b8b25
...@@ -210,9 +210,6 @@ cc.Class({ ...@@ -210,9 +210,6 @@ cc.Class({
this.loadingLayer.onLoadFinished(() => { this.loadingLayer.onLoadFinished(() => {
this.refreshCoolCatPosition(); this.refreshCoolCatPosition();
//TODO:copy
this.hideFlower();
this.coolCatSpeakStart(() => { this.coolCatSpeakStart(() => {
this.startCountTime(); this.startCountTime();
this.jumpToQuestion(this.status.currentQuestionIdx); this.jumpToQuestion(this.status.currentQuestionIdx);
...@@ -245,8 +242,9 @@ cc.Class({ ...@@ -245,8 +242,9 @@ cc.Class({
const canvasHeight = cc.find("Canvas").height; const canvasHeight = cc.find("Canvas").height;
const optionNum = this.data.question_arr[questionIdx].option_arr.length; const optionNum = this.data.question_arr[questionIdx].option_arr.length;
//TODO:copy---start //TODO:copy---start
this.hideFlower();
const maxOptionHeight = 400; const maxOptionHeight = 400;
const maxOptionWidth = (canvasWidth * 0.8) / optionNum > 300 ? 300 : (canvasWidth * 0.8) / optionNum; const maxOptionWidth = (canvasWidth * 0.8) / optionNum;
const box_mid = cc.find('Canvas/bg/box_mid'); const box_mid = cc.find('Canvas/bg/box_mid');
box_mid.removeAllChildren(); box_mid.removeAllChildren();
//TODO:copy---end //TODO:copy---end
...@@ -259,14 +257,10 @@ cc.Class({ ...@@ -259,14 +257,10 @@ cc.Class({
optionNode.y = canvasHeight / 2 - box.y - 300; optionNode.y = canvasHeight / 2 - box.y - 300;
optionNode.scale = 0; optionNode.scale = 0;
optionNode.parent = box; optionNode.parent = box;
optionNode.targetScale = Math.min((maxOptionWidth * 0.80) / optionNode.width, maxOptionHeight / optionNode.height)
cc.tween(optionNode) cc.tween(optionNode)
.to(0.1, { .to(0.1, { scale: optionNode.targetScale })
scale: Math.min(
(maxOptionWidth * 0.8) / optionNode.width,
maxOptionHeight / optionNode.height
),
})
.start(); .start();
}); });
}, },
...@@ -335,7 +329,7 @@ cc.Class({ ...@@ -335,7 +329,7 @@ cc.Class({
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(() => { 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(); }).to(0.2, { x: 0, y: 100, scale: 0.6 }, cc.easing.quadOut).start();
//copy-end //copy-end
...@@ -495,6 +489,8 @@ cc.Class({ ...@@ -495,6 +489,8 @@ cc.Class({
//TODO:copy---start //TODO:copy---start
showFlower() { showFlower() {
const flower = cc.find('Canvas/bg/烟花_ske'); const flower = cc.find('Canvas/bg/烟花_ske');
const db = flower.getComponent(dragonBones.ArmatureDisplay)
db.playAnimation("normal", 1)
flower.active = true; flower.active = true;
}, },
hideFlower() { hideFlower() {
...@@ -505,6 +501,8 @@ cc.Class({ ...@@ -505,6 +501,8 @@ cc.Class({
onAnswerRight() { onAnswerRight() {
//TODO:copy---放烟花时机修改
this.showFlower();
this.coolCatSpeakRight(() => { this.coolCatSpeakRight(() => {
//TODO:copy //TODO:copy
...@@ -521,7 +519,7 @@ cc.Class({ ...@@ -521,7 +519,7 @@ cc.Class({
.forEach((child) => { .forEach((child) => {
child.optionData.selected = false; child.optionData.selected = false;
cc.tween(child) cc.tween(child)
.to(0.2, { x: child.startPos.x, y: child.startPos.y }) .to(0.2, { x: child.startPos.x, y: child.startPos.y, scale: child.targetScale })
.start(); .start();
}); });
...@@ -532,7 +530,7 @@ cc.Class({ ...@@ -532,7 +530,7 @@ cc.Class({
.forEach(child => { .forEach(child => {
child.optionData.selected = false; child.optionData.selected = false;
cc.tween(child) cc.tween(child)
.to(0.2, { x: child.startPos.x, y: child.startPos.y }) .to(0.2, { x: child.startPos.x, y: child.startPos.y, scale: child.targetScale })
.call(() => { .call(() => {
child.parent = box; child.parent = box;
}) })
...@@ -563,9 +561,6 @@ cc.Class({ ...@@ -563,9 +561,6 @@ cc.Class({
}, 0.1 * 1000) }, 0.1 * 1000)
); );
} else { } else {
//TODO:copy
this.showFlower();
this.coolCatSpeakEnd(() => { this.coolCatSpeakEnd(() => {
this.submitBtnMoveOut(); this.submitBtnMoveOut();
this.showNextBtn(); this.showNextBtn();
......
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