Commit 03e1853f authored by AU-Pro-mac's avatar AU-Pro-mac

add new code

parent dafe8152
...@@ -2967,10 +2967,14 @@ var GoodsContainer = (function (_super) { ...@@ -2967,10 +2967,14 @@ var GoodsContainer = (function (_super) {
_this.lineArr = []; _this.lineArr = [];
_this.createLineTimeOut = null; _this.createLineTimeOut = null;
_this.goodsArr = []; _this.goodsArr = [];
_this.createGoodTimeOut = null; _this.createGoodTimeOut = false;
_this.intoGoods = []; _this.intoGoods = [];
_this.gameEndFlag = false;
_this.speed = 2.5; _this.speed = 2.5;
_this.acceleratedSpeed = 0.01; _this.acceleratedSpeed = 0.01;
_this.lt = 0;
_this.tt = 0;
_this.ct = 0;
_this.sum = function (m, n) { _this.sum = function (m, n) {
var num = Math.floor(Math.random() * (m - n) + n); var num = Math.floor(Math.random() * (m - n) + n);
return num; return num;
...@@ -3092,15 +3096,13 @@ var GoodsContainer = (function (_super) { ...@@ -3092,15 +3096,13 @@ var GoodsContainer = (function (_super) {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
clearInterval(this.createLineTimeOut); clearInterval(this.createLineTimeOut);
this.createLineTimeOut = null; this.createLineTimeOut = null;
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
this.stopGoods(); this.stopGoods();
}; };
GoodsContainer.prototype.stopGoods = function (type) { GoodsContainer.prototype.stopGoods = function (type) {
if (type === void 0) { type = ''; } if (type === void 0) { type = ''; }
if (type === 'pause') { if (type === 'pause') {
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
} }
this.intoGoods = []; this.intoGoods = [];
this.goodsArr = []; this.goodsArr = [];
...@@ -3108,12 +3110,8 @@ var GoodsContainer = (function (_super) { ...@@ -3108,12 +3110,8 @@ var GoodsContainer = (function (_super) {
this.goodsContainer = null; this.goodsContainer = null;
}; };
GoodsContainer.prototype.startGoods = function () { GoodsContainer.prototype.startGoods = function () {
var _this = this; this.gameEndFlag = false;
this.createGoodTimeOut = setInterval(function () { this.createGoodTimeOut = true;
var g = _this.createGoods();
_this.goodsArr.unshift(g);
_this.goodsContainer.addChildAt(g, -1);
}, 1000);
}; };
GoodsContainer.prototype.createGoods = function () { GoodsContainer.prototype.createGoods = function () {
var _this = this; var _this = this;
...@@ -3158,6 +3156,9 @@ var GoodsContainer = (function (_super) { ...@@ -3158,6 +3156,9 @@ var GoodsContainer = (function (_super) {
}, 750) }, 750)
.call(function () { .call(function () {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods(); _this.removeAllGoods();
_this._root.gameOver(); _this._root.gameOver();
} }
...@@ -3179,6 +3180,9 @@ var GoodsContainer = (function (_super) { ...@@ -3179,6 +3180,9 @@ var GoodsContainer = (function (_super) {
}, 750) }, 750)
.call(function () { .call(function () {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods(); _this.removeAllGoods();
_this._root.gameOver(); _this._root.gameOver();
} }
...@@ -3230,7 +3234,7 @@ var GoodsContainer = (function (_super) { ...@@ -3230,7 +3234,7 @@ var GoodsContainer = (function (_super) {
}; };
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 >= 1500) {
good.fadeOut(index); good.fadeOut(index);
} }
else if (!good.turn) { else if (!good.turn) {
...@@ -3254,8 +3258,7 @@ var GoodsContainer = (function (_super) { ...@@ -3254,8 +3258,7 @@ var GoodsContainer = (function (_super) {
this.goodsContainer.removeChild(g); this.goodsContainer.removeChild(g);
}; };
GoodsContainer.prototype.removeAllGoods = function () { GoodsContainer.prototype.removeAllGoods = function () {
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
this.goodsArr = []; this.goodsArr = [];
this.goodsContainer.removeChildren(); this.goodsContainer.removeChildren();
}; };
...@@ -3340,6 +3343,23 @@ var GoodsContainer = (function (_super) { ...@@ -3340,6 +3343,23 @@ var GoodsContainer = (function (_super) {
}; };
GoodsContainer.prototype.onEnterFrame = function () { GoodsContainer.prototype.onEnterFrame = function () {
var _this = this; var _this = this;
if (this.createGoodTimeOut) {
if (this.lt) {
var nt = new Date().getTime();
var dt = nt - this.lt;
this.tt += (dt / 1000) >> 0;
if (this.tt != this.ct) {
this.ct = this.tt;
var g = this.createGoods();
this.goodsArr.unshift(g);
this.goodsContainer.addChildAt(g, -1);
this.lt = nt;
}
}
else {
this.lt = new Date().getTime();
}
}
if (this._root.gameStartFlag) if (this._root.gameStartFlag)
this.goodsArr.forEach(function (good, index) { _this.fallGood(good, index); }); this.goodsArr.forEach(function (good, index) { _this.fallGood(good, index); });
this.lineArr.forEach(function (line, index) { _this.fallLine(line, index); }); this.lineArr.forEach(function (line, index) { _this.fallLine(line, index); });
...@@ -15117,7 +15137,7 @@ exports.Star = Star; ...@@ -15117,7 +15137,7 @@ exports.Star = Star;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0; exports.config = void 0;
exports.config = { exports.config = {
time: 30, time: 120,
first: 1000, first: 1000,
second: 2000, second: 2000,
third: 3000, third: 3000,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2969,10 +2969,14 @@ var GoodsContainer = (function (_super) { ...@@ -2969,10 +2969,14 @@ var GoodsContainer = (function (_super) {
_this.lineArr = []; _this.lineArr = [];
_this.createLineTimeOut = null; _this.createLineTimeOut = null;
_this.goodsArr = []; _this.goodsArr = [];
_this.createGoodTimeOut = null; _this.createGoodTimeOut = false;
_this.intoGoods = []; _this.intoGoods = [];
_this.gameEndFlag = false;
_this.speed = 2.5; _this.speed = 2.5;
_this.acceleratedSpeed = 0.01; _this.acceleratedSpeed = 0.01;
_this.lt = 0;
_this.tt = 0;
_this.ct = 0;
_this.sum = function (m, n) { _this.sum = function (m, n) {
var num = Math.floor(Math.random() * (m - n) + n); var num = Math.floor(Math.random() * (m - n) + n);
return num; return num;
...@@ -3094,15 +3098,13 @@ var GoodsContainer = (function (_super) { ...@@ -3094,15 +3098,13 @@ var GoodsContainer = (function (_super) {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
clearInterval(this.createLineTimeOut); clearInterval(this.createLineTimeOut);
this.createLineTimeOut = null; this.createLineTimeOut = null;
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
this.stopGoods(); this.stopGoods();
}; };
GoodsContainer.prototype.stopGoods = function (type) { GoodsContainer.prototype.stopGoods = function (type) {
if (type === void 0) { type = ''; } if (type === void 0) { type = ''; }
if (type === 'pause') { if (type === 'pause') {
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
} }
this.intoGoods = []; this.intoGoods = [];
this.goodsArr = []; this.goodsArr = [];
...@@ -3110,12 +3112,8 @@ var GoodsContainer = (function (_super) { ...@@ -3110,12 +3112,8 @@ var GoodsContainer = (function (_super) {
this.goodsContainer = null; this.goodsContainer = null;
}; };
GoodsContainer.prototype.startGoods = function () { GoodsContainer.prototype.startGoods = function () {
var _this = this; this.gameEndFlag = false;
this.createGoodTimeOut = setInterval(function () { this.createGoodTimeOut = true;
var g = _this.createGoods();
_this.goodsArr.unshift(g);
_this.goodsContainer.addChildAt(g, -1);
}, 1000);
}; };
GoodsContainer.prototype.createGoods = function () { GoodsContainer.prototype.createGoods = function () {
var _this = this; var _this = this;
...@@ -3160,6 +3158,9 @@ var GoodsContainer = (function (_super) { ...@@ -3160,6 +3158,9 @@ var GoodsContainer = (function (_super) {
}, 750) }, 750)
.call(function () { .call(function () {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods(); _this.removeAllGoods();
_this._root.gameOver(); _this._root.gameOver();
} }
...@@ -3181,6 +3182,9 @@ var GoodsContainer = (function (_super) { ...@@ -3181,6 +3182,9 @@ var GoodsContainer = (function (_super) {
}, 750) }, 750)
.call(function () { .call(function () {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods(); _this.removeAllGoods();
_this._root.gameOver(); _this._root.gameOver();
} }
...@@ -3232,7 +3236,7 @@ var GoodsContainer = (function (_super) { ...@@ -3232,7 +3236,7 @@ var GoodsContainer = (function (_super) {
}; };
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 >= 1500) {
good.fadeOut(index); good.fadeOut(index);
} }
else if (!good.turn) { else if (!good.turn) {
...@@ -3256,8 +3260,7 @@ var GoodsContainer = (function (_super) { ...@@ -3256,8 +3260,7 @@ var GoodsContainer = (function (_super) {
this.goodsContainer.removeChild(g); this.goodsContainer.removeChild(g);
}; };
GoodsContainer.prototype.removeAllGoods = function () { GoodsContainer.prototype.removeAllGoods = function () {
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
this.goodsArr = []; this.goodsArr = [];
this.goodsContainer.removeChildren(); this.goodsContainer.removeChildren();
}; };
...@@ -3342,6 +3345,23 @@ var GoodsContainer = (function (_super) { ...@@ -3342,6 +3345,23 @@ var GoodsContainer = (function (_super) {
}; };
GoodsContainer.prototype.onEnterFrame = function () { GoodsContainer.prototype.onEnterFrame = function () {
var _this = this; var _this = this;
if (this.createGoodTimeOut) {
if (this.lt) {
var nt = new Date().getTime();
var dt = nt - this.lt;
this.tt += (dt / 1000) >> 0;
if (this.tt != this.ct) {
this.ct = this.tt;
var g = this.createGoods();
this.goodsArr.unshift(g);
this.goodsContainer.addChildAt(g, -1);
this.lt = nt;
}
}
else {
this.lt = new Date().getTime();
}
}
if (this._root.gameStartFlag) if (this._root.gameStartFlag)
this.goodsArr.forEach(function (good, index) { _this.fallGood(good, index); }); this.goodsArr.forEach(function (good, index) { _this.fallGood(good, index); });
this.lineArr.forEach(function (line, index) { _this.fallLine(line, index); }); this.lineArr.forEach(function (line, index) { _this.fallLine(line, index); });
...@@ -15119,7 +15139,7 @@ exports.Star = Star; ...@@ -15119,7 +15139,7 @@ exports.Star = Star;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0; exports.config = void 0;
exports.config = { exports.config = {
time: 30, time: 120,
first: 1000, first: 1000,
second: 2000, second: 2000,
third: 3000, third: 3000,
......
...@@ -28,9 +28,11 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -28,9 +28,11 @@ export default class GoodsContainer extends FYGE.Container {
// 掉落物皮肤 // 掉落物皮肤
goodsTextures; goodsTextures;
// 产生掉落物 的 interval函数 // 产生掉落物 的 interval函数
createGoodTimeOut = null createGoodTimeOut = false
// 进入可被滑动的 掉落物 // 进入可被滑动的 掉落物
intoGoods = []; intoGoods = [];
// 游戏结束 flag
gameEndFlag = false;
private speed = 2.5 // 初速度 private speed = 2.5 // 初速度
private acceleratedSpeed = 0.01 // 加速度 private acceleratedSpeed = 0.01 // 加速度
...@@ -123,6 +125,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -123,6 +125,7 @@ export default class GoodsContainer extends FYGE.Container {
} }
// 收到 滑动方向 // 收到 滑动方向
getDirection (direction) { getDirection (direction) {
// console.log(this.intoGoods) // console.log(this.intoGoods)
...@@ -175,15 +178,16 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -175,15 +178,16 @@ export default class GoodsContainer extends FYGE.Container {
) )
clearInterval(this.createLineTimeOut) clearInterval(this.createLineTimeOut)
this.createLineTimeOut = null this.createLineTimeOut = null
clearInterval(this.createGoodTimeOut) // clearInterval(this.createGoodTimeOut)
this.createGoodTimeOut = null this.createGoodTimeOut = false
this.stopGoods() this.stopGoods()
} }
// 暂停掉落物循环
stopGoods (type = '') { stopGoods (type = '') {
if (type === 'pause') { if (type === 'pause') {
clearInterval(this.createGoodTimeOut) // clearInterval(this.createGoodTimeOut)
this.createGoodTimeOut = null this.createGoodTimeOut = false
} }
this.intoGoods = [] this.intoGoods = []
this.goodsArr = [] this.goodsArr = []
...@@ -193,11 +197,8 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -193,11 +197,8 @@ export default class GoodsContainer extends FYGE.Container {
// 掉落物开始掉落 // 掉落物开始掉落
startGoods () { startGoods () {
this.createGoodTimeOut = setInterval(() => { this.gameEndFlag = false
let g = this.createGoods() this.createGoodTimeOut = true
this.goodsArr.unshift(g)
this.goodsContainer.addChildAt(g, -1)
}, 1000)
} }
createGoods () { createGoods () {
...@@ -244,6 +245,8 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -244,6 +245,8 @@ export default class GoodsContainer extends FYGE.Container {
}, 750) }, 750)
.call(() => { .call(() => {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (this.gameEndFlag) return
this.gameEndFlag = true
this.removeAllGoods() this.removeAllGoods()
this._root.gameOver() this._root.gameOver()
} }
...@@ -266,6 +269,8 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -266,6 +269,8 @@ export default class GoodsContainer extends FYGE.Container {
}, 750) }, 750)
.call(() => { .call(() => {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (this.gameEndFlag) return
this.gameEndFlag = true
this.removeAllGoods() this.removeAllGoods()
this._root.gameOver() this._root.gameOver()
} }
...@@ -321,7 +326,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -321,7 +326,7 @@ export default class GoodsContainer extends FYGE.Container {
// 掉落物 掉落 // 掉落物 掉落
fallGood (good, index) { fallGood (good, index) {
good.speed += this.acceleratedSpeed + 0.0006 good.speed += this.acceleratedSpeed + 0.0006
if (good.y > 1300) { if (good.y >= 1500) {
good.fadeOut(index) good.fadeOut(index)
// this.removeGood(index) // this.removeGood(index)
} else if (!good.turn) { } else if (!good.turn) {
...@@ -352,8 +357,8 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -352,8 +357,8 @@ export default class GoodsContainer extends FYGE.Container {
// 移除所有掉落物 // 移除所有掉落物
removeAllGoods () { removeAllGoods () {
clearInterval(this.createGoodTimeOut) // clearInterval(this.createGoodTimeOut)
this.createGoodTimeOut = null this.createGoodTimeOut = false
this.goodsArr = [] this.goodsArr = []
this.goodsContainer.removeChildren() this.goodsContainer.removeChildren()
} }
...@@ -460,7 +465,35 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -460,7 +465,35 @@ export default class GoodsContainer extends FYGE.Container {
} }
} }
lt = 0
tt = 0
ct = 0
onEnterFrame () { onEnterFrame () {
if (this.createGoodTimeOut) {
if (this.lt) {
let nt = new Date().getTime()
let dt = nt - this.lt
this.tt += (dt / 1000) >> 0
if (this.tt != this.ct) {
// console.log(this.tt)
this.ct = this.tt
let g = this.createGoods()
this.goodsArr.unshift(g)
this.goodsContainer.addChildAt(g, -1)
this.lt = nt
}
} else {
this.lt = new Date().getTime()
}
}
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) })
this.leftCsdArr.forEach((line, index) => { this.fallCsdLine(line, index) }) this.leftCsdArr.forEach((line, index) => { this.fallCsdLine(line, index) })
......
export const config = { export const config = {
//倒计时时间s //倒计时时间s
time: 30, time: 120,
//3关分数 //3关分数
first: 1000, first: 1000,
second: 2000, second: 2000,
......
...@@ -478,7 +478,11 @@ Page({ ...@@ -478,7 +478,11 @@ Page({
// 页面显示 // 页面显示
onShow() { onShow() {
if (this.userLogin) this.getGameInfo() if (this.userLogin) this.getGameInfo()
this.setData({ missionRefresh: true }) this.setData({
missionRefresh: true,
showChooseGame: app.openYDGame
})
app.openYDGame = false
}, },
closeMissionRefresh () { closeMissionRefresh () {
......
...@@ -2969,10 +2969,14 @@ var GoodsContainer = (function (_super) { ...@@ -2969,10 +2969,14 @@ var GoodsContainer = (function (_super) {
_this.lineArr = []; _this.lineArr = [];
_this.createLineTimeOut = null; _this.createLineTimeOut = null;
_this.goodsArr = []; _this.goodsArr = [];
_this.createGoodTimeOut = null; _this.createGoodTimeOut = false;
_this.intoGoods = []; _this.intoGoods = [];
_this.gameEndFlag = false;
_this.speed = 2.5; _this.speed = 2.5;
_this.acceleratedSpeed = 0.01; _this.acceleratedSpeed = 0.01;
_this.lt = 0;
_this.tt = 0;
_this.ct = 0;
_this.sum = function (m, n) { _this.sum = function (m, n) {
var num = Math.floor(Math.random() * (m - n) + n); var num = Math.floor(Math.random() * (m - n) + n);
return num; return num;
...@@ -3094,15 +3098,13 @@ var GoodsContainer = (function (_super) { ...@@ -3094,15 +3098,13 @@ var GoodsContainer = (function (_super) {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
clearInterval(this.createLineTimeOut); clearInterval(this.createLineTimeOut);
this.createLineTimeOut = null; this.createLineTimeOut = null;
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
this.stopGoods(); this.stopGoods();
}; };
GoodsContainer.prototype.stopGoods = function (type) { GoodsContainer.prototype.stopGoods = function (type) {
if (type === void 0) { type = ''; } if (type === void 0) { type = ''; }
if (type === 'pause') { if (type === 'pause') {
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
} }
this.intoGoods = []; this.intoGoods = [];
this.goodsArr = []; this.goodsArr = [];
...@@ -3110,12 +3112,8 @@ var GoodsContainer = (function (_super) { ...@@ -3110,12 +3112,8 @@ var GoodsContainer = (function (_super) {
this.goodsContainer = null; this.goodsContainer = null;
}; };
GoodsContainer.prototype.startGoods = function () { GoodsContainer.prototype.startGoods = function () {
var _this = this; this.gameEndFlag = false;
this.createGoodTimeOut = setInterval(function () { this.createGoodTimeOut = true;
var g = _this.createGoods();
_this.goodsArr.unshift(g);
_this.goodsContainer.addChildAt(g, -1);
}, 1000);
}; };
GoodsContainer.prototype.createGoods = function () { GoodsContainer.prototype.createGoods = function () {
var _this = this; var _this = this;
...@@ -3160,6 +3158,9 @@ var GoodsContainer = (function (_super) { ...@@ -3160,6 +3158,9 @@ var GoodsContainer = (function (_super) {
}, 750) }, 750)
.call(function () { .call(function () {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods(); _this.removeAllGoods();
_this._root.gameOver(); _this._root.gameOver();
} }
...@@ -3181,6 +3182,9 @@ var GoodsContainer = (function (_super) { ...@@ -3181,6 +3182,9 @@ var GoodsContainer = (function (_super) {
}, 750) }, 750)
.call(function () { .call(function () {
if (cb === 'gameOver') { if (cb === 'gameOver') {
if (_this.gameEndFlag)
return;
_this.gameEndFlag = true;
_this.removeAllGoods(); _this.removeAllGoods();
_this._root.gameOver(); _this._root.gameOver();
} }
...@@ -3232,7 +3236,7 @@ var GoodsContainer = (function (_super) { ...@@ -3232,7 +3236,7 @@ var GoodsContainer = (function (_super) {
}; };
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 >= 1500) {
good.fadeOut(index); good.fadeOut(index);
} }
else if (!good.turn) { else if (!good.turn) {
...@@ -3256,8 +3260,7 @@ var GoodsContainer = (function (_super) { ...@@ -3256,8 +3260,7 @@ var GoodsContainer = (function (_super) {
this.goodsContainer.removeChild(g); this.goodsContainer.removeChild(g);
}; };
GoodsContainer.prototype.removeAllGoods = function () { GoodsContainer.prototype.removeAllGoods = function () {
clearInterval(this.createGoodTimeOut); this.createGoodTimeOut = false;
this.createGoodTimeOut = null;
this.goodsArr = []; this.goodsArr = [];
this.goodsContainer.removeChildren(); this.goodsContainer.removeChildren();
}; };
...@@ -3342,6 +3345,23 @@ var GoodsContainer = (function (_super) { ...@@ -3342,6 +3345,23 @@ var GoodsContainer = (function (_super) {
}; };
GoodsContainer.prototype.onEnterFrame = function () { GoodsContainer.prototype.onEnterFrame = function () {
var _this = this; var _this = this;
if (this.createGoodTimeOut) {
if (this.lt) {
var nt = new Date().getTime();
var dt = nt - this.lt;
this.tt += (dt / 1000) >> 0;
if (this.tt != this.ct) {
this.ct = this.tt;
var g = this.createGoods();
this.goodsArr.unshift(g);
this.goodsContainer.addChildAt(g, -1);
this.lt = nt;
}
}
else {
this.lt = new Date().getTime();
}
}
if (this._root.gameStartFlag) if (this._root.gameStartFlag)
this.goodsArr.forEach(function (good, index) { _this.fallGood(good, index); }); this.goodsArr.forEach(function (good, index) { _this.fallGood(good, index); });
this.lineArr.forEach(function (line, index) { _this.fallLine(line, index); }); this.lineArr.forEach(function (line, index) { _this.fallLine(line, index); });
...@@ -15119,7 +15139,7 @@ exports.Star = Star; ...@@ -15119,7 +15139,7 @@ exports.Star = Star;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0; exports.config = void 0;
exports.config = { exports.config = {
time: 30, time: 120,
first: 1000, first: 1000,
second: 2000, second: 2000,
third: 3000, third: 3000,
......
...@@ -159,8 +159,8 @@ Component({ ...@@ -159,8 +159,8 @@ Component({
// 游戏开始 获取用户信息 // 游戏开始 获取用户信息
async gameStartInfo () { async gameStartInfo () {
// test - code // test - code
this.gameStartInfo_test() // this.gameStartInfo_test()
return // return
// 游戏重新开始 获取游戏次数 // 游戏重新开始 获取游戏次数
let gt = true let gt = true
...@@ -170,7 +170,7 @@ Component({ ...@@ -170,7 +170,7 @@ Component({
if (!success) { console.warn(res); commonToast(res && res.message) } if (!success) { console.warn(res); commonToast(res && res.message) }
else { else {
console.log('%c-----获取游戏信息\n' + '-----yd.getGameInfo\n', ConsoleStyle, data) console.log('%c-----获取游戏信息\n' + '-----yd.getGameInfo\n', ConsoleStyle, data)
if (data.gameTimes == '0' || data.gameTimes == 0) gt = false if (data.gameTimes == 0) gt = false
} }
} }
...@@ -249,8 +249,8 @@ Component({ ...@@ -249,8 +249,8 @@ Component({
// 游戏结束 获取开奖 // 游戏结束 获取开奖
getGameOverPrize () { getGameOverPrize () {
// test - code // test - code
this.getGameOverPrize_test() // this.getGameOverPrize_test()
return // return
API.gameOver({activityId: app.activityId, type: this.gameType == 1 ? 'slide' : 'timeline', isWin: this.isWin}) API.gameOver({activityId: app.activityId, type: this.gameType == 1 ? 'slide' : 'timeline', isWin: this.isWin})
.then(res => { .then(res => {
...@@ -413,7 +413,7 @@ Component({ ...@@ -413,7 +413,7 @@ Component({
getGameOverPrize_test (){ getGameOverPrize_test (){
this.gamePrize = { this.gamePrize = {
name: '一碗热翔', name: '一碗',
image: '//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png', image: '//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png',
type: 3 type: 3
} }
......
...@@ -4,7 +4,7 @@ import { clickStat } from '../../md'; ...@@ -4,7 +4,7 @@ import { clickStat } from '../../md';
import resList from '../../resconfig/resList.js' import resList from '../../resconfig/resList.js'
const { tbcc } = app; const { tbcc } = app;
const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants; const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle, checkShopFavoredStatus, debounce } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle, checkShopFavoredStatus, debounce, redirectTo } = tbcc.tb;
Page({ Page({
data: { data: {
...@@ -111,6 +111,9 @@ Page({ ...@@ -111,6 +111,9 @@ Page({
confirmCallback: async () => { confirmCallback: async () => {
this.setData({ rotateFlag: false }) this.setData({ rotateFlag: false })
this.closeCommonModalT1() this.closeCommonModalT1()
app.openYDGame = true
my.navigateBack()
// redirectTo('/pages/homePage/homePage')
}, },
btnImg: resList['8aa6d279-6105-430a-8b5a-2132a983fa8a'].url btnImg: resList['8aa6d279-6105-430a-8b5a-2132a983fa8a'].url
}) })
......
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