Commit eb5c8911 authored by haiyoucuv's avatar haiyoucuv

1

parent c5af0aa6
This diff is collapsed.
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
} }
}, },
"levelPrize": { "levelPrize": {
"level_90": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png",
"level_60": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01Llkz1U1wMhRqE4D0f_!!2275046294-2-miniprogram.png", "level_60": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01Llkz1U1wMhRqE4D0f_!!2275046294-2-miniprogram.png",
"level_90": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png",
"level_120": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01WvSfpG1wMhRrsjqFq_!!2275046294-2-miniprogram.png", "level_120": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01WvSfpG1wMhRrsjqFq_!!2275046294-2-miniprogram.png",
"level_30": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01Mf9wLi1wMhRoCuoOs_!!2275046294-2-miniprogram.png", "level_30": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01Mf9wLi1wMhRoCuoOs_!!2275046294-2-miniprogram.png",
"level_10": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01bsypJm1wMhRsRMjh1_!!2275046294-2-miniprogram.png" "level_10": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01bsypJm1wMhRsRMjh1_!!2275046294-2-miniprogram.png"
......
...@@ -43,77 +43,88 @@ ...@@ -43,77 +43,88 @@
"scores": 11111, "scores": 11111,
"stars": 1, "stars": 1,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 2, "level": 2,
"scores": 22222, "scores": 22222,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 3, "level": 3,
"scores": 3333, "scores": 3333,
"stars": 3, "stars": 3,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 4, "level": 4,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 5, "level": 5,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 6, "level": 6,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 7, "level": 7,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 4, "level": 4,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 8, "level": 8,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 9, "level": 9,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
}, },
{ {
"level": 10, "level": 10,
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": true "isVisitSuccess": true,
"sendAwardType": "prize"
} }
], ],
"isFristLogin": false "isFristLogin": false
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
"keys": "圆圈.png,开心收下.png", "keys": "圆圈.png,开心收下.png",
"name": "FreePowerPanel" "name": "FreePowerPanel"
}, },
{
"keys": "joinBg.png,joinBtn.png",
"name": "JoinPanel"
},
{ {
"keys": "体力不足Bg.png,体力不足按钮.png", "keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel" "name": "NoEnergyPanel"
...@@ -57,7 +61,7 @@ ...@@ -57,7 +61,7 @@
"name": "UseToolPanel" "name": "UseToolPanel"
}, },
{ {
"keys": "bonusTime0.png,bonusTime1.png,bonusTime10.png,bonusTime11.png,bonusTime12.png,bonusTime13.png,bonusTime14.png,bonusTime15.png,bonusTime16.png,bonusTime17.png,bonusTime18.png,bonusTime19.png,bonusTime2.png,bonusTime20.png,bonusTime21.png,bonusTime22.png,bonusTime23.png,bonusTime24.png,bonusTime25.png,bonusTime26.png,bonusTime27.png,bonusTime28.png,bonusTime3.png,bonusTime4.png,bonusTime5.png,bonusTime6.png,bonusTime7.png,bonusTime8.png,bonusTime9.png", "keys": "img_0.png,img_1.png,img_10.png,img_11.png,img_12.png,img_13.png,img_14.png,img_15.png,img_16.png,img_17.png,img_18.png,img_19.png,img_2.png,img_3.png,img_4.png,img_5.png,img_6.png,img_7.png,img_8.png,img_9.png",
"name": "bonusTime" "name": "bonusTime"
}, },
{ {
...@@ -73,7 +77,7 @@ ...@@ -73,7 +77,7 @@
"name": "fiveVerHorDis" "name": "fiveVerHorDis"
}, },
{ {
"keys": "carb_arm.png,carb_body.png,carb_hand_l.png,carb_hand_r.png,fox_arm_l.png,fox_body.png,fox_head.png,fox_tail0.png,fox_tail1.png,fox_tail10.png,fox_tail11.png,fox_tail12.png,fox_tail13.png,fox_tail14.png,fox_tail2.png,fox_tail3.png,fox_tail4.png,fox_tail5.png,fox_tail6.png,fox_tail7.png,fox_tail8.png,fox_tail9.png,hommer.png,img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.png,img_owl.png,img_tree.png,loadingBg.jpg,loadingBg2.png,loadingPro0.png,loadingPro1.png,loadingPro10.png,loadingPro11.png,loadingPro2.png,loadingPro3.png,loadingPro4.png,loadingPro5.png,loadingPro6.png,loadingPro7.png,loadingPro8.png,loadingPro9.png,loadingTitle.png,owl_sleep.png,proDown.png,wheel.png", "keys": "carb_arm.png,carb_body.png,carb_hand_l.png,carb_hand_r.png,fox_arm_l.png,fox_body.png,fox_head.png,fox_tail0.png,fox_tail1.png,fox_tail10.png,fox_tail11.png,fox_tail12.png,fox_tail13.png,fox_tail14.png,fox_tail2.png,fox_tail3.png,fox_tail4.png,fox_tail5.png,fox_tail6.png,fox_tail7.png,fox_tail8.png,fox_tail9.png,hommer.png,img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.png,img_owl.png,img_tree.png,lighting_1.png,lighting_2.png,loadingBg.jpg,loadingBg2.png,loadingPro0.png,loadingPro1.png,loadingPro10.png,loadingPro11.png,loadingPro2.png,loadingPro3.png,loadingPro4.png,loadingPro5.png,loadingPro6.png,loadingPro7.png,loadingPro8.png,loadingPro9.png,loadingTitle.png,owl_sleep.png,proDown.png,wheel.png",
"name": "loadingScene" "name": "loadingScene"
}, },
{ {
......
...@@ -20,6 +20,10 @@ export const ResJson = { ...@@ -20,6 +20,10 @@ export const ResJson = {
"keys": "圆圈.png,开心收下.png", "keys": "圆圈.png,开心收下.png",
"name": "FreePowerPanel" "name": "FreePowerPanel"
}, },
{
"keys": "joinBg.png,joinBtn.png",
"name": "JoinPanel"
},
{ {
"keys": "体力不足Bg.png,体力不足按钮.png", "keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel" "name": "NoEnergyPanel"
...@@ -57,7 +61,7 @@ export const ResJson = { ...@@ -57,7 +61,7 @@ export const ResJson = {
"name": "UseToolPanel" "name": "UseToolPanel"
}, },
{ {
"keys": "bonusTime0.png,bonusTime1.png,bonusTime10.png,bonusTime11.png,bonusTime12.png,bonusTime13.png,bonusTime14.png,bonusTime15.png,bonusTime16.png,bonusTime17.png,bonusTime18.png,bonusTime19.png,bonusTime2.png,bonusTime20.png,bonusTime21.png,bonusTime22.png,bonusTime23.png,bonusTime24.png,bonusTime25.png,bonusTime26.png,bonusTime27.png,bonusTime28.png,bonusTime3.png,bonusTime4.png,bonusTime5.png,bonusTime6.png,bonusTime7.png,bonusTime8.png,bonusTime9.png", "keys": "img_0.png,img_1.png,img_10.png,img_11.png,img_12.png,img_13.png,img_14.png,img_15.png,img_16.png,img_17.png,img_18.png,img_19.png,img_2.png,img_3.png,img_4.png,img_5.png,img_6.png,img_7.png,img_8.png,img_9.png",
"name": "bonusTime" "name": "bonusTime"
}, },
{ {
...@@ -73,7 +77,7 @@ export const ResJson = { ...@@ -73,7 +77,7 @@ export const ResJson = {
"name": "fiveVerHorDis" "name": "fiveVerHorDis"
}, },
{ {
"keys": "carb_arm.png,carb_body.png,carb_hand_l.png,carb_hand_r.png,fox_arm_l.png,fox_body.png,fox_head.png,fox_tail0.png,fox_tail1.png,fox_tail10.png,fox_tail11.png,fox_tail12.png,fox_tail13.png,fox_tail14.png,fox_tail2.png,fox_tail3.png,fox_tail4.png,fox_tail5.png,fox_tail6.png,fox_tail7.png,fox_tail8.png,fox_tail9.png,hommer.png,img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.png,img_owl.png,img_tree.png,loadingBg.jpg,loadingBg2.png,loadingPro0.png,loadingPro1.png,loadingPro10.png,loadingPro11.png,loadingPro2.png,loadingPro3.png,loadingPro4.png,loadingPro5.png,loadingPro6.png,loadingPro7.png,loadingPro8.png,loadingPro9.png,loadingTitle.png,owl_sleep.png,proDown.png,wheel.png", "keys": "carb_arm.png,carb_body.png,carb_hand_l.png,carb_hand_r.png,fox_arm_l.png,fox_body.png,fox_head.png,fox_tail0.png,fox_tail1.png,fox_tail10.png,fox_tail11.png,fox_tail12.png,fox_tail13.png,fox_tail14.png,fox_tail2.png,fox_tail3.png,fox_tail4.png,fox_tail5.png,fox_tail6.png,fox_tail7.png,fox_tail8.png,fox_tail9.png,hommer.png,img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.png,img_owl.png,img_tree.png,lighting_1.png,lighting_2.png,loadingBg.jpg,loadingBg2.png,loadingPro0.png,loadingPro1.png,loadingPro10.png,loadingPro11.png,loadingPro2.png,loadingPro3.png,loadingPro4.png,loadingPro5.png,loadingPro6.png,loadingPro7.png,loadingPro8.png,loadingPro9.png,loadingTitle.png,owl_sleep.png,proDown.png,wheel.png",
"name": "loadingScene" "name": "loadingScene"
}, },
{ {
......
...@@ -92,7 +92,7 @@ export const SkinJson = { ...@@ -92,7 +92,7 @@ export const SkinJson = {
{ {
"name": "提示文案", "name": "提示文案",
"x": 210, "x": 210,
"y": 797, "y": 815,
"alpha": 1, "alpha": 1,
"type": "text", "type": "text",
"props": { "props": {
...@@ -168,7 +168,7 @@ export const SkinJson = { ...@@ -168,7 +168,7 @@ export const SkinJson = {
{ {
"name": "继续闯关小", "name": "继续闯关小",
"x": 93, "x": 93,
"y": 1095, "y": 1086,
"alpha": 1, "alpha": 1,
"type": "button", "type": "button",
"props": { "props": {
...@@ -179,7 +179,7 @@ export const SkinJson = { ...@@ -179,7 +179,7 @@ export const SkinJson = {
{ {
"name": "去抽奖", "name": "去抽奖",
"x": 383, "x": 383,
"y": 1095, "y": 1086,
"alpha": 1, "alpha": 1,
"type": "button", "type": "button",
"props": { "props": {
...@@ -223,8 +223,9 @@ export const SkinJson = { ...@@ -223,8 +223,9 @@ export const SkinJson = {
"alpha": 1, "alpha": 1,
"type": "sprite", "type": "sprite",
"props": { "props": {
"source": "红包奖励.png" "source": ""
} },
"id": "prizeImg"
}, },
{ {
"name": "道具", "name": "道具",
...@@ -233,7 +234,7 @@ export const SkinJson = { ...@@ -233,7 +234,7 @@ export const SkinJson = {
"type": "container", "type": "container",
"children": [ "children": [
{ {
"name": "圆角矩形 648", "name": "bg",
"x": 0, "x": 0,
"y": 0, "y": 0,
"alpha": 1, "alpha": 1,
...@@ -243,7 +244,7 @@ export const SkinJson = { ...@@ -243,7 +244,7 @@ export const SkinJson = {
} }
}, },
{ {
"name": "步数道具 x1", "name": "label",
"x": 265, "x": 265,
"y": 85, "y": 85,
"alpha": 1, "alpha": 1,
...@@ -256,7 +257,7 @@ export const SkinJson = { ...@@ -256,7 +257,7 @@ export const SkinJson = {
} }
}, },
{ {
"name": "道具", "name": "img",
"x": 76, "x": 76,
"y": 24, "y": 24,
"alpha": 1, "alpha": 1,
...@@ -265,7 +266,8 @@ export const SkinJson = { ...@@ -265,7 +266,8 @@ export const SkinJson = {
"source": "道具.png" "source": "道具.png"
} }
} }
] ],
"id": "prop"
}, },
{ {
"name": "关闭按钮", "name": "关闭按钮",
......
...@@ -44,6 +44,7 @@ export class Tools { ...@@ -44,6 +44,7 @@ export class Tools {
"level": number, "level": number,
"isVisitSuccess": boolean, "isVisitSuccess": boolean,
"stars": number, "stars": number,
sendAwardType: any
}[], }[],
"prizes": { "prizes": {
"receiveTime": string,//number "receiveTime": string,//number
...@@ -94,7 +95,7 @@ export class Tools { ...@@ -94,7 +95,7 @@ export class Tools {
*/ */
public static getGameInfo() { public static getGameInfo() {
return new Promise((r) => { return new Promise((r) => {
sendTbNet(TbNetName.getGameInfo, {},(s, res) => { sendTbNet(TbNetName.getGameInfo, {}, (s, res) => {
if (s) this.gameData = res.data; if (s) this.gameData = res.data;
r(s); r(s);
}) })
...@@ -106,7 +107,7 @@ export class Tools { ...@@ -106,7 +107,7 @@ export class Tools {
*/ */
public static consumerTools(type: PropType): Promise<boolean> { public static consumerTools(type: PropType): Promise<boolean> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
sendTbNet(TbNetName.consumerTools, { type }, (s, res) => { sendTbNet(TbNetName.consumerTools, {type}, (s, res) => {
if (s) { if (s) {
//修改道具数量 //修改道具数量
this.gameData.tools = res.data.tools; this.gameData.tools = res.data.tools;
...@@ -144,7 +145,7 @@ export class Tools { ...@@ -144,7 +145,7 @@ export class Tools {
if (creditsData && !creditsData.success && !creditsData.data.isvip) { if (creditsData && !creditsData.success && !creditsData.data.isvip) {
return creditsData.data.url return creditsData.data.url
} }
const res = await sendTbNet(TbNetName.exchange, { type, credits: creditsData.data.credits }) const res = await sendTbNet(TbNetName.exchange, {type, credits: creditsData.data.credits})
if (res.success) { if (res.success) {
//修改道具数量和体力 //修改道具数量和体力
this.gameData.power = res.data.power; this.gameData.power = res.data.power;
...@@ -163,11 +164,11 @@ export class Tools { ...@@ -163,11 +164,11 @@ export class Tools {
var tbMy = my var tbMy = my
if (!tbMy) return; if (!tbMy) return;
//@ts-ignore //@ts-ignore
const { cloud } = getApp(); const {cloud} = getApp();
//测试地址//到时云存储传一个小json,,改路径 //测试地址//到时云存储传一个小json,,改路径
var url = "cloud://B4F0300E5148F478B506DEDC26EA4C6C//butterfly0.svga"; var url = "cloud://B4F0300E5148F478B506DEDC26EA4C6C//butterfly0.svga";
//获取临时地址 //获取临时地址
var urls = await cloud.file.getTempFileURL({ fileId: [url] }) var urls = await cloud.file.getTempFileURL({fileId: [url]})
url = urls[0].url.replace('-internal', ''); url = urls[0].url.replace('-internal', '');
tbMy.downloadFile({ tbMy.downloadFile({
url: url, url: url,
...@@ -176,10 +177,10 @@ export class Tools { ...@@ -176,10 +177,10 @@ export class Tools {
tbMy.getFileSystemManager().readFile({ tbMy.getFileSystemManager().readFile({
filePath: i, filePath: i,
// encoding: "utf8", // encoding: "utf8",
success: function (r) { success: function(r) {
}, },
fail: function (res) { fail: function(res) {
} }
}) })
...@@ -323,11 +324,11 @@ export class Tools { ...@@ -323,11 +324,11 @@ export class Tools {
showTime: number = 300 showTime: number = 300
) { ) {
Tween.get(target) Tween.get(target)
.set({ alpha: 0, visible: true }) .set({alpha: 0, visible: true})
.to({ alpha: 1 }, showTime, Ease.quadIn) .to({alpha: 1}, showTime, Ease.quadIn)
.wait(time) .wait(time)
.to({ alpha: 0 }, showTime, Ease.quadOut) .to({alpha: 0}, showTime, Ease.quadOut)
.set({ alpha: 0, visible: false }) .set({alpha: 0, visible: false})
.call(() => { .call(() => {
call(); call();
}); });
......
...@@ -46,17 +46,22 @@ export class FailedPanel extends Panel { ...@@ -46,17 +46,22 @@ export class FailedPanel extends Panel {
} }
public hidePanel() { public hidePanel() {
changeScene(MapScene, {level: this.data.level + 1}); changeScene(MapScene);
super.hidePanel();
}
public again() {
changeScene(MapScene, {level: this.data.level});
super.hidePanel(); super.hidePanel();
} }
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.againBtn.addEventListener(MouseEvent.CLICK, this.hidePanel, this); this.againBtn.addEventListener(MouseEvent.CLICK, this.again, this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
this.againBtn.removeEventListener(MouseEvent.CLICK, this.hidePanel, this); this.againBtn.removeEventListener(MouseEvent.CLICK, this.again, this);
} }
} }
...@@ -9,6 +9,8 @@ import FrameAni = FYGE.FrameAni; ...@@ -9,6 +9,8 @@ import FrameAni = FYGE.FrameAni;
import Texture = FYGE.Texture; import Texture = FYGE.Texture;
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import { changeScene } from "../../module/ctrls";
import { MapScene } from "../scene/map/MapScene";
export class SuccessNoPrizePanel extends Panel { export class SuccessNoPrizePanel extends Panel {
get groupNames() { get groupNames() {
...@@ -49,6 +51,8 @@ export class SuccessNoPrizePanel extends Panel { ...@@ -49,6 +51,8 @@ export class SuccessNoPrizePanel extends Panel {
this.checkTex.textAlign = TEXT_ALIGN.CENTER; this.checkTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex.textAlign = TEXT_ALIGN.CENTER; this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex.textWidth = 750;
this.tipsTex.x = 0;
this.starGroup = this.addChild(new SuccessStarGroup()); this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 680); this.starGroup.position.set(373, 680);
...@@ -57,18 +61,50 @@ export class SuccessNoPrizePanel extends Panel { ...@@ -57,18 +61,50 @@ export class SuccessNoPrizePanel extends Panel {
this.starGroup.play(this.data.stars); this.starGroup.play(this.data.stars);
if (this.data.stars >= 3) { if (this.data.stars >= 3) { // 达到三星
this.againBtn.visible = false; this.againBtn.visible = false;
this.continueBtn.visible = false; this.continueBtn.visible = false;
} else { } else { // 未达到三星
this.totalContinueBtn.visible = false; this.totalContinueBtn.visible = false;
} }
if (MapScene.checkArr && MapScene.checkArr[this.data.level] && MapScene.checkArr[this.data.level].sendAwardType) {
// 到过三星,领过奖
const curLevel: number = Tools.gameData.currentLevel;
let upLevel: number = 120;
let dLevel: number = 120;
Tools.baseInfo.prizeLevels.forEach((value, index) => {
const d: number = value - curLevel;
if (curLevel <= value && d >= 0 && d <= dLevel) {
upLevel = value;
if (curLevel == this.data.level) {
dLevel = d + 1;
} else {
dLevel = d;
}
}
});
this.tipsTex.text = ` 太厉害了!\n再解锁${dLevel}关可以开红包了`;
this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex.textWidth = 750;
this.tipsTex.x = 0;
} else {
// 没到三星,没领过奖
if (this.data.isPrizeLevel) {
this.tipsTex.text = '闯关成功!挑战满星通关\n获得抽大奖机会!';
} else {
this.tipsTex.text = '闯关成功!挑战满星通关\n有概率获得随机道具一个';
}
}
} }
private lightEffect() { private lightEffect() {
Tween.get(this.light1, {loop: true}) Tween.get(this.light1, {loop: true})
.set({anchorX: 219.5, anchorY: 219.5}) .set({anchorX: 219.5, anchorY: 219.5})
.to({rotation: 360}, 12000); .to({rotation: 360}, 12000);
Tween.get(this.light2, {loop: true}) Tween.get(this.light2, {loop: true})
.set({anchorX: 219.5, anchorY: 219.5}) .set({anchorX: 219.5, anchorY: 219.5})
.to({rotation: -360}, 12000); .to({rotation: -360}, 12000);
...@@ -89,14 +125,21 @@ export class SuccessNoPrizePanel extends Panel { ...@@ -89,14 +125,21 @@ export class SuccessNoPrizePanel extends Panel {
* 挑战满星 * 挑战满星
*/ */
private again() { private again() {
changeScene(MapScene, {level: this.data.level});
super.hidePanel();
} }
/** /**
* 继续闯关 * 继续闯关
*/ */
private continue() { private continue() {
changeScene(MapScene, {level: this.data.level + 1});
super.hidePanel();
}
public hidePanel() {
changeScene(MapScene);
super.hidePanel();
} }
removeEvents() { removeEvents() {
......
...@@ -4,6 +4,9 @@ import { SuccessStarGroup } from "./SuccessNoPrizePanel"; ...@@ -4,6 +4,9 @@ import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite; import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import Container = FYGE.Container;
import { PropType } from "../something/enum/PropType";
export class SuccessPrizePanel extends Panel { export class SuccessPrizePanel extends Panel {
get groupNames() { get groupNames() {
...@@ -32,6 +35,8 @@ export class SuccessPrizePanel extends Panel { ...@@ -32,6 +35,8 @@ export class SuccessPrizePanel extends Panel {
againBtn: FYGE.Button; againBtn: FYGE.Button;
noPrizeAgainBtn: FYGE.Button; noPrizeAgainBtn: FYGE.Button;
goPrizeBtn: FYGE.Button; goPrizeBtn: FYGE.Button;
prizeImg: Sprite;
prop: Container;
light1: Sprite; light1: Sprite;
light2: Sprite; light2: Sprite;
...@@ -48,9 +53,36 @@ export class SuccessPrizePanel extends Panel { ...@@ -48,9 +53,36 @@ export class SuccessPrizePanel extends Panel {
this.starGroup = this.addChild(new SuccessStarGroup()); this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 678); this.starGroup.position.set(373, 678);
this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 375;
this.lightEffect(); this.lightEffect();
this.starGroup.play(4); this.starGroup.play(this.data.stars);
if (this.data.tool) {
this.againBtn.visible = false;
this.goPrizeBtn.visible = false;
this.prizeImg.visible = false;
switch (this.data.tool.type) {
case PropType.BOOMS:
// boomBtn
break;
case PropType.HAMMERS:
// hammerBtn
break;
case PropType.STEPS:
// stepBtn
break;
}
} else if (this.data.prize) {
this.noPrizeAgainBtn.visible = false;
this.prop.visible = false;
this.prizeImg.texture = Texture.fromUrl(this.data.prize.image);
}
} }
private lightEffect() { private lightEffect() {
......
...@@ -28,16 +28,18 @@ export default class CheckBtn extends Container { ...@@ -28,16 +28,18 @@ export default class CheckBtn extends Container {
stars: number, stars: number,
isPrizeLevel: boolean, isPrizeLevel: boolean,
isVisitSuccess: boolean isVisitSuccess: boolean
isPlayed: boolean isPlayed: boolean,
} = { } = {
level: 1, level: 1,
scores: 0, scores: 0,
stars: 0, stars: 0,
isPrizeLevel: false, isPrizeLevel: false,
isVisitSuccess: false, isVisitSuccess: false,
isPlayed: false isPlayed: false,
}; };
private _sendAwardType: any;
private btn: Button = null; private btn: Button = null;
private checkLabel: TextField = null; private checkLabel: TextField = null;
...@@ -59,6 +61,12 @@ export default class CheckBtn extends Container { ...@@ -59,6 +61,12 @@ export default class CheckBtn extends Container {
this.checkData = data; this.checkData = data;
this.checkData.isPlayed = true; this.checkData.isPlayed = true;
this._sendAwardType = data.sendAwardType;
}
public get sendAwardType() {
return this._sendAwardType;
} }
private _starCount = 0; private _starCount = 0;
...@@ -75,6 +83,10 @@ export default class CheckBtn extends Container { ...@@ -75,6 +83,10 @@ export default class CheckBtn extends Container {
}); });
} }
public get starCount(): number {
return this._starCount;
}
private _enabled: boolean = true; private _enabled: boolean = true;
public set enabled(enabled: boolean) { public set enabled(enabled: boolean) {
if (this._enabled == enabled) return; if (this._enabled == enabled) return;
...@@ -190,16 +202,17 @@ export default class CheckBtn extends Container { ...@@ -190,16 +202,17 @@ export default class CheckBtn extends Container {
this.enabled = false; // 先设置成关闭 this.enabled = false; // 先设置成关闭
// 点击事件 // 点击事件
this.btn.addEventListener(MouseEvent.CLICK, () => { this.btn.addEventListener(MouseEvent.CLICK, this.clickStart, this);
}
public clickStart() {
console.log(`关卡:${this.checkNum}`); console.log(`关卡:${this.checkNum}`);
console.log(this.checkData); console.log(this.checkData);
this._isPrize this._isPrize
? showPanel(StartPanelPrize, this.checkData) ? showPanel(StartPanelPrize, this.checkData)
: showPanel(StartPanel, this.checkData); : showPanel(StartPanel, this.checkData);
}, this);
} }
} }
/** /**
......
...@@ -152,10 +152,12 @@ export class MapScene extends Scene { ...@@ -152,10 +152,12 @@ export class MapScene extends Scene {
MapScene.checkArr[v.level].isPrize = true; MapScene.checkArr[v.level].isPrize = true;
}); });
this.scrollToCheck(this.data.level if (this.data && this.data.level) {
? this.data.level this.scrollToCheck(this.data.level);
: currentLevel MapScene.checkArr[this.data.level].clickStart();
); } else {
this.scrollToCheck(currentLevel);
}
} }
public initMap() { public initMap() {
...@@ -208,13 +210,19 @@ export class MapScene extends Scene { ...@@ -208,13 +210,19 @@ export class MapScene extends Scene {
public start(data?: any) { public start(data?: any) {
super.start(data); super.start(data);
// Tools.gameOver({ Tools.gameOver({
// level: 1, level: 1,
// score: 666, score: 666,
// stars: 0, stars: 3,
// isVisitSuccess: false, isVisitSuccess: true,
// isPrizeLevel: false, isPrizeLevel: true,
// }); tool: {
type: 'STEPS',
},
// prize: {
// image: 'https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png',
// }
});
} }
public initEvents() { public initEvents() {
......
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