Commit 5eabc7e7 authored by Tt's avatar Tt

fix

parent 454cbced
...@@ -167,9 +167,6 @@ cc.Class({ ...@@ -167,9 +167,6 @@ cc.Class({
initView() { initView() {
this.refreshCoolCatPosition(); this.refreshCoolCatPosition();
//TODO:copy
this.hideFlower();
this.coolCatSpeakStart(() => { this.coolCatSpeakStart(() => {
this.showSubmitBtn(); this.showSubmitBtn();
this.jumpToQuestion(this.status.currentQuestionIdx); this.jumpToQuestion(this.status.currentQuestionIdx);
...@@ -191,8 +188,9 @@ cc.Class({ ...@@ -191,8 +188,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
...@@ -205,9 +203,10 @@ cc.Class({ ...@@ -205,9 +203,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, { scale: Math.min((maxOptionWidth * 0.80) / optionNode.width, maxOptionHeight / optionNode.height) }) .to(0.1, { scale: optionNode.targetScale })
.start(); .start();
}); });
}, },
...@@ -268,7 +267,7 @@ cc.Class({ ...@@ -268,7 +267,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
this.boxJump(); this.boxJump();
...@@ -350,6 +349,8 @@ cc.Class({ ...@@ -350,6 +349,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() {
...@@ -360,6 +361,8 @@ cc.Class({ ...@@ -360,6 +361,8 @@ cc.Class({
onAnswerRight() { onAnswerRight() {
//TODO:copy---放烟花时机修改
this.showFlower();
this.coolCatSpeakRight(() => { this.coolCatSpeakRight(() => {
//TODO:copy //TODO:copy
...@@ -376,7 +379,7 @@ cc.Class({ ...@@ -376,7 +379,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();
}); });
...@@ -388,7 +391,7 @@ cc.Class({ ...@@ -388,7 +391,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;
}) })
...@@ -421,9 +424,6 @@ cc.Class({ ...@@ -421,9 +424,6 @@ cc.Class({
this.jumpToQuestion(this.status.currentQuestionIdx); this.jumpToQuestion(this.status.currentQuestionIdx);
}, 0.1 * 1000); }, 0.1 * 1000);
} else { } else {
//TODO:copy---放烟花时机修改
this.showFlower();
this.hideSubmitBtn(); this.hideSubmitBtn();
this.coolCatSpeakEnd(() => { this.coolCatSpeakEnd(() => {
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