Commit 4ca96863 authored by 熊东起's avatar 熊东起

first

parent a7424019
......@@ -7036,7 +7036,7 @@ exports.ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1601200393/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1603181578/resource/"
};
......@@ -8733,7 +8733,7 @@ var DxqPlayScene = (function (_super) {
parseInt(this.__score / MConst_1.MConst.disScore + "") > 0 &&
parseInt(this.__score / MConst_1.MConst.disScore + "") > this.count) {
var seq = parseInt(this.__score / MConst_1.MConst.disScore + "");
this.count += seq;
this.count++;
this.onSubmitFirst(seq);
}
},
......@@ -8745,7 +8745,7 @@ var DxqPlayScene = (function (_super) {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, submitFirstGame_1.default(this.score, seq)];
case 0: return [4, submitFirstGame_1.default(MConst_1.MConst.disScore, seq)];
case 1:
result = _a.sent();
if (!result.success) {
......@@ -8857,16 +8857,23 @@ var DxqPlayScene = (function (_super) {
};
DxqPlayScene.prototype.over = function () {
return __awaiter(this, void 0, void 0, function () {
var result;
var result1, result;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log("游戏结束");
this.timer == 0;
this.gamePause();
this._car.carMc.stop();
return [4, submitGame_1.default(this.score)];
return [4, submitFirstGame_1.default(this.score - this.count * MConst_1.MConst.disScore, this.count + 1)];
case 1:
result1 = _a.sent();
if (!!result1.success) return [3, 2];
this.gameDead();
return [3, 4];
case 2: return [4, submitGame_1.default(this.score)];
case 3:
result = _a.sent();
if (result.success) {
console.log("弹出弹窗", result);
......@@ -8899,7 +8906,8 @@ var DxqPlayScene = (function (_super) {
}, 3000);
}
}
return [2];
_a.label = 4;
case 4: return [2];
}
});
});
......@@ -10243,13 +10251,13 @@ var GameAwardPanel = (function (_super) {
bg.addChild(desc);
desc.y = 515;
var awardImg = new FYGE.Sprite();
awardImg.width = 401;
awardImg.height = 164;
awardImg.width = 180;
awardImg.height = 180;
awardImg.texture = FYGE.Texture.fromUrl(raw.prize.icon + ("?" + Date.now()));
awardImg.texture.baseTexture.once("update", function () {
awardImg.x =
bg.width / 2 - awardImg.texture.baseTexture.source.width / 2 - 11;
awardImg.y = 560;
bg.width / 2 - 90;
awardImg.y = 550;
}, this);
bg.addChild(awardImg);
this.closeBtn = new FYGE.Button(RES_1.RES.getRes("comCloseBtn.png"));
......
This diff is collapsed.
......@@ -994,5 +994,5 @@ export const ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1601200393/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1603181578/resource/"
}
\ No newline at end of file
......@@ -285,13 +285,13 @@ export default class DxqPlayScene extends FYGE.Container {
parseInt(this.__score / MConst.disScore + "") > this.count
) {
let seq = parseInt(this.__score / MConst.disScore + "");
this.count += seq;
this.count++;
this.onSubmitFirst(seq);
}
}
private async onSubmitFirst(seq) {
const result = await submitFirstGame(this.score, seq);
const result = await submitFirstGame(MConst.disScore, seq);
if (!result.success) {
this.gameDead();
}
......@@ -439,10 +439,19 @@ export default class DxqPlayScene extends FYGE.Container {
}
private async over() {
console.log("游戏结束");
this.timer == 0;
this.gamePause();
this._car.carMc.stop();
//先中途提交
const result1 = await submitFirstGame(
this.score - this.count * MConst.disScore,
this.count + 1
);
if (!result1.success) {
this.gameDead();
} else {
const result = await submitGame(this.score);
if (result.success) {
console.log("弹出弹窗", result);
......@@ -459,15 +468,14 @@ export default class DxqPlayScene extends FYGE.Container {
} else {
//弹出弹窗 -- 游戏结束
if (result.code == "500723") {
showPanel(GameOverPanel, {finalScore: this.score,type: "500723"});
}
else if (result.code == "500724") {
showPanel(GameOverPanel, {finalScore: this.score,type: "500724"});
showPanel(GameOverPanel, { finalScore: this.score, type: "500723" });
} else if (result.code == "500724") {
showPanel(GameOverPanel, { finalScore: this.score, type: "500724" });
}
//再来一局
else if (result.code == "500722") {
// showPanel(GameAgainPanel, result.data);
showPanel(GameAgainPanel, {finalScore: this.score});
showPanel(GameAgainPanel, { finalScore: this.score });
GDispatcher.dispatchEvent({ type: "showBuried" }, { type: 1 });
} else {
showToast(result.message);
......@@ -477,6 +485,7 @@ export default class DxqPlayScene extends FYGE.Container {
}
}
}
}
gamePause() {
this.pause = true;
......
......@@ -18,6 +18,12 @@ export class GameAwardPanel extends Panel {
centerImage(bg);
const { raw } = this.data as any;
// let raw = {
// finalScore: 99,
// prize: {
// name: "88",
// }
// }
//本局分数
var textures = {};
......@@ -55,15 +61,16 @@ export class GameAwardPanel extends Panel {
//奖品图片
const awardImg = new FYGE.Sprite();
awardImg.width = 401;
awardImg.height = 164;
awardImg.width = 180;
awardImg.height = 180;
// awardImg.texture = FYGE.Texture.fromUrl("//yun.duiba.com.cn/spark/assets/def91b02829adc3d995d8a0416924152bf2bf49f.png");
awardImg.texture = FYGE.Texture.fromUrl(raw.prize.icon + `?${Date.now()}`);
awardImg.texture.baseTexture.once(
"update",
() => {
awardImg.x =
bg.width / 2 - awardImg.texture.baseTexture.source.width / 2 - 11;
awardImg.y = 560;
bg.width / 2-90;
awardImg.y = 550;
},
this
);
......
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