Commit 64170931 authored by Tt's avatar Tt

fix

parent aba64064
......@@ -369,20 +369,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2176,
"height": 1600
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
-800,
0,
0,
0,
......@@ -425,7 +425,7 @@
"__uuid__": "b7f30449-ba98-4ee8-b0bf-6fec93526ef4"
},
"_type": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -448,10 +448,10 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_alignFlags": 4,
"_left": 0,
"_right": 0,
"_top": 0,
"_top": 263,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
......
......@@ -211,6 +211,7 @@ cc.Class({
this.refreshCoolCatPosition();
//TODO:copy
this.updateBg();
this.hideFlower();
this.firstCar();
......@@ -222,6 +223,16 @@ cc.Class({
this.coolCatSpeak(this.data.startLoadingAudio);
},
updateBg() {
let bgSky = cc.find("Canvas/bg/bgSky");
if (bgSky.isScaled) return;
let scaleX = cc.winSize.width / bgSky.width;
let scaleY = cc.winSize.height / bgSky.height;
let scale = scaleX > scaleY ? scaleX : scaleY;
bgSky.isScaled = true;
bgSky.width *= scale
bgSky.height *= scale
},
startCountTime() {
this._gameStartTime = new Date().getTime();
......@@ -260,11 +271,12 @@ cc.Class({
optionNode.y = canvasHeight / 2 - box.y - 300;
optionNode.scale = 0;
optionNode.parent = box;
optionNode.targetScale = Math.min((maxOptionWidth * 0.80) / optionNode.width, maxOptionHeight / optionNode.height)
//TODO:copy---start
this.optionNodes.push(optionNode);
cc.tween(optionNode)
.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) })
.to(0.2, { scale: optionNode.targetScale * 1.05 })
.to(0.2, { scale: optionNode.targetScale })
.start();
//TODO:copy---end
});
......@@ -331,7 +343,7 @@ cc.Class({
}
cc.tween(optionNode)
.to(0.2, { x: 0, y: 100 }, cc.easing.quadOut)
.to(0.2, { x: 0, y: 100, scale: 0.6 }, cc.easing.quadOut)
.start();
this.boxJump();
......@@ -495,8 +507,8 @@ cc.Class({
//TODO:copy---start
firstCar() {
let pos1 = cc.v2(-30, -440);
let pos2 = cc.v2(2200, -440);
let pos3 = cc.v2(-2200, -440);
let pos2 = cc.v2(2500, -440);
let pos3 = cc.v2(-2500, -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');
......@@ -507,17 +519,18 @@ cc.Class({
cc.tween(car1).to(1, { x: pos1.x }).start();
},
showFlower() {
for (let i = 1; i <= 3; i++) {
for (let i = 1; i <= 2; i++) {
const flower = cc.find(`Canvas/bg/car_${i}/车尾气_ske`);
const db = flower.getComponent(dragonBones.ArmatureDisplay)
db.playAnimation("normal", 1)
flower.active = true;
}
let pos1 = cc.v2(-30, -440);
let pos2 = cc.v2(2200, -440);
let pos3 = cc.v2(-2200, -440);
let pos2 = cc.v2(2500, -440);
let pos3 = cc.v2(-2500, -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).by(0.2, { x: -60 }).by(0.2, { x: -100 }).by(0.2, { x: -120 }).by(0.2, { x: -140 }).by(0.2, { x: -180 }).to(1, { x: pos3.x }, cc.easing.quadIn).start();
......@@ -541,17 +554,16 @@ cc.Class({
}, 500);
},
hideFlower() {
for (let i = 1; i <= 3; i++) {
for (let i = 1; i <= 2; i++) {
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);
let pos2 = cc.v2(2500, -440);
let pos3 = cc.v2(-2500, -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;
......@@ -579,7 +591,7 @@ cc.Class({
.forEach((child) => {
child.optionData.selected = false;
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();
});
......
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