Commit 4749dfda authored by 范雪寒's avatar 范雪寒

feat: savearea插件失败

parent 2f224257
......@@ -572,8 +572,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
587,
-304,
547,
-264,
0,
0,
0,
......@@ -616,7 +616,7 @@
"__uuid__": "ba7e8674-648a-49ee-9f6f-2903e1beac33"
},
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -659,10 +659,10 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_left": 0,
"_right": 10,
"_top": 0,
"_bottom": 10,
"_left": 1189,
"_right": 50,
"_top": 623,
"_bottom": 50,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -671,8 +671,8 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_originalWidth": 86,
"_originalHeight": 92,
"_id": "ddgxKrZeRCD5yonPhJlnTQ"
},
{
......
// import { getSprNode } from "./util";
import { getSprNode, playAudioByUrl, randomSortByArr, playAudio, showTrebleFirework, RandomInt, asyncDelay } from "./util";
import { getSprNode, playAudioByUrl, randomSortByArr, playAudio, showTrebleFirework, RandomInt, asyncDelay, exchangeNodePos } from "./util";
cc.Class({
extends: cc.Component,
......@@ -255,7 +255,7 @@ cc.Class({
this.bigStarArr = [];
let baseX = this.canvas.width / 2 - 50 * this._mapScaleMin;
let baseX = this.canvas.width / 2 - 80 * this._mapScaleMin;
let baseY = this.canvas.height / 2 - 80 * this._mapScaleMin;
let disH = 80 * this._mapScaleMin;
for (let i = 0; i < gArr.length; i++) {
......@@ -270,8 +270,8 @@ cc.Class({
starBg.star = starTop;
const starBig = getSprNode('icon_bigstar');
starBg.addChild(starBig);
starBig.active = false;
starTop.addChild(starBig);
starBig.angle = -90;
starBg.starBig = starBig;
this.bigStarArr.push(starBg);
......@@ -324,6 +324,7 @@ cc.Class({
showSoundBtn() {
const btn = cc.find('Canvas/btn_laba')
btn.scale = this._mapScaleMin;
btn.zIndex = 1;
},
startBtnClicked() {
......@@ -622,47 +623,66 @@ cc.Class({
}
const bigStarBg = this.bigStarArr[this.groupIndex];
const starBig = bigStarBg.starBig;
const star = bigStarBg.star;
star.active = true;
star.opacity = 0;
star.scale = 1;
star.angle = 0;
const starBig = bigStarBg.starBig;
starBig.active = true;
starBig.scale = 1;
starBig.angle = -90;
star.scaleX = 0.7;
star.angle = 90;
const canvas = cc.find('Canvas');
const startPos = star.parent.convertToNodeSpaceAR(canvas.convertToWorldSpaceAR(cc.v2(0, -canvas.height / 2)));
starBig.x = startPos.x;
starBig.y = startPos.y;
const startPos = exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 2));
const middlePos = exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 4));
star.x = startPos.x;
star.y = startPos.y;
star.y = startPos.y - starBig.height;
console.log('middlePos = ' + JSON.stringify(middlePos));
const time = 1;
cc.tween(star)
.to(time, { x: 0 }, { easing: 'quadIn' })
.to(0.3, { y: middlePos.y + 80 }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y + 40, scaleX: 1.2, scaleY: 0.8 }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y, scaleX: 1, scaleY: 1 }, { easing: 'quadOut' })
.delay(0.1)
.to(0.8, { angle: -720 })
.start();
cc.tween(star)
.to(time, { angle: -720 })
.delay(0.6)
.to(0.8, { x: 0 }, { easing: 'quadIn' })
.start();
cc.tween(star)
.to(time, { y: 0, scale: 1, opacity: 255 }, { easing: 'quadOut' })
.delay(0.6)
.to(0.8, { y: 0 }, { easing: 'quadOut' })
.start();
cc.tween(starBig)
.delay(0.6)
.to(0.8, { scale: 0 }, { easing: 'quadOut' })
.call(() => {
this.checkGameEnd();
})
.start();
cc.tween(starBig)
.to(time, { x: 0 }, { easing: 'quadIn' })
.start();
cc.tween(starBig)
.to(time, { angle: -720 - 90 })
.start();
cc.tween(starBig)
.to(time, { y: 0, scale: 0 }, { easing: 'quadOut' })
.start();
// cc.tween(star)
// .to(time, { x: 0 }, { easing: 'quadIn' })
// .start();
// cc.tween(star)
// .to(time, { angle: -720 })
// .start();
// cc.tween(star)
// .to(time, { y: 0, scale: 1, opacity: 255 }, { easing: 'quadOut' })
// .call(() => {
// this.checkGameEnd();
// })
// .start();
// cc.tween(starBig)
// .to(time, { x: 0 }, { easing: 'quadIn' })
// .start();
// cc.tween(starBig)
// .to(time, { angle: -720 - 90 })
// .start();
// cc.tween(starBig)
// .to(time, { y: 0, scale: 0 }, { easing: 'quadOut' })
// .start();
playAudio(this.bigStarClip);
},
......@@ -679,8 +699,8 @@ cc.Class({
await asyncDelay(1);
this.initCurGroup();
this.showQuestion(()=>{
this.showQuestion(() => {
this.showOnePenguin();
});
},
......
......@@ -42,8 +42,8 @@ export function getAngleByPos(px, py, mx, my) {
}
export function exchangeNodePos(baseNode, targetNode) {
return baseNode.convertToNodeSpaceAR(targetNode._parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y)));
export function exchangeNodePos(targetNode, baseNode, basePos) {
return targetNode.convertToNodeSpaceAR(baseNode.convertToWorldSpaceAR(cc.v2(basePos.x, basePos.y)));
}
export function RandomInt(a, b = 0) {
......
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