Commit f1477097 authored by Tt's avatar Tt

文件名修改

parent 9d75b679
...@@ -169,6 +169,7 @@ cc.Class({ ...@@ -169,6 +169,7 @@ cc.Class({
//TODO:copy //TODO:copy
this.hideFlower(); this.hideFlower();
this.firstCar();
this.coolCatSpeakStart(() => { this.coolCatSpeakStart(() => {
this.showSubmitBtn(); this.showSubmitBtn();
...@@ -193,6 +194,8 @@ cc.Class({ ...@@ -193,6 +194,8 @@ cc.Class({
//TODO:copy---start //TODO:copy---start
const maxOptionHeight = 400; const maxOptionHeight = 400;
const maxOptionWidth = (canvasWidth * 0.8) / optionNum; const maxOptionWidth = (canvasWidth * 0.8) / optionNum;
this.hideFlower();
this.optionNodes = [];
//TODO:copy---end //TODO:copy---end
const arr = randomSortByArr(this.data.question_arr[questionIdx].option_arr); const arr = randomSortByArr(this.data.question_arr[questionIdx].option_arr);
...@@ -203,10 +206,13 @@ cc.Class({ ...@@ -203,10 +206,13 @@ 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;
//TODO:copy---start
this.optionNodes.push(optionNode);
cc.tween(optionNode) cc.tween(optionNode)
.to(0.1, { scale: Math.min((maxOptionWidth * 0.80) / optionNode.width, maxOptionHeight / optionNode.height) }) .to(0.2, { scale: Math.min((maxOptionWidth * 0.80) / optionNode.width * 1.05, maxOptionHeight / optionNode.height) * 1.05 })
.to(0.2, { scale: Math.min((maxOptionWidth * 0.80) / optionNode.width, maxOptionHeight / optionNode.height) })
.start(); .start();
//TODO:copy---end
}); });
}, },
...@@ -300,6 +306,13 @@ cc.Class({ ...@@ -300,6 +306,13 @@ cc.Class({
if (box.children.every(child => child.optionData.selected == child.optionData.is_right)) { if (box.children.every(child => child.optionData.selected == child.optionData.is_right)) {
this.onAnswerRight(); this.onAnswerRight();
} else { } else {
//TODO:copy--start
const car1 = cc.find('Canvas/bg/car_1');
car1.scale = 1;
cc.tween(car1).to(0.3, { scale: 0.9 }).to(0.3, { scale: 1.05 }).to(0.3, { scale: 1 }).start();
//TODO:copy--end
this.coolCatSpeakWrong(() => { this.coolCatSpeakWrong(() => {
this.status.wrongTime++; this.status.wrongTime++;
if (this.status.wrongTime < this.data.maxWrongNumber) { if (this.status.wrongTime < this.data.maxWrongNumber) {
...@@ -338,13 +351,69 @@ cc.Class({ ...@@ -338,13 +351,69 @@ cc.Class({
}, },
//TODO:copy---start //TODO:copy---start
firstCar() {
let pos1 = cc.v2(-30, -440);
let pos2 = cc.v2(2200, -440);
let pos3 = cc.v2(-2200, -440);
const car1 = cc.find('Canvas/bg/car_1');
const car2 = cc.find('Canvas/bg/car_2');
const car3 = cc.find('Canvas/bg/car_3');
car1.x = pos2.x;
car1.y = pos2.y;
car2.x = pos2.x;
car2.y = pos2.y;
cc.tween(car1).to(1, { x: pos1.x }).start();
},
showFlower() { showFlower() {
const flower = cc.find('Canvas/bg/烟花_ske'); for (let i = 1; i <= 3; i++) {
flower.active = true; const flower = cc.find(`Canvas/bg/car_${i}/车尾气_ske`);
flower.active = true;
}
let pos1 = cc.v2(-30, -440);
let pos2 = cc.v2(2200, -440);
let pos3 = cc.v2(-2200, -440);
const car1 = cc.find('Canvas/bg/car_1');
const car2 = cc.find('Canvas/bg/car_2');
const car3 = cc.find('Canvas/bg/car_3');
car1.x = pos1.x;
car1.y = pos2.y;
cc.tween(car1).to(1, { x: pos3.x }).start();
if (this.status.currentQuestionIdx + 1 < this.data.question_arr.length) {
car2.x = pos2.x;
car2.y = pos2.y;
cc.tween(car2).to(1, { x: pos1.x }).start();
}
this.optionNodes.forEach(optionNode => {
if (optionNode.optionData.selected) {
optionNode.active = false;
}
})
setTimeout(() => {
this.optionNodes.forEach(optionNode => {
optionNode.active = false;
})
}, 500);
}, },
hideFlower() { hideFlower() {
const flower = cc.find('Canvas/bg/烟花_ske'); for (let i = 1; i <= 3; i++) {
flower.active = false; const flower = cc.find(`Canvas/bg/car_${i}/车尾气_ske`);
flower.active = false;
}
let pos1 = cc.v2(-30, -440);
let pos2 = cc.v2(2200, -440);
let pos3 = cc.v2(-2200, -440);
const car1 = cc.find('Canvas/bg/car_1');
const car2 = cc.find('Canvas/bg/car_2');
const car3 = cc.find('Canvas/bg/car_3');
car1.x = pos1.x;
car1.y = pos2.y;
car2.x = pos2.x;
car2.y = pos2.y;
}, },
//TODO:copy---end //TODO:copy---end
......
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