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

add new code --13

parent 7f1ef489
{
"code": "000000",
"data": {
"name": "一碗热翔",
"name": "一碗",
"image": "//yun.duiba.com.cn/spark/assets/赚门票.21d8c2fd01dffd454116bb6c1189ba6bb74306f4.png",
"type": 1
},
......
......@@ -6,7 +6,7 @@
"win": true,
"userName": "xxxxxxxxxxx",
"userImgUrl": "https://yun.duiba.com.cn/spark-dev/assets/白色.41dae4fd01f4750aea58f694b40d97a9da8f23ca.png",
"isNewUser": true
"isNewUser": false
},
"success": true,
"message": "成功"
......
......@@ -1874,8 +1874,10 @@ var Main = (function () {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
setTimeout(function () {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}, 60);
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url);
});
......@@ -1926,7 +1928,7 @@ var Main = (function () {
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
_a.sent();
ctrls_1.changeScene(MainScene_2.OpenAni);
ctrls_1.changeScene(MainScene_1.CsdScene);
return [2];
}
});
......@@ -2700,7 +2702,7 @@ var Catecher = (function (_super) {
}
Catecher.prototype.create = function () {
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.height = 220;
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) {
};
if (type === 'left') {
t.x = 170;
t.y = 92;
t.y = 82;
}
else if (type === 'right') {
t.x = 30;
t.y = 92;
t.y = 82;
}
t.addChild(text);
return t;
......@@ -2920,7 +2922,6 @@ var GoodsContainer = (function (_super) {
function GoodsContainer(root) {
var _this = _super.call(this) || this;
_this.leftCsdArr = [];
_this.createLeftCsdLineTimeOut = null;
_this.lineArr = [];
_this.createLineTimeOut = null;
_this.goodsArr = [];
......@@ -2954,6 +2955,28 @@ var GoodsContainer = (function (_super) {
this.back.width = 438;
this.back.height = 988;
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.width = 750;
this.lineContainer.height = 988;
......@@ -2966,7 +2989,7 @@ var GoodsContainer = (function (_super) {
maskRect.lineTo(168, 987);
maskRect.lineTo(314, 2);
maskRect.endFill();
maskRect.alpha = 0.4;
maskRect.alpha = 0.3;
this.lineContainer.addChild(maskRect);
this.lineContainer.mask = maskRect;
this.addChild(this.lineContainer);
......@@ -3015,7 +3038,7 @@ var GoodsContainer = (function (_super) {
sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
this.addChild(sc);
FYGE.Tween.get(sc, null, null)
.to({ alpha: .62, y: 200 }, 400)
.to({ alpha: .7, y: 240 }, 330)
.to({ alpha: 0 }, 200)
.call(function () {
_this.removeChild(sc);
......@@ -3072,7 +3095,7 @@ var GoodsContainer = (function (_super) {
alpha: .75
}, 200)
.call(function () {
g['lottiePlay']();
_this.lottiePlay(direction, g);
})
.to({
alpha: 0
......@@ -3093,7 +3116,7 @@ var GoodsContainer = (function (_super) {
alpha: .75
}, 200)
.call(function () {
g['lottiePlay']();
_this.lottiePlay(direction, g);
})
.to({
alpha: 0
......@@ -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) {
FYGE.Tween.removeTweens(g);
FYGE.Tween.get(g, null, null)
......@@ -3134,6 +3140,38 @@ var GoodsContainer = (function (_super) {
};
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) {
good.speed += this.acceleratedSpeed + 0.0006;
if (good.y > 1300) {
......@@ -3175,64 +3213,64 @@ var GoodsContainer = (function (_super) {
line['speed'] = this.speed;
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 () {
var _a;
var _a, _b;
var _this = this;
for (var i = 1; i <= 10; i++) {
var line = this.createLine();
this.lineArr.push(line);
}
this.lineArr.forEach(function (line, index) {
line.y += index * 100;
line.y += index * 200;
line.alpha += index * 0.01;
line.speed += index * 10 * _this.acceleratedSpeed;
line.origin = true;
});
(_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 () {
_this.addEventListener(FYGE.Event.ENTER_FRAME, _this.onEnterFrame, _this);
_this.createLineTimeOut = setInterval(function () {
var l2 = _this.createLine();
_this.lineArr.unshift(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();
_this.lineArr.unshift(csd);
_this.leftCsd.addChild(csd);
}, 1600);
_this.leftCsdArr.unshift(csd);
_this.leftCsdContainer.addChild(csd);
}, 800);
}, 1000);
};
GoodsContainer.prototype.removeLine = function (index) {
var l = this.lineArr.pop();
this.lineContainer.removeChild(l);
};
GoodsContainer.prototype.removeCsdLine = function () {
var l = this.lineArr.pop();
this.lineContainer.removeChild(l);
};
GoodsContainer.prototype.fallLine = function (line, index) {
line.speed += this.acceleratedSpeed + 0.0024;
if (line.y > 1000) {
......@@ -3244,14 +3282,6 @@ var GoodsContainer = (function (_super) {
line.y += y1;
}
};
GoodsContainer.prototype.fallCsdLine = function (line, index) {
if (line.x <= -300) {
this.removeCsdLine();
}
else {
line.x1 -= 0.04;
}
};
GoodsContainer.prototype.onEnterFrame = function () {
var _this = this;
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 () {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
setTimeout(function () {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}, 60);
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url);
});
......@@ -1928,7 +1930,7 @@ var Main = (function () {
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
_a.sent();
ctrls_1.changeScene(MainScene_2.OpenAni);
ctrls_1.changeScene(MainScene_1.CsdScene);
return [2];
}
});
......@@ -2702,7 +2704,7 @@ var Catecher = (function (_super) {
}
Catecher.prototype.create = function () {
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.height = 220;
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) {
};
if (type === 'left') {
t.x = 170;
t.y = 92;
t.y = 82;
}
else if (type === 'right') {
t.x = 30;
t.y = 92;
t.y = 82;
}
t.addChild(text);
return t;
......@@ -2922,7 +2924,6 @@ var GoodsContainer = (function (_super) {
function GoodsContainer(root) {
var _this = _super.call(this) || this;
_this.leftCsdArr = [];
_this.createLeftCsdLineTimeOut = null;
_this.lineArr = [];
_this.createLineTimeOut = null;
_this.goodsArr = [];
......@@ -2956,6 +2957,28 @@ var GoodsContainer = (function (_super) {
this.back.width = 438;
this.back.height = 988;
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.width = 750;
this.lineContainer.height = 988;
......@@ -2968,7 +2991,7 @@ var GoodsContainer = (function (_super) {
maskRect.lineTo(168, 987);
maskRect.lineTo(314, 2);
maskRect.endFill();
maskRect.alpha = 0.4;
maskRect.alpha = 0.3;
this.lineContainer.addChild(maskRect);
this.lineContainer.mask = maskRect;
this.addChild(this.lineContainer);
......@@ -3017,7 +3040,7 @@ var GoodsContainer = (function (_super) {
sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
this.addChild(sc);
FYGE.Tween.get(sc, null, null)
.to({ alpha: .62, y: 200 }, 400)
.to({ alpha: .7, y: 240 }, 330)
.to({ alpha: 0 }, 200)
.call(function () {
_this.removeChild(sc);
......@@ -3074,7 +3097,7 @@ var GoodsContainer = (function (_super) {
alpha: .75
}, 200)
.call(function () {
g['lottiePlay']();
_this.lottiePlay(direction, g);
})
.to({
alpha: 0
......@@ -3095,7 +3118,7 @@ var GoodsContainer = (function (_super) {
alpha: .75
}, 200)
.call(function () {
g['lottiePlay']();
_this.lottiePlay(direction, g);
})
.to({
alpha: 0
......@@ -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) {
FYGE.Tween.removeTweens(g);
FYGE.Tween.get(g, null, null)
......@@ -3136,6 +3142,38 @@ var GoodsContainer = (function (_super) {
};
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) {
good.speed += this.acceleratedSpeed + 0.0006;
if (good.y > 1300) {
......@@ -3177,64 +3215,64 @@ var GoodsContainer = (function (_super) {
line['speed'] = this.speed;
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 () {
var _a;
var _a, _b;
var _this = this;
for (var i = 1; i <= 10; i++) {
var line = this.createLine();
this.lineArr.push(line);
}
this.lineArr.forEach(function (line, index) {
line.y += index * 100;
line.y += index * 200;
line.alpha += index * 0.01;
line.speed += index * 10 * _this.acceleratedSpeed;
line.origin = true;
});
(_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 () {
_this.addEventListener(FYGE.Event.ENTER_FRAME, _this.onEnterFrame, _this);
_this.createLineTimeOut = setInterval(function () {
var l2 = _this.createLine();
_this.lineArr.unshift(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();
_this.lineArr.unshift(csd);
_this.leftCsd.addChild(csd);
}, 1600);
_this.leftCsdArr.unshift(csd);
_this.leftCsdContainer.addChild(csd);
}, 800);
}, 1000);
};
GoodsContainer.prototype.removeLine = function (index) {
var l = this.lineArr.pop();
this.lineContainer.removeChild(l);
};
GoodsContainer.prototype.removeCsdLine = function () {
var l = this.lineArr.pop();
this.lineContainer.removeChild(l);
};
GoodsContainer.prototype.fallLine = function (line, index) {
line.speed += this.acceleratedSpeed + 0.0024;
if (line.y > 1000) {
......@@ -3246,14 +3284,6 @@ var GoodsContainer = (function (_super) {
line.y += y1;
}
};
GoodsContainer.prototype.fallCsdLine = function (line, index) {
if (line.x <= -300) {
this.removeCsdLine();
}
else {
line.x1 -= 0.04;
}
};
GoodsContainer.prototype.onEnterFrame = function () {
var _this = this;
if (this._root.gameStartFlag)
......
......@@ -160,8 +160,8 @@ export class Main {
await this.loadImageTexturesCsd01(resCanvasList)
await this.loadImageTexturesCsd02(resCanvasList)
changeScene(OpenAni)
// changeScene(CsdScene)
// changeScene(OpenAni)
changeScene(CsdScene)
// changeScene(XxlScene)
})
......
......@@ -40,7 +40,7 @@ export default class Catecher extends FYGE.Container {
create () {
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.height = 220
......@@ -219,10 +219,10 @@ export default class Catecher extends FYGE.Container {
}
if (type === 'left') {
t.x = 170
t.y = 92
t.y = 82
} else if (type === 'right') {
t.x = 30
t.y = 92
t.y = 82
}
t.addChild(text)
return t
......
......@@ -7,14 +7,10 @@ import { smoke } from '../lottie/smoke/smoke'
export default class GoodsContainer extends FYGE.Container {
_root;
// 左边的传送带
leftCsd;
// 传送带棍子 的 容器
leftCsdContainer;
// 传送带棍子 的 数组
leftCsdArr = [];
// 生产棍子 的 interval函数
createLeftCsdLineTimeOut = null;
// 传送带背景
back;
// 传送带棍子 的 容器
......@@ -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.width = 438
this.back.height = 988
// test - code
// this.back.alpha = 0.2
this.addChild(this.back)
// this.leftCsd = new FYGE.Container()
// this.leftCsd.x = 0
// this.leftCsd.y = 524
// this.leftCsd.width = 370
// this.leftCsd.height = 230
// let leftCsdbg = Tools.getSprite(resCanvasList['2137d3de-174f-42b1-8ebc-c5eb667ed250'].url, 0, 0)
// leftCsdbg.x = leftCsdbg.y = 0
// this.leftCsd.addChild(leftCsdbg)
// this.addChildAt(this.leftCsd, -1)
// this.startLineCsd()
// 创建左边传送带 - 底层
this.leftCsdContainer = new FYGE.Container()
this.leftCsdContainer.x = 0
this.leftCsdContainer.y = 524
this.leftCsdContainer.width = 370
this.leftCsdContainer.height = 230
let leftCsdbg = Tools.getSprite(resCanvasList['2137d3de-174f-42b1-8ebc-c5eb667ed250'].url, 0, 0)
leftCsdbg.x = leftCsdbg.y = 0
this.leftCsdContainer.addChild(leftCsdbg)
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.width = 750
this.lineContainer.height = 988
......@@ -92,7 +104,7 @@ export default class GoodsContainer extends FYGE.Container {
maskRect.lineTo(168, 987)
maskRect.lineTo(314, 2)
maskRect.endFill()
maskRect.alpha = 0.4
maskRect.alpha = 0.3
this.lineContainer.addChild(maskRect)
this.lineContainer.mask = maskRect
this.addChild(this.lineContainer)
......@@ -104,6 +116,8 @@ export default class GoodsContainer extends FYGE.Container {
let maskGoodRect = Tools.getRect(750, 988)
this.goodsContainer.addChild(maskGoodRect)
this.goodsContainer.mask = maskGoodRect
// test - code
// this.goodsContainer.alpha = 0.2
this.addChild(this.goodsContainer)
}
......@@ -130,6 +144,7 @@ export default class GoodsContainer extends FYGE.Container {
}
}
// 分数 漂浮
floatScore(dir, s) {
s = s > 0 ? '+' + s : s
let sc = Tools.getText(s, 80, '#904f5e', FYGE.TEXT_ALIGN.CENTER)
......@@ -142,7 +157,7 @@ export default class GoodsContainer extends FYGE.Container {
sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE
this.addChild(sc)
FYGE.Tween.get(sc, null, null)
.to({alpha: .62, y: 200}, 400)
.to({alpha: .7, y: 240}, 330)
.to({alpha: 0}, 200)
.call(() => {
this.removeChild(sc)
......@@ -157,8 +172,6 @@ export default class GoodsContainer extends FYGE.Container {
this.onEnterFrame,
this
)
// clearInterval(this.createLeftCsdLineTimeOut)
// this.createLeftCsdLineTimeOut = null
clearInterval(this.createLineTimeOut)
this.createLineTimeOut = null
clearInterval(this.createGoodTimeOut)
......@@ -178,8 +191,6 @@ export default class GoodsContainer extends FYGE.Container {
createGoods () {
let arr = [...this.goodsTextures]
// let arr = [...this.goodsTextures, ...this.goodsTextures]
// arr.pop()
let idx = this.sum(0, arr.length)
let g = new FYGE.Container()
g.width = arr[idx].width
......@@ -215,7 +226,7 @@ export default class GoodsContainer extends FYGE.Container {
alpha: .75
}, 200)
.call(() => {
g['lottiePlay']()
this.lottiePlay(direction, g)
})
.to({
alpha: 0
......@@ -237,7 +248,7 @@ export default class GoodsContainer extends FYGE.Container {
alpha: .75
}, 200)
.call(() => {
g['lottiePlay']()
this.lottiePlay(direction, g)
})
.to({
alpha: 0
......@@ -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) => {
FYGE.Tween.removeTweens(g)
FYGE.Tween.get(g, null, null)
......@@ -281,6 +275,38 @@ export default class GoodsContainer extends FYGE.Container {
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) {
good.speed += this.acceleratedSpeed + 0.0006
......@@ -332,6 +358,31 @@ export default class GoodsContainer extends FYGE.Container {
line['speed'] = this.speed
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 () {
......@@ -342,14 +393,24 @@ export default class GoodsContainer extends FYGE.Container {
}
this.lineArr.forEach((line, index) => {
// line.y += index * (50 * (1 + index * 0.1))
line.y += index * 100
line.y += index * 200
line.alpha += index * 0.01
line.speed += index * 10 * this.acceleratedSpeed
line.origin = true
// console.log(line.y, index)
})
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(() => {
this.addEventListener(
FYGE.Event.ENTER_FRAME,
......@@ -357,41 +418,15 @@ export default class GoodsContainer extends FYGE.Container {
this
)
this.createLineTimeOut = setInterval(() => {
// 主 传送带
let l2 = this.createLine()
this.lineArr.unshift(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()
this.lineArr.unshift(csd)
this.leftCsd.addChild(csd)
}, 1600)
this.leftCsdArr.unshift(csd)
this.leftCsdContainer.addChild(csd)
}, 800)
}, 1000)
}
......@@ -402,13 +437,6 @@ export default class GoodsContainer extends FYGE.Container {
this.lineContainer.removeChild(l)
}
// 移除左边的传送带棍子 并 添加
removeCsdLine () {
let l = this.lineArr.pop()
// console.log(l)
this.lineContainer.removeChild(l)
}
// 传送带掉落
fallLine (line, index) {
line.speed += this.acceleratedSpeed + 0.0024
......@@ -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 () {
if (this._root.gameStartFlag) this.goodsArr.forEach((good, index) => { this.fallGood(good, 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