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

first

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