Commit d61ad667 authored by AU-Pro-mac's avatar AU-Pro-mac

add new code --13

parent 7f1ef489
{ {
"code": "000000", "code": "000000",
"data": { "data": {
"name": "一碗热翔", "name": "一碗",
"image": "//yun.duiba.com.cn/spark/assets/赚门票.21d8c2fd01dffd454116bb6c1189ba6bb74306f4.png", "image": "//yun.duiba.com.cn/spark/assets/赚门票.21d8c2fd01dffd454116bb6c1189ba6bb74306f4.png",
"type": 1 "type": 1
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"win": true, "win": true,
"userName": "xxxxxxxxxxx", "userName": "xxxxxxxxxxx",
"userImgUrl": "https://yun.duiba.com.cn/spark-dev/assets/白色.41dae4fd01f4750aea58f694b40d97a9da8f23ca.png", "userImgUrl": "https://yun.duiba.com.cn/spark-dev/assets/白色.41dae4fd01f4750aea58f694b40d97a9da8f23ca.png",
"isNewUser": true "isNewUser": false
}, },
"success": true, "success": true,
"message": "成功" "message": "成功"
......
...@@ -1874,8 +1874,10 @@ var Main = (function () { ...@@ -1874,8 +1874,10 @@ var Main = (function () {
FYGE.GlobalLoader.loadImage(function (s, image) { FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) { if (s) {
console.log('ssss', image); console.log('ssss', image);
setTimeout(function () {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture); FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete'); resolve('complete');
}, 60);
} }
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url); }, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url);
}); });
...@@ -1926,7 +1928,7 @@ var Main = (function () { ...@@ -1926,7 +1928,7 @@ var Main = (function () {
return [4, this.loadImageTexturesCsd02(resCanvasList)]; return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2: case 2:
_a.sent(); _a.sent();
ctrls_1.changeScene(MainScene_2.OpenAni); ctrls_1.changeScene(MainScene_1.CsdScene);
return [2]; return [2];
} }
}); });
...@@ -2700,7 +2702,7 @@ var Catecher = (function (_super) { ...@@ -2700,7 +2702,7 @@ var Catecher = (function (_super) {
} }
Catecher.prototype.create = function () { Catecher.prototype.create = function () {
this.x = 0; this.x = 0;
this.y = 90 + 1624 / 2 - this._root.stageHeight / 2; this.y = 60 + 1624 / 2 - this._root.stageHeight / 2;
this.width = 750; this.width = 750;
this.height = 220; this.height = 220;
this.userBoard_left = Tools_1.Tools.getSprite(resCanvasList_1.default['9df91df7-fc44-4d31-9f52-88d1ff65c9ba'].url, -326, 16); this.userBoard_left = Tools_1.Tools.getSprite(resCanvasList_1.default['9df91df7-fc44-4d31-9f52-88d1ff65c9ba'].url, -326, 16);
...@@ -2842,11 +2844,11 @@ var Catecher = (function (_super) { ...@@ -2842,11 +2844,11 @@ var Catecher = (function (_super) {
}; };
if (type === 'left') { if (type === 'left') {
t.x = 170; t.x = 170;
t.y = 92; t.y = 82;
} }
else if (type === 'right') { else if (type === 'right') {
t.x = 30; t.x = 30;
t.y = 92; t.y = 82;
} }
t.addChild(text); t.addChild(text);
return t; return t;
...@@ -2920,7 +2922,6 @@ var GoodsContainer = (function (_super) { ...@@ -2920,7 +2922,6 @@ var GoodsContainer = (function (_super) {
function GoodsContainer(root) { function GoodsContainer(root) {
var _this = _super.call(this) || this; var _this = _super.call(this) || this;
_this.leftCsdArr = []; _this.leftCsdArr = [];
_this.createLeftCsdLineTimeOut = null;
_this.lineArr = []; _this.lineArr = [];
_this.createLineTimeOut = null; _this.createLineTimeOut = null;
_this.goodsArr = []; _this.goodsArr = [];
...@@ -2954,6 +2955,28 @@ var GoodsContainer = (function (_super) { ...@@ -2954,6 +2955,28 @@ var GoodsContainer = (function (_super) {
this.back.width = 438; this.back.width = 438;
this.back.height = 988; this.back.height = 988;
this.addChild(this.back); this.addChild(this.back);
this.leftCsdContainer = new FYGE.Container();
this.leftCsdContainer.x = 0;
this.leftCsdContainer.y = 524;
this.leftCsdContainer.width = 370;
this.leftCsdContainer.height = 230;
var leftCsdbg = Tools_1.Tools.getSprite(resCanvasList_1.default['2137d3de-174f-42b1-8ebc-c5eb667ed250'].url, 0, 0);
leftCsdbg.x = leftCsdbg.y = 0;
this.leftCsdContainer.addChild(leftCsdbg);
var maskRectCsd = Tools_1.Tools.getRect(370, 230, 0x000000, 1, 1, 0, 0);
this.leftCsdContainer.addChild(maskRectCsd);
this.leftCsdContainer.mask = maskRectCsd;
var cir_1 = Tools_1.Tools.getSprite(resCanvasList_1.default['f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'].url, -15, 176);
var cir_2 = Tools_1.Tools.getSprite(resCanvasList_1.default['f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'].url, 88, 176);
cir_1.width = cir_1.height = cir_2.width = cir_2.height = 40;
cir_1.anchorX = cir_1.anchorY = cir_2.anchorX = cir_2.anchorY = 20;
FYGE.Tween.get(cir_1, { loop: true }, null)
.to({ rotation: -360 }, 500);
FYGE.Tween.get(cir_2, { loop: true }, null)
.to({ rotation: -360 }, 500);
this.leftCsdContainer.addChild(cir_1);
this.leftCsdContainer.addChild(cir_2);
this.addChildAt(this.leftCsdContainer, -1);
this.lineContainer = new FYGE.Container(); this.lineContainer = new FYGE.Container();
this.lineContainer.width = 750; this.lineContainer.width = 750;
this.lineContainer.height = 988; this.lineContainer.height = 988;
...@@ -2966,7 +2989,7 @@ var GoodsContainer = (function (_super) { ...@@ -2966,7 +2989,7 @@ var GoodsContainer = (function (_super) {
maskRect.lineTo(168, 987); maskRect.lineTo(168, 987);
maskRect.lineTo(314, 2); maskRect.lineTo(314, 2);
maskRect.endFill(); maskRect.endFill();
maskRect.alpha = 0.4; maskRect.alpha = 0.3;
this.lineContainer.addChild(maskRect); this.lineContainer.addChild(maskRect);
this.lineContainer.mask = maskRect; this.lineContainer.mask = maskRect;
this.addChild(this.lineContainer); this.addChild(this.lineContainer);
...@@ -3015,7 +3038,7 @@ var GoodsContainer = (function (_super) { ...@@ -3015,7 +3038,7 @@ var GoodsContainer = (function (_super) {
sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE; sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
this.addChild(sc); this.addChild(sc);
FYGE.Tween.get(sc, null, null) FYGE.Tween.get(sc, null, null)
.to({ alpha: .62, y: 200 }, 400) .to({ alpha: .7, y: 240 }, 330)
.to({ alpha: 0 }, 200) .to({ alpha: 0 }, 200)
.call(function () { .call(function () {
_this.removeChild(sc); _this.removeChild(sc);
...@@ -3072,7 +3095,7 @@ var GoodsContainer = (function (_super) { ...@@ -3072,7 +3095,7 @@ var GoodsContainer = (function (_super) {
alpha: .75 alpha: .75
}, 200) }, 200)
.call(function () { .call(function () {
g['lottiePlay'](); _this.lottiePlay(direction, g);
}) })
.to({ .to({
alpha: 0 alpha: 0
...@@ -3093,7 +3116,7 @@ var GoodsContainer = (function (_super) { ...@@ -3093,7 +3116,7 @@ var GoodsContainer = (function (_super) {
alpha: .75 alpha: .75
}, 200) }, 200)
.call(function () { .call(function () {
g['lottiePlay'](); _this.lottiePlay(direction, g);
}) })
.to({ .to({
alpha: 0 alpha: 0
...@@ -3106,23 +3129,6 @@ var GoodsContainer = (function (_super) { ...@@ -3106,23 +3129,6 @@ var GoodsContainer = (function (_super) {
}); });
} }
}; };
g['lottiePlay'] = function () {
var gl;
if (g['lot'] === 'light') {
gl = new FYGE.Lottie(light_1.light);
gl.x = -144;
gl.y = -150;
gl.scaleX = gl.scaleY = 0.88;
}
else if (g['lot'] === 'smoke') {
gl = new FYGE.Lottie(smoke_1.smoke);
gl.x = -115;
gl.y = -145;
gl.width = gl.height = 460;
}
gt.addChildAt(gl, 1);
gl.play(1);
};
g['fadeOut'] = function (index) { g['fadeOut'] = function (index) {
FYGE.Tween.removeTweens(g); FYGE.Tween.removeTweens(g);
FYGE.Tween.get(g, null, null) FYGE.Tween.get(g, null, null)
...@@ -3134,6 +3140,38 @@ var GoodsContainer = (function (_super) { ...@@ -3134,6 +3140,38 @@ var GoodsContainer = (function (_super) {
}; };
return g; return g;
}; };
GoodsContainer.prototype.lottiePlay = function (dir, g) {
var _this = this;
var gl;
if (g['lot'] === 'light') {
if (dir === 'left') {
gl = new FYGE.Lottie(light_1.light);
gl.x = -146;
gl.y = 255;
}
else if (dir === 'right') {
gl = new FYGE.Lottie(light_1.light);
gl.x = 420;
gl.y = 255;
}
}
else if (g['lot'] === 'smoke') {
if (dir === 'left') {
gl = new FYGE.Lottie(smoke_1.smoke);
gl.x = -117;
gl.y = 255;
}
else if (dir === 'right') {
gl = new FYGE.Lottie(smoke_1.smoke);
gl.x = 420;
gl.y = 255;
}
}
this.addChildAt(gl, 1);
gl.play(1, function () {
_this.removeChild(gl);
});
};
GoodsContainer.prototype.fallGood = function (good, index) { GoodsContainer.prototype.fallGood = function (good, index) {
good.speed += this.acceleratedSpeed + 0.0006; good.speed += this.acceleratedSpeed + 0.0006;
if (good.y > 1300) { if (good.y > 1300) {
...@@ -3175,64 +3213,64 @@ var GoodsContainer = (function (_super) { ...@@ -3175,64 +3213,64 @@ var GoodsContainer = (function (_super) {
line['speed'] = this.speed; line['speed'] = this.speed;
return line; return line;
}; };
GoodsContainer.prototype.createCsdLine = function () {
var lineCsd = Tools_1.Tools.getSprite(resCanvasList_1.default['b36dec27-734f-4458-8719-afda29c8c296'].url);
lineCsd.width = 47;
lineCsd.height = 155;
lineCsd.x = 400;
lineCsd.y = 0;
return lineCsd;
};
GoodsContainer.prototype.removeCsdLine = function () {
var lineCsd = this.leftCsdArr.pop();
this.lineContainer.removeChild(lineCsd);
};
GoodsContainer.prototype.fallCsdLine = function (lineCsd, index) {
if (lineCsd.x <= -100) {
this.removeCsdLine();
}
else {
lineCsd.x -= 3;
}
};
GoodsContainer.prototype.startLine = function () { GoodsContainer.prototype.startLine = function () {
var _a; var _a, _b;
var _this = this; var _this = this;
for (var i = 1; i <= 10; i++) { for (var i = 1; i <= 10; i++) {
var line = this.createLine(); var line = this.createLine();
this.lineArr.push(line); this.lineArr.push(line);
} }
this.lineArr.forEach(function (line, index) { this.lineArr.forEach(function (line, index) {
line.y += index * 100; line.y += index * 200;
line.alpha += index * 0.01; line.alpha += index * 0.01;
line.speed += index * 10 * _this.acceleratedSpeed; line.speed += index * 10 * _this.acceleratedSpeed;
line.origin = true; line.origin = true;
}); });
(_a = this.lineContainer).addChildren.apply(_a, this.lineArr); (_a = this.lineContainer).addChildren.apply(_a, this.lineArr);
for (var i = 1; i <= 6; i++) {
var lineCsd_ = this.createCsdLine();
this.leftCsdArr.push(lineCsd_);
}
this.leftCsdArr.forEach(function (lineCsd_, index) {
lineCsd_.x -= index * 200;
});
(_b = this.leftCsdContainer).addChildren.apply(_b, this.leftCsdArr);
setTimeout(function () { setTimeout(function () {
_this.addEventListener(FYGE.Event.ENTER_FRAME, _this.onEnterFrame, _this); _this.addEventListener(FYGE.Event.ENTER_FRAME, _this.onEnterFrame, _this);
_this.createLineTimeOut = setInterval(function () { _this.createLineTimeOut = setInterval(function () {
var l2 = _this.createLine(); var l2 = _this.createLine();
_this.lineArr.unshift(l2); _this.lineArr.unshift(l2);
_this.lineContainer.addChild(l2); _this.lineContainer.addChild(l2);
}, 800);
}, 1000);
};
GoodsContainer.prototype.createCsdLine = function () {
var line = Tools_1.Tools.getSprite(resCanvasList_1.default['ad20a814-c0d4-4010-a76d-8e9114778580'].url);
line.width = 47;
line.height = 155;
line.x = 375;
line.y = 0;
return line;
};
GoodsContainer.prototype.startLineCsd = function () {
var _a;
var _this = this;
for (var i = 1; i <= 6; i++) {
var line = this.createCsdLine();
this.leftCsdArr.push(line);
}
this.leftCsdArr.forEach(function (line, index) {
line.x += index * 50;
});
(_a = this.leftCsd).addChildren.apply(_a, this.leftCsdArr);
setTimeout(function () {
_this.createLeftCsdLineTimeOut = setInterval(function () {
var csd = _this.createCsdLine(); var csd = _this.createCsdLine();
_this.lineArr.unshift(csd); _this.leftCsdArr.unshift(csd);
_this.leftCsd.addChild(csd); _this.leftCsdContainer.addChild(csd);
}, 1600); }, 800);
}, 1000); }, 1000);
}; };
GoodsContainer.prototype.removeLine = function (index) { GoodsContainer.prototype.removeLine = function (index) {
var l = this.lineArr.pop(); var l = this.lineArr.pop();
this.lineContainer.removeChild(l); this.lineContainer.removeChild(l);
}; };
GoodsContainer.prototype.removeCsdLine = function () {
var l = this.lineArr.pop();
this.lineContainer.removeChild(l);
};
GoodsContainer.prototype.fallLine = function (line, index) { GoodsContainer.prototype.fallLine = function (line, index) {
line.speed += this.acceleratedSpeed + 0.0024; line.speed += this.acceleratedSpeed + 0.0024;
if (line.y > 1000) { if (line.y > 1000) {
...@@ -3244,14 +3282,6 @@ var GoodsContainer = (function (_super) { ...@@ -3244,14 +3282,6 @@ var GoodsContainer = (function (_super) {
line.y += y1; line.y += y1;
} }
}; };
GoodsContainer.prototype.fallCsdLine = function (line, index) {
if (line.x <= -300) {
this.removeCsdLine();
}
else {
line.x1 -= 0.04;
}
};
GoodsContainer.prototype.onEnterFrame = function () { GoodsContainer.prototype.onEnterFrame = function () {
var _this = this; var _this = this;
if (this._root.gameStartFlag) if (this._root.gameStartFlag)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1876,8 +1876,10 @@ var Main = (function () { ...@@ -1876,8 +1876,10 @@ var Main = (function () {
FYGE.GlobalLoader.loadImage(function (s, image) { FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) { if (s) {
console.log('ssss', image); console.log('ssss', image);
setTimeout(function () {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture); FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete'); resolve('complete');
}, 60);
} }
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url); }, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url);
}); });
...@@ -1928,7 +1930,7 @@ var Main = (function () { ...@@ -1928,7 +1930,7 @@ var Main = (function () {
return [4, this.loadImageTexturesCsd02(resCanvasList)]; return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2: case 2:
_a.sent(); _a.sent();
ctrls_1.changeScene(MainScene_2.OpenAni); ctrls_1.changeScene(MainScene_1.CsdScene);
return [2]; return [2];
} }
}); });
...@@ -2702,7 +2704,7 @@ var Catecher = (function (_super) { ...@@ -2702,7 +2704,7 @@ var Catecher = (function (_super) {
} }
Catecher.prototype.create = function () { Catecher.prototype.create = function () {
this.x = 0; this.x = 0;
this.y = 90 + 1624 / 2 - this._root.stageHeight / 2; this.y = 60 + 1624 / 2 - this._root.stageHeight / 2;
this.width = 750; this.width = 750;
this.height = 220; this.height = 220;
this.userBoard_left = Tools_1.Tools.getSprite(resCanvasList_1.default['9df91df7-fc44-4d31-9f52-88d1ff65c9ba'].url, -326, 16); this.userBoard_left = Tools_1.Tools.getSprite(resCanvasList_1.default['9df91df7-fc44-4d31-9f52-88d1ff65c9ba'].url, -326, 16);
...@@ -2844,11 +2846,11 @@ var Catecher = (function (_super) { ...@@ -2844,11 +2846,11 @@ var Catecher = (function (_super) {
}; };
if (type === 'left') { if (type === 'left') {
t.x = 170; t.x = 170;
t.y = 92; t.y = 82;
} }
else if (type === 'right') { else if (type === 'right') {
t.x = 30; t.x = 30;
t.y = 92; t.y = 82;
} }
t.addChild(text); t.addChild(text);
return t; return t;
...@@ -2922,7 +2924,6 @@ var GoodsContainer = (function (_super) { ...@@ -2922,7 +2924,6 @@ var GoodsContainer = (function (_super) {
function GoodsContainer(root) { function GoodsContainer(root) {
var _this = _super.call(this) || this; var _this = _super.call(this) || this;
_this.leftCsdArr = []; _this.leftCsdArr = [];
_this.createLeftCsdLineTimeOut = null;
_this.lineArr = []; _this.lineArr = [];
_this.createLineTimeOut = null; _this.createLineTimeOut = null;
_this.goodsArr = []; _this.goodsArr = [];
...@@ -2956,6 +2957,28 @@ var GoodsContainer = (function (_super) { ...@@ -2956,6 +2957,28 @@ var GoodsContainer = (function (_super) {
this.back.width = 438; this.back.width = 438;
this.back.height = 988; this.back.height = 988;
this.addChild(this.back); this.addChild(this.back);
this.leftCsdContainer = new FYGE.Container();
this.leftCsdContainer.x = 0;
this.leftCsdContainer.y = 524;
this.leftCsdContainer.width = 370;
this.leftCsdContainer.height = 230;
var leftCsdbg = Tools_1.Tools.getSprite(resCanvasList_1.default['2137d3de-174f-42b1-8ebc-c5eb667ed250'].url, 0, 0);
leftCsdbg.x = leftCsdbg.y = 0;
this.leftCsdContainer.addChild(leftCsdbg);
var maskRectCsd = Tools_1.Tools.getRect(370, 230, 0x000000, 1, 1, 0, 0);
this.leftCsdContainer.addChild(maskRectCsd);
this.leftCsdContainer.mask = maskRectCsd;
var cir_1 = Tools_1.Tools.getSprite(resCanvasList_1.default['f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'].url, -15, 176);
var cir_2 = Tools_1.Tools.getSprite(resCanvasList_1.default['f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'].url, 88, 176);
cir_1.width = cir_1.height = cir_2.width = cir_2.height = 40;
cir_1.anchorX = cir_1.anchorY = cir_2.anchorX = cir_2.anchorY = 20;
FYGE.Tween.get(cir_1, { loop: true }, null)
.to({ rotation: -360 }, 500);
FYGE.Tween.get(cir_2, { loop: true }, null)
.to({ rotation: -360 }, 500);
this.leftCsdContainer.addChild(cir_1);
this.leftCsdContainer.addChild(cir_2);
this.addChildAt(this.leftCsdContainer, -1);
this.lineContainer = new FYGE.Container(); this.lineContainer = new FYGE.Container();
this.lineContainer.width = 750; this.lineContainer.width = 750;
this.lineContainer.height = 988; this.lineContainer.height = 988;
...@@ -2968,7 +2991,7 @@ var GoodsContainer = (function (_super) { ...@@ -2968,7 +2991,7 @@ var GoodsContainer = (function (_super) {
maskRect.lineTo(168, 987); maskRect.lineTo(168, 987);
maskRect.lineTo(314, 2); maskRect.lineTo(314, 2);
maskRect.endFill(); maskRect.endFill();
maskRect.alpha = 0.4; maskRect.alpha = 0.3;
this.lineContainer.addChild(maskRect); this.lineContainer.addChild(maskRect);
this.lineContainer.mask = maskRect; this.lineContainer.mask = maskRect;
this.addChild(this.lineContainer); this.addChild(this.lineContainer);
...@@ -3017,7 +3040,7 @@ var GoodsContainer = (function (_super) { ...@@ -3017,7 +3040,7 @@ var GoodsContainer = (function (_super) {
sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE; sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
this.addChild(sc); this.addChild(sc);
FYGE.Tween.get(sc, null, null) FYGE.Tween.get(sc, null, null)
.to({ alpha: .62, y: 200 }, 400) .to({ alpha: .7, y: 240 }, 330)
.to({ alpha: 0 }, 200) .to({ alpha: 0 }, 200)
.call(function () { .call(function () {
_this.removeChild(sc); _this.removeChild(sc);
...@@ -3074,7 +3097,7 @@ var GoodsContainer = (function (_super) { ...@@ -3074,7 +3097,7 @@ var GoodsContainer = (function (_super) {
alpha: .75 alpha: .75
}, 200) }, 200)
.call(function () { .call(function () {
g['lottiePlay'](); _this.lottiePlay(direction, g);
}) })
.to({ .to({
alpha: 0 alpha: 0
...@@ -3095,7 +3118,7 @@ var GoodsContainer = (function (_super) { ...@@ -3095,7 +3118,7 @@ var GoodsContainer = (function (_super) {
alpha: .75 alpha: .75
}, 200) }, 200)
.call(function () { .call(function () {
g['lottiePlay'](); _this.lottiePlay(direction, g);
}) })
.to({ .to({
alpha: 0 alpha: 0
...@@ -3108,23 +3131,6 @@ var GoodsContainer = (function (_super) { ...@@ -3108,23 +3131,6 @@ var GoodsContainer = (function (_super) {
}); });
} }
}; };
g['lottiePlay'] = function () {
var gl;
if (g['lot'] === 'light') {
gl = new FYGE.Lottie(light_1.light);
gl.x = -144;
gl.y = -150;
gl.scaleX = gl.scaleY = 0.88;
}
else if (g['lot'] === 'smoke') {
gl = new FYGE.Lottie(smoke_1.smoke);
gl.x = -115;
gl.y = -145;
gl.width = gl.height = 460;
}
gt.addChildAt(gl, 1);
gl.play(1);
};
g['fadeOut'] = function (index) { g['fadeOut'] = function (index) {
FYGE.Tween.removeTweens(g); FYGE.Tween.removeTweens(g);
FYGE.Tween.get(g, null, null) FYGE.Tween.get(g, null, null)
...@@ -3136,6 +3142,38 @@ var GoodsContainer = (function (_super) { ...@@ -3136,6 +3142,38 @@ var GoodsContainer = (function (_super) {
}; };
return g; return g;
}; };
GoodsContainer.prototype.lottiePlay = function (dir, g) {
var _this = this;
var gl;
if (g['lot'] === 'light') {
if (dir === 'left') {
gl = new FYGE.Lottie(light_1.light);
gl.x = -146;
gl.y = 255;
}
else if (dir === 'right') {
gl = new FYGE.Lottie(light_1.light);
gl.x = 420;
gl.y = 255;
}
}
else if (g['lot'] === 'smoke') {
if (dir === 'left') {
gl = new FYGE.Lottie(smoke_1.smoke);
gl.x = -117;
gl.y = 255;
}
else if (dir === 'right') {
gl = new FYGE.Lottie(smoke_1.smoke);
gl.x = 420;
gl.y = 255;
}
}
this.addChildAt(gl, 1);
gl.play(1, function () {
_this.removeChild(gl);
});
};
GoodsContainer.prototype.fallGood = function (good, index) { GoodsContainer.prototype.fallGood = function (good, index) {
good.speed += this.acceleratedSpeed + 0.0006; good.speed += this.acceleratedSpeed + 0.0006;
if (good.y > 1300) { if (good.y > 1300) {
...@@ -3177,64 +3215,64 @@ var GoodsContainer = (function (_super) { ...@@ -3177,64 +3215,64 @@ var GoodsContainer = (function (_super) {
line['speed'] = this.speed; line['speed'] = this.speed;
return line; return line;
}; };
GoodsContainer.prototype.createCsdLine = function () {
var lineCsd = Tools_1.Tools.getSprite(resCanvasList_1.default['b36dec27-734f-4458-8719-afda29c8c296'].url);
lineCsd.width = 47;
lineCsd.height = 155;
lineCsd.x = 400;
lineCsd.y = 0;
return lineCsd;
};
GoodsContainer.prototype.removeCsdLine = function () {
var lineCsd = this.leftCsdArr.pop();
this.lineContainer.removeChild(lineCsd);
};
GoodsContainer.prototype.fallCsdLine = function (lineCsd, index) {
if (lineCsd.x <= -100) {
this.removeCsdLine();
}
else {
lineCsd.x -= 3;
}
};
GoodsContainer.prototype.startLine = function () { GoodsContainer.prototype.startLine = function () {
var _a; var _a, _b;
var _this = this; var _this = this;
for (var i = 1; i <= 10; i++) { for (var i = 1; i <= 10; i++) {
var line = this.createLine(); var line = this.createLine();
this.lineArr.push(line); this.lineArr.push(line);
} }
this.lineArr.forEach(function (line, index) { this.lineArr.forEach(function (line, index) {
line.y += index * 100; line.y += index * 200;
line.alpha += index * 0.01; line.alpha += index * 0.01;
line.speed += index * 10 * _this.acceleratedSpeed; line.speed += index * 10 * _this.acceleratedSpeed;
line.origin = true; line.origin = true;
}); });
(_a = this.lineContainer).addChildren.apply(_a, this.lineArr); (_a = this.lineContainer).addChildren.apply(_a, this.lineArr);
for (var i = 1; i <= 6; i++) {
var lineCsd_ = this.createCsdLine();
this.leftCsdArr.push(lineCsd_);
}
this.leftCsdArr.forEach(function (lineCsd_, index) {
lineCsd_.x -= index * 200;
});
(_b = this.leftCsdContainer).addChildren.apply(_b, this.leftCsdArr);
setTimeout(function () { setTimeout(function () {
_this.addEventListener(FYGE.Event.ENTER_FRAME, _this.onEnterFrame, _this); _this.addEventListener(FYGE.Event.ENTER_FRAME, _this.onEnterFrame, _this);
_this.createLineTimeOut = setInterval(function () { _this.createLineTimeOut = setInterval(function () {
var l2 = _this.createLine(); var l2 = _this.createLine();
_this.lineArr.unshift(l2); _this.lineArr.unshift(l2);
_this.lineContainer.addChild(l2); _this.lineContainer.addChild(l2);
}, 800);
}, 1000);
};
GoodsContainer.prototype.createCsdLine = function () {
var line = Tools_1.Tools.getSprite(resCanvasList_1.default['ad20a814-c0d4-4010-a76d-8e9114778580'].url);
line.width = 47;
line.height = 155;
line.x = 375;
line.y = 0;
return line;
};
GoodsContainer.prototype.startLineCsd = function () {
var _a;
var _this = this;
for (var i = 1; i <= 6; i++) {
var line = this.createCsdLine();
this.leftCsdArr.push(line);
}
this.leftCsdArr.forEach(function (line, index) {
line.x += index * 50;
});
(_a = this.leftCsd).addChildren.apply(_a, this.leftCsdArr);
setTimeout(function () {
_this.createLeftCsdLineTimeOut = setInterval(function () {
var csd = _this.createCsdLine(); var csd = _this.createCsdLine();
_this.lineArr.unshift(csd); _this.leftCsdArr.unshift(csd);
_this.leftCsd.addChild(csd); _this.leftCsdContainer.addChild(csd);
}, 1600); }, 800);
}, 1000); }, 1000);
}; };
GoodsContainer.prototype.removeLine = function (index) { GoodsContainer.prototype.removeLine = function (index) {
var l = this.lineArr.pop(); var l = this.lineArr.pop();
this.lineContainer.removeChild(l); this.lineContainer.removeChild(l);
}; };
GoodsContainer.prototype.removeCsdLine = function () {
var l = this.lineArr.pop();
this.lineContainer.removeChild(l);
};
GoodsContainer.prototype.fallLine = function (line, index) { GoodsContainer.prototype.fallLine = function (line, index) {
line.speed += this.acceleratedSpeed + 0.0024; line.speed += this.acceleratedSpeed + 0.0024;
if (line.y > 1000) { if (line.y > 1000) {
...@@ -3246,14 +3284,6 @@ var GoodsContainer = (function (_super) { ...@@ -3246,14 +3284,6 @@ var GoodsContainer = (function (_super) {
line.y += y1; line.y += y1;
} }
}; };
GoodsContainer.prototype.fallCsdLine = function (line, index) {
if (line.x <= -300) {
this.removeCsdLine();
}
else {
line.x1 -= 0.04;
}
};
GoodsContainer.prototype.onEnterFrame = function () { GoodsContainer.prototype.onEnterFrame = function () {
var _this = this; var _this = this;
if (this._root.gameStartFlag) if (this._root.gameStartFlag)
......
...@@ -160,8 +160,8 @@ export class Main { ...@@ -160,8 +160,8 @@ export class Main {
await this.loadImageTexturesCsd01(resCanvasList) await this.loadImageTexturesCsd01(resCanvasList)
await this.loadImageTexturesCsd02(resCanvasList) await this.loadImageTexturesCsd02(resCanvasList)
changeScene(OpenAni) // changeScene(OpenAni)
// changeScene(CsdScene) changeScene(CsdScene)
// changeScene(XxlScene) // changeScene(XxlScene)
}) })
......
...@@ -40,7 +40,7 @@ export default class Catecher extends FYGE.Container { ...@@ -40,7 +40,7 @@ export default class Catecher extends FYGE.Container {
create () { create () {
this.x = 0 this.x = 0
this.y = 90 + 1624 / 2 - this._root.stageHeight / 2 this.y = 60 + 1624 / 2 - this._root.stageHeight / 2
this.width = 750 this.width = 750
this.height = 220 this.height = 220
...@@ -219,10 +219,10 @@ export default class Catecher extends FYGE.Container { ...@@ -219,10 +219,10 @@ export default class Catecher extends FYGE.Container {
} }
if (type === 'left') { if (type === 'left') {
t.x = 170 t.x = 170
t.y = 92 t.y = 82
} else if (type === 'right') { } else if (type === 'right') {
t.x = 30 t.x = 30
t.y = 92 t.y = 82
} }
t.addChild(text) t.addChild(text)
return t return t
......
...@@ -7,14 +7,10 @@ import { smoke } from '../lottie/smoke/smoke' ...@@ -7,14 +7,10 @@ import { smoke } from '../lottie/smoke/smoke'
export default class GoodsContainer extends FYGE.Container { export default class GoodsContainer extends FYGE.Container {
_root; _root;
// 左边的传送带
leftCsd;
// 传送带棍子 的 容器 // 传送带棍子 的 容器
leftCsdContainer; leftCsdContainer;
// 传送带棍子 的 数组 // 传送带棍子 的 数组
leftCsdArr = []; leftCsdArr = [];
// 生产棍子 的 interval函数
createLeftCsdLineTimeOut = null;
// 传送带背景 // 传送带背景
back; back;
// 传送带棍子 的 容器 // 传送带棍子 的 容器
...@@ -66,19 +62,35 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -66,19 +62,35 @@ export default class GoodsContainer extends FYGE.Container {
this.back = Tools.getSprite(resCanvasList['b292e9c5-4565-4ecb-bf0b-1a9d7268b7c0'].url, 156, 0) this.back = Tools.getSprite(resCanvasList['b292e9c5-4565-4ecb-bf0b-1a9d7268b7c0'].url, 156, 0)
this.back.width = 438 this.back.width = 438
this.back.height = 988 this.back.height = 988
// test - code
// this.back.alpha = 0.2
this.addChild(this.back) this.addChild(this.back)
// this.leftCsd = new FYGE.Container() // 创建左边传送带 - 底层
// this.leftCsd.x = 0 this.leftCsdContainer = new FYGE.Container()
// this.leftCsd.y = 524 this.leftCsdContainer.x = 0
// this.leftCsd.width = 370 this.leftCsdContainer.y = 524
// this.leftCsd.height = 230 this.leftCsdContainer.width = 370
// let leftCsdbg = Tools.getSprite(resCanvasList['2137d3de-174f-42b1-8ebc-c5eb667ed250'].url, 0, 0) this.leftCsdContainer.height = 230
// leftCsdbg.x = leftCsdbg.y = 0 let leftCsdbg = Tools.getSprite(resCanvasList['2137d3de-174f-42b1-8ebc-c5eb667ed250'].url, 0, 0)
// this.leftCsd.addChild(leftCsdbg) leftCsdbg.x = leftCsdbg.y = 0
// this.addChildAt(this.leftCsd, -1) this.leftCsdContainer.addChild(leftCsdbg)
// this.startLineCsd() let maskRectCsd = Tools.getRect(370, 230, 0x000000, 1, 1 ,0 ,0)
this.leftCsdContainer.addChild(maskRectCsd)
this.leftCsdContainer.mask = maskRectCsd
let cir_1 = Tools.getSprite(resCanvasList['f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'].url, -15, 176)
let cir_2 = Tools.getSprite(resCanvasList['f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'].url, 88, 176)
cir_1.width = cir_1.height = cir_2.width = cir_2.height = 40
cir_1.anchorX = cir_1.anchorY = cir_2.anchorX = cir_2.anchorY = 20
FYGE.Tween.get(cir_1, {loop: true}, null)
.to({rotation: -360}, 500)
FYGE.Tween.get(cir_2, {loop: true}, null)
.to({rotation: -360}, 500)
this.leftCsdContainer.addChild(cir_1)
this.leftCsdContainer.addChild(cir_2)
this.addChildAt(this.leftCsdContainer, -1)
// 创建主传送带
this.lineContainer = new FYGE.Container() this.lineContainer = new FYGE.Container()
this.lineContainer.width = 750 this.lineContainer.width = 750
this.lineContainer.height = 988 this.lineContainer.height = 988
...@@ -92,7 +104,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -92,7 +104,7 @@ export default class GoodsContainer extends FYGE.Container {
maskRect.lineTo(168, 987) maskRect.lineTo(168, 987)
maskRect.lineTo(314, 2) maskRect.lineTo(314, 2)
maskRect.endFill() maskRect.endFill()
maskRect.alpha = 0.4 maskRect.alpha = 0.3
this.lineContainer.addChild(maskRect) this.lineContainer.addChild(maskRect)
this.lineContainer.mask = maskRect this.lineContainer.mask = maskRect
this.addChild(this.lineContainer) this.addChild(this.lineContainer)
...@@ -104,6 +116,8 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -104,6 +116,8 @@ export default class GoodsContainer extends FYGE.Container {
let maskGoodRect = Tools.getRect(750, 988) let maskGoodRect = Tools.getRect(750, 988)
this.goodsContainer.addChild(maskGoodRect) this.goodsContainer.addChild(maskGoodRect)
this.goodsContainer.mask = maskGoodRect this.goodsContainer.mask = maskGoodRect
// test - code
// this.goodsContainer.alpha = 0.2
this.addChild(this.goodsContainer) this.addChild(this.goodsContainer)
} }
...@@ -130,6 +144,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -130,6 +144,7 @@ export default class GoodsContainer extends FYGE.Container {
} }
} }
// 分数 漂浮
floatScore(dir, s) { floatScore(dir, s) {
s = s > 0 ? '+' + s : s s = s > 0 ? '+' + s : s
let sc = Tools.getText(s, 80, '#904f5e', FYGE.TEXT_ALIGN.CENTER) let sc = Tools.getText(s, 80, '#904f5e', FYGE.TEXT_ALIGN.CENTER)
...@@ -142,7 +157,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -142,7 +157,7 @@ export default class GoodsContainer extends FYGE.Container {
sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE
this.addChild(sc) this.addChild(sc)
FYGE.Tween.get(sc, null, null) FYGE.Tween.get(sc, null, null)
.to({alpha: .62, y: 200}, 400) .to({alpha: .7, y: 240}, 330)
.to({alpha: 0}, 200) .to({alpha: 0}, 200)
.call(() => { .call(() => {
this.removeChild(sc) this.removeChild(sc)
...@@ -157,8 +172,6 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -157,8 +172,6 @@ export default class GoodsContainer extends FYGE.Container {
this.onEnterFrame, this.onEnterFrame,
this this
) )
// clearInterval(this.createLeftCsdLineTimeOut)
// this.createLeftCsdLineTimeOut = null
clearInterval(this.createLineTimeOut) clearInterval(this.createLineTimeOut)
this.createLineTimeOut = null this.createLineTimeOut = null
clearInterval(this.createGoodTimeOut) clearInterval(this.createGoodTimeOut)
...@@ -178,8 +191,6 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -178,8 +191,6 @@ export default class GoodsContainer extends FYGE.Container {
createGoods () { createGoods () {
let arr = [...this.goodsTextures] let arr = [...this.goodsTextures]
// let arr = [...this.goodsTextures, ...this.goodsTextures]
// arr.pop()
let idx = this.sum(0, arr.length) let idx = this.sum(0, arr.length)
let g = new FYGE.Container() let g = new FYGE.Container()
g.width = arr[idx].width g.width = arr[idx].width
...@@ -215,7 +226,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -215,7 +226,7 @@ export default class GoodsContainer extends FYGE.Container {
alpha: .75 alpha: .75
}, 200) }, 200)
.call(() => { .call(() => {
g['lottiePlay']() this.lottiePlay(direction, g)
}) })
.to({ .to({
alpha: 0 alpha: 0
...@@ -237,7 +248,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -237,7 +248,7 @@ export default class GoodsContainer extends FYGE.Container {
alpha: .75 alpha: .75
}, 200) }, 200)
.call(() => { .call(() => {
g['lottiePlay']() this.lottiePlay(direction, g)
}) })
.to({ .to({
alpha: 0 alpha: 0
...@@ -250,23 +261,6 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -250,23 +261,6 @@ export default class GoodsContainer extends FYGE.Container {
}) })
} }
} }
g['lottiePlay'] = () => {
let gl
if (g['lot'] === 'light') {
gl = new FYGE.Lottie(light)
gl.x = -144
gl.y = -150
gl.scaleX = gl.scaleY = 0.88
}
else if (g['lot'] === 'smoke') {
gl = new FYGE.Lottie(smoke)
gl.x = -115
gl.y = -145
gl.width = gl.height = 460
}
gt.addChildAt(gl, 1)
gl.play(1)
}
g['fadeOut'] = (index) => { g['fadeOut'] = (index) => {
FYGE.Tween.removeTweens(g) FYGE.Tween.removeTweens(g)
FYGE.Tween.get(g, null, null) FYGE.Tween.get(g, null, null)
...@@ -281,6 +275,38 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -281,6 +275,38 @@ export default class GoodsContainer extends FYGE.Container {
return g return g
} }
// lottie 动效 播放
lottiePlay (dir, g) {
let gl
if (g['lot'] === 'light') {
if (dir === 'left') {
gl = new FYGE.Lottie(light)
gl.x = -146
gl.y = 255
} else if (dir === 'right') {
gl = new FYGE.Lottie(light)
gl.x = 420
gl.y = 255
}
}
else if (g['lot'] === 'smoke') {
if (dir === 'left') {
gl = new FYGE.Lottie(smoke)
gl.x = -117
gl.y = 255
} else if (dir === 'right') {
gl = new FYGE.Lottie(smoke)
gl.x = 420
gl.y = 255
}
}
this.addChildAt(gl, 1)
gl.play(1, () => {
this.removeChild(gl)
})
}
// 掉落物 掉落 // 掉落物 掉落
fallGood (good, index) { fallGood (good, index) {
good.speed += this.acceleratedSpeed + 0.0006 good.speed += this.acceleratedSpeed + 0.0006
...@@ -332,6 +358,31 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -332,6 +358,31 @@ export default class GoodsContainer extends FYGE.Container {
line['speed'] = this.speed line['speed'] = this.speed
return line return line
} }
// 左边 传送带子
createCsdLine () {
let lineCsd = Tools.getSprite(resCanvasList['b36dec27-734f-4458-8719-afda29c8c296'].url)
lineCsd.width = 47
lineCsd.height = 155
lineCsd.x = 400
lineCsd.y = 0
return lineCsd
}
// 移除左边的传送带棍子 并 添加
removeCsdLine () {
let lineCsd = this.leftCsdArr.pop()
// console.log(l)
this.lineContainer.removeChild(lineCsd)
}
// 左边 传送带掉落 右移动
fallCsdLine (lineCsd, index) {
if (lineCsd.x <= -100) {
this.removeCsdLine()
} else {
lineCsd.x -= 3
}
}
// 传送带开始 滚动 // 传送带开始 滚动
startLine () { startLine () {
...@@ -342,14 +393,24 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -342,14 +393,24 @@ export default class GoodsContainer extends FYGE.Container {
} }
this.lineArr.forEach((line, index) => { this.lineArr.forEach((line, index) => {
// line.y += index * (50 * (1 + index * 0.1)) // line.y += index * (50 * (1 + index * 0.1))
line.y += index * 100 line.y += index * 200
line.alpha += index * 0.01 line.alpha += index * 0.01
line.speed += index * 10 * this.acceleratedSpeed line.speed += index * 10 * this.acceleratedSpeed
line.origin = true line.origin = true
// console.log(line.y, index)
}) })
this.lineContainer.addChildren(...this.lineArr) this.lineContainer.addChildren(...this.lineArr)
// 左边 传送带开始滚动
// 游戏开始 之前 传送带上需要先存在6根棍子
for (let i = 1; i <= 6; i++) {
let lineCsd_ = this.createCsdLine()
this.leftCsdArr.push(lineCsd_)
}
this.leftCsdArr.forEach((lineCsd_, index) => {
lineCsd_.x -= index * 200
})
this.leftCsdContainer.addChildren(...this.leftCsdArr)
setTimeout(() => { setTimeout(() => {
this.addEventListener( this.addEventListener(
FYGE.Event.ENTER_FRAME, FYGE.Event.ENTER_FRAME,
...@@ -357,41 +418,15 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -357,41 +418,15 @@ export default class GoodsContainer extends FYGE.Container {
this this
) )
this.createLineTimeOut = setInterval(() => { this.createLineTimeOut = setInterval(() => {
// 主 传送带
let l2 = this.createLine() let l2 = this.createLine()
this.lineArr.unshift(l2) this.lineArr.unshift(l2)
this.lineContainer.addChild(l2) this.lineContainer.addChild(l2)
}, 800) // 左 传送带
}, 1000)
}
// 左边 传送带字
createCsdLine () {
let line = Tools.getSprite(resCanvasList['ad20a814-c0d4-4010-a76d-8e9114778580'].url)
line.width = 47
line.height = 155
line.x = 375
line.y = 0
return line
}
// 左边 传送带开始滚动
startLineCsd () {
// 游戏开始 之前 传送带上需要先存在6根棍子
for (let i = 1; i <= 6; i++) {
let line = this.createCsdLine()
this.leftCsdArr.push(line)
}
this.leftCsdArr.forEach((line, index) => {
line.x += index * 50
})
this.leftCsd.addChildren(...this.leftCsdArr)
setTimeout(() => {
this.createLeftCsdLineTimeOut = setInterval(() => {
let csd = this.createCsdLine() let csd = this.createCsdLine()
this.lineArr.unshift(csd) this.leftCsdArr.unshift(csd)
this.leftCsd.addChild(csd) this.leftCsdContainer.addChild(csd)
}, 1600) }, 800)
}, 1000) }, 1000)
} }
...@@ -402,13 +437,6 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -402,13 +437,6 @@ export default class GoodsContainer extends FYGE.Container {
this.lineContainer.removeChild(l) this.lineContainer.removeChild(l)
} }
// 移除左边的传送带棍子 并 添加
removeCsdLine () {
let l = this.lineArr.pop()
// console.log(l)
this.lineContainer.removeChild(l)
}
// 传送带掉落 // 传送带掉落
fallLine (line, index) { fallLine (line, index) {
line.speed += this.acceleratedSpeed + 0.0024 line.speed += this.acceleratedSpeed + 0.0024
...@@ -421,15 +449,6 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -421,15 +449,6 @@ export default class GoodsContainer extends FYGE.Container {
} }
} }
// 左边 传送带掉落 右移动
fallCsdLine (line, index) {
if (line.x <= -300) {
this.removeCsdLine()
} else {
line.x1 -= 0.04
}
}
onEnterFrame () { onEnterFrame () {
if (this._root.gameStartFlag) this.goodsArr.forEach((good, index) => { this.fallGood(good, index) }) if (this._root.gameStartFlag) this.goodsArr.forEach((good, index) => { this.fallGood(good, index) })
this.lineArr.forEach((line, index) => { this.fallLine(line, index) }) this.lineArr.forEach((line, index) => { this.fallLine(line, index) })
......
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