Commit 22f3be3d authored by 邱旭's avatar 邱旭

m

parent 5c19b872
This diff is collapsed.
{
"code": "000000",
"data": {
"currentLevel": 11,
"isPrizeLevel": false,
"tool": {
"image": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png"
},
"isVisitSuccess": true,
"prize": {
"type": "HAMMERS",
"type": 6,
"toolType": "steps",
"name": "aaaaa",
"_id": "_id",
"image": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png"
}
},
......
......@@ -2,7 +2,8 @@
"code": "000000",
"data": {
"currentLevel": 99,
"topLevelVisitSuccess": false,
"topLevelVisitSuccess": true,
"isDrawTopLevelPrize": false,
"power": 10,
"tools": {
"steps": 10,
......
resource/SuccessPanel/star_en.png

16.9 KB | W: | H:

resource/SuccessPanel/star_en.png

23.4 KB | W: | H:

resource/SuccessPanel/star_en.png
resource/SuccessPanel/star_en.png
resource/SuccessPanel/star_en.png
resource/SuccessPanel/star_en.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -33,7 +33,7 @@
"name": "StartPanel"
},
{
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"keys": "star_en.png,sucAgain.png,sucContinueL.png,sucContinueS.png,sucContinueSR.png,sucGet.png,sucGoPrize.png,sucPrizeTip.png,sucPropTip.png,successBgL.png,successBgS.png",
"name": "SuccessPanel"
},
{
......@@ -91,10 +91,6 @@
{
"keys": "chapterNum0.png,chapterNum1.png,chapterNum2.png,chapterNum3.png,chapterNum4.png,chapterNum5.png,chapterNum6.png,chapterNum7.png,chapterNum8.png,chapterNum9.png,chapterNum关.png,chapterNum第.png,propNum0.png,propNum1.png,propNum2.png,propNum3.png,propNum4.png,propNum5.png,propNum6.png,propNum7.png,propNum8.png,propNum9.png,scoreNum0.png,scoreNum1.png,scoreNum2.png,scoreNum3.png,scoreNum4.png,scoreNum5.png,scoreNum6.png,scoreNum7.png,scoreNum8.png,scoreNum9.png,stepNum0.png,stepNum1.png,stepNum2.png,stepNum3.png,stepNum4.png,stepNum5.png,stepNum6.png,stepNum7.png,stepNum8.png,stepNum9.png",
"name": "playSceneNum"
},
{
"keys": "star_light_0.png,star_light_1.png,star_light_10.png,star_light_11.png,star_light_12.png,star_light_13.png,star_light_14.png,star_light_15.png,star_light_2.png,star_light_3.png,star_light_4.png,star_light_5.png,star_light_6.png,star_light_7.png,star_light_8.png,star_light_9.png",
"name": "starLight"
}
],
"path": "./resource/"
......
......@@ -33,7 +33,7 @@ export const ResJson = {
"name": "StartPanel"
},
{
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"keys": "star_en.png,sucAgain.png,sucContinueL.png,sucContinueS.png,sucContinueSR.png,sucGet.png,sucGoPrize.png,sucPrizeTip.png,sucPropTip.png,successBgL.png,successBgS.png",
"name": "SuccessPanel"
},
{
......@@ -91,10 +91,6 @@ export const ResJson = {
{
"keys": "chapterNum0.png,chapterNum1.png,chapterNum2.png,chapterNum3.png,chapterNum4.png,chapterNum5.png,chapterNum6.png,chapterNum7.png,chapterNum8.png,chapterNum9.png,chapterNum关.png,chapterNum第.png,propNum0.png,propNum1.png,propNum2.png,propNum3.png,propNum4.png,propNum5.png,propNum6.png,propNum7.png,propNum8.png,propNum9.png,scoreNum0.png,scoreNum1.png,scoreNum2.png,scoreNum3.png,scoreNum4.png,scoreNum5.png,scoreNum6.png,scoreNum7.png,scoreNum8.png,scoreNum9.png,stepNum0.png,stepNum1.png,stepNum2.png,stepNum3.png,stepNum4.png,stepNum5.png,stepNum6.png,stepNum7.png,stepNum8.png,stepNum9.png",
"name": "playSceneNum"
},
{
"keys": "star_light_0.png,star_light_1.png,star_light_10.png,star_light_11.png,star_light_12.png,star_light_13.png,star_light_14.png,star_light_15.png,star_light_2.png,star_light_3.png,star_light_4.png,star_light_5.png,star_light_6.png,star_light_7.png,star_light_8.png,star_light_9.png",
"name": "starLight"
}
],
"path": "./resource/"
......
......@@ -3,280 +3,6 @@ export const SkinJson = {
"y": 0,
"type": "container",
"children": [
{
"name": "SuccessNoPrizePanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "light1",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light1"
},
{
"name": "light2",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light2"
},
{
"name": "闯关成功Bg",
"x": 55,
"y": 266,
"type": "sprite",
"props": {
"source": "闯关成功Bg.png"
}
},
{
"name": "继续闯关大",
"x": 163,
"y": 935,
"type": "button",
"props": {
"tUp": "继续闯关大.png"
},
"id": "totalContinueBtn"
},
{
"name": "继续闯关小",
"x": 381,
"y": 935,
"type": "button",
"props": {
"tUp": "继续闯关小.png"
},
"id": "continueBtn"
},
{
"name": "闯关成功不满星按钮",
"x": 91,
"y": 935,
"type": "button",
"props": {
"tUp": "闯关成功不满星按钮.png"
},
"id": "againBtn"
},
{
"name": "关卡文字",
"x": 300,
"y": 501,
"type": "text",
"props": {
"text": "第 24 关",
"size": 40,
"fillColor": "#df5942",
"textAlpha": 1,
"bold": true
},
"id": "checkTex"
},
{
"name": "提示文案",
"x": 210,
"y": 815,
"type": "text",
"props": {
"text": "太厉害了!\n再闯6关就即可抽奖!",
"size": 36,
"fillColor": "#df5942",
"textAlpha": 1
},
"id": "tipsTex"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
}
]
},
{
"name": "SuccessPrizePanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "light1",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light1"
},
{
"name": "light2",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light2"
},
{
"name": "闯关成功",
"x": 55,
"y": 266,
"type": "sprite",
"props": {
"source": "闯关成功.png"
}
},
{
"name": "继续闯关大",
"x": 163,
"y": 1086,
"type": "button",
"props": {
"tUp": "继续闯关大.png"
},
"id": "noPrizeAgainBtn"
},
{
"name": "继续闯关小",
"x": 93,
"y": 1086,
"type": "button",
"props": {
"tUp": "继续闯关小.png"
},
"id": "againBtn"
},
{
"name": "去抽奖",
"x": 383,
"y": 1086,
"type": "button",
"props": {
"tUp": "去抽奖.png"
},
"id": "goPrizeBtn"
},
{
"name": "关卡文字",
"x": 300,
"y": 501,
"type": "text",
"props": {
"text": "第 24 关",
"size": 40,
"fillColor": "#df5942",
"textAlpha": 1,
"bold": true
},
"id": "checkTex"
},
{
"name": "提示文案",
"x": 182,
"y": 810,
"type": "text",
"props": {
"text": "太厉害了!获得抽奖资格!",
"size": 34,
"fillColor": "#df5942",
"textAlpha": 1
},
"id": "tipsTex"
},
{
"name": "红包奖励",
"x": 130,
"y": 870,
"type": "sprite",
"props": {
"source": ""
},
"id": "prizeImg"
},
{
"name": "道具",
"x": 124,
"y": 858,
"type": "container",
"children": [
{
"name": "bg",
"x": 0,
"y": 0,
"alpha": 1,
"type": "sprite",
"props": {
"source": "圆角矩形 648.png"
}
},
{
"name": "label",
"x": 265,
"y": 85,
"alpha": 1,
"type": "text",
"props": {
"text": "步数道具 x1",
"size": 30,
"fillColor": "#df5942",
"textAlpha": 1
}
},
{
"name": "img",
"x": 86,
"y": 45,
"alpha": 1,
"type": "sprite",
"props": {
"source": "道具.png"
}
},
{
"name": "quanquan",
"x": 76,
"y": 24,
"alpha": 1,
"type": "sprite",
"props": {
"source": "道具圆圈.png"
}
}
],
"id": "prop"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
}
]
},
{
"name": "RulePanel",
"x": 0,
......
......@@ -47,7 +47,8 @@ export class Tools {
prizeLevels: number[],
rule: string,
currentLevel: any,
topLevelVisitSuccess: string,
topLevelVisitSuccess: boolean,
isDrawTopLevelPrize: boolean,
power: number,
tools: {
steps: number,
......@@ -109,12 +110,7 @@ export class Tools {
public static gameOver(data) {
if (!data.isVisitSuccess) { // 闯关失败
showPanel(FailedPanel, data);
} else if ((data.prize && data.prize.image) || (data.tool && data.tool.type) || data.level == 120) { // 闯关成功,奖励关卡
//120关,如果没有奖品图片,伪造一个
if (data.level == 99 && (!data.prize || !data.prize.image)) {
data.prize = data.prize || {};
data.prize.image = Tools.gameData.levelPrize['level99'];
}
} else if (data.prize && data.prize.type != 5) { // 闯关成功,奖励关卡
showPanel(SuccessPrizePanel, data);
} else { // 闯关成功,不是奖励关卡
showPanel(SuccessNoPrizePanel, data);
......
This diff is collapsed.
import { Panel } from "../../module/views/Panel";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import Container = FYGE.Container;
import { PropType } from "../something/enum/PropType";
import { RES } from "../../module/RES";
import TextField = FYGE.TextField;
import { changeScene } from "../../module/ctrls";
import { MapScene } from "../scene/map/MapScene";
import MouseEvent = FYGE.MouseEvent;
import { LotteryScene } from "../scene/LotteryScene";
import { Tools } from "../Tools";
import { PropType } from "../something/enum/PropType";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import MouseEvent = FYGE.MouseEvent;
import Button = FYGE.Button;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
export class SuccessPrizePanel extends Panel {
get groupNames() {
return ['SuccessPanel', 'starLight']
}
get skinName() {
return "SuccessPrizePanel"
return ['SuccessPanel']
}
public showAni() {
......@@ -35,90 +30,66 @@ export class SuccessPrizePanel extends Panel {
});
}
closeBtn: FYGE.Button;
tipsTex: FYGE.TextField;
checkTex: FYGE.TextField;
againBtn: FYGE.Button;
noPrizeAgainBtn: FYGE.Button;
goPrizeBtn: FYGE.Button;
prizeImg: Sprite;
prop: Container;
light1: Sprite;
light2: Sprite;
private starGroup: SuccessStarGroup = null;
initUi() {
this.checkTex.text = `第\t${this.data.level}\t关`;
this.checkTex.textWidth = 750;
this.checkTex.x = 0;
this.checkTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex.textWidth = 750;
this.tipsTex.x = 0;
this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 678);
const { prize, level, isVisitSuccess, score, stars } = this.data;
const { name, _id, image, type, toolType } = prize;
this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 375;
this.addChild(Tools.getSprite("successBgL.png")).position.set(79, 345);
this.lightEffect();
const starGroup = this.addChild(new SuccessStarGroup());
starGroup.position.set(375, 600);
starGroup.play(stars);
this.starGroup.play(this.data.stars);
this.addChild(Tools.getText(
"闯关成功!获得奖励", 36, "#744f1d",
FYGE.TEXT_ALIGN.CENTER, 750, 0, 713
));
const propImg: Sprite = this.prop.getChildByName('img');
const propLabel: TextField = this.prop.getChildByName('label');
const prizeImg = this.addChild(new Sprite());
prizeImg.anchorTexture.set(0.5, 0.5);
prizeImg.position.set(375, 890);
if (this.data.tool && this.data.tool.type) {
this.againBtn.visible = false;
this.goPrizeBtn.visible = false;
this.prizeImg.visible = false;
this.tipsTex.text = '\t\t满星过关!';
switch (this.data.tool.type) {
if (type == 6) { // 道具
switch (toolType) {
case PropType.BOOMS:
propImg.texture = RES.getRes('boomBtn.png');
propImg.y += 5;
propImg.x += 15;
propLabel.text = '炸弹道具\tx1';
prizeImg.texture = RES.getRes('boomBtn.png');
break;
case PropType.HAMMERS:
propImg.texture = RES.getRes('hammerBtn.png');
propImg.x += 10;
propLabel.text = '锤子道具\tx1';
prizeImg.texture = RES.getRes('hammerBtn.png');
break;
case PropType.STEPS:
propImg.texture = RES.getRes('stepBtn.png');
propLabel.text = '步数道具\tx1';
prizeImg.texture = RES.getRes('stepBtn.png');
break;
}
} else if (this.data.prize && this.data.prize.image) {
if (this.data.level == 120) {//120关不显示闯关按钮,换图
this.againBtn.visible = false;
this.goPrizeBtn.visible = false;
this.noPrizeAgainBtn.changeTexture(RES.getRes("开奖按钮120.png"))
} else {
this.noPrizeAgainBtn.visible = false;
if (stars >= 3) { //三星
this.addChild(new Button(RES.getRes('sucContinueL.png')))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(190, 1050);
} else { // 不是三星
this.addChild(Tools.getSprite("sucPropTip.png")).position.set(142, 1010);
this.addChild(new Button(RES.getRes("sucAgain.png")))
.addEventListener(MouseEvent.CLICK, this.again, this)
.position.set(100, 1089);
this.addChild(new Button(RES.getRes("sucGet.png")))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(385, 1089);
}
this.prop.visible = false;
this.prizeImg.texture = Texture.fromUrl(this.data.prize.image);
// this.tipsTex.text = '\t\t闯关成功!获得抽大奖机会!';
this.tipsTex.text = '\t闯关成功!有机会抽取如下奖品';
} else { // 不是道具
prizeImg.texture = Texture.fromUrl(image);
this.addChild(Tools.getSprite("sucPrizeTip.png")).position.set(142, 1010);
this.addChild(new Button(RES.getRes("sucContinueS.png")))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(100, 1089);
this.addChild(new Button(RES.getRes("sucGet.png")))
.addEventListener(MouseEvent.CLICK, this.getPrize, this)
.position.set(385, 1089);
}
}
private lightEffect() {
Tween.get(this.light1, { loop: true })
.set({ anchorX: 219.5, anchorY: 219.5 })
.to({ rotation: 360 }, 12000);
Tween.get(this.light2, { loop: true })
.set({ anchorX: 219.5, anchorY: 219.5 })
.to({ rotation: -360 }, 12000);
this.addChild(new Button(RES.getRes('关闭按钮.png')))
.addEventListener(MouseEvent.CLICK, this.hidePanel, this)
.position.set(640, 460);
}
start(data) {
......@@ -137,7 +108,7 @@ export class SuccessPrizePanel extends Panel {
* 继续闯关
*/
private continue() {
if (this.data.level == 120) {
if (this.data.level == 99) {
changeScene(MapScene);
} else {
changeScene(MapScene, { level: this.data.level + 1 });
......@@ -152,20 +123,17 @@ export class SuccessPrizePanel extends Panel {
super.hidePanel();
}
/**
* 领奖
*/
public getPrize() {
/// TODO 领奖
}
public hidePanel() {
changeScene(MapScene);
super.hidePanel();
}
initEvents() {
super.initEvents();
this.againBtn.addEventListener(MouseEvent.CLICK, this.continue, this);
this.noPrizeAgainBtn.addEventListener(MouseEvent.CLICK, this.continue, this);
this.goPrizeBtn.addEventListener(MouseEvent.CLICK, this.goPrize, this);
}
removeEvents() {
super.removeEvents();
}
}
......@@ -42,8 +42,6 @@ export default class CheckBtn extends Container {
private star: CheckStar[] = null;
private curAni: Lottie = null;
private checkNum: number = null;
private _data: any = null;
......
......@@ -55,6 +55,7 @@ export class MapScene extends Scene {
if (this.data && this.data.from == 'loading') {
this.uiLayer = this.addChild(new MapUI());
this.initMapByData(Tools.gameData);
this.uiLayer.updateUI();
if (Tools.globalData.isNewUser) {
this.initGuide();
}
......@@ -63,6 +64,7 @@ export class MapScene extends Scene {
if (success) {//不考虑失败的情况
this.uiLayer = this.addChild(new MapUI());
this.initMapByData(Tools.gameData);
this.uiLayer.updateUI();
}
});
}
......@@ -117,7 +119,6 @@ export class MapScene extends Scene {
}
private initMapByData(data) {
this.uiLayer.energyBox.count = data.power;
const currentLevel = data.currentLevel;
......@@ -206,19 +207,13 @@ export class MapScene extends Scene {
public start(data?: any) {
super.start(data);
// Tools.gameOver({
// level: 1,
// score: 666,
// stars: 3,
// isVisitSuccess: true,
// isPrizeLevel: false,
// // tool: {
// // type: 'HAMMERS',
// // },
// prize: {
// image: 'https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png',
// }]
// });
Tools.gameOver({
"isVisitSuccess": true,
"prize": undefined,
"level": 99,
"score": 58940,
"stars": 3
});
}
public initEvents() {
......
......@@ -2,9 +2,9 @@ import Container = FYGE.Container;
import Button = FYGE.Button;
import TextField = FYGE.TextField;
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import MouseEvent = FYGE.MouseEvent;
import { RES } from "../../../module/RES";
import { Tools } from "../../Tools";
import MouseEvent = FYGE.MouseEvent;
import { showPanel } from "../../../module/ctrls";
import { RulePanel } from "../../panels/RulePanel";
import { sendTbNet, TbNetName } from "../../TaoBaoNet";
......@@ -15,6 +15,7 @@ export default class MapUI extends Container {
private myPrizeBtn: Button = null;
private ruleBtn: Button = null;
private taskBtn: Button = null;
private clearanceBtn: Button = null;
constructor() {
super();
......@@ -28,12 +29,14 @@ export default class MapUI extends Container {
this.ruleBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.myPrizeBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.taskBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.clearanceBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
}
private removeEvent() {
this.ruleBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.myPrizeBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.taskBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.clearanceBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
}
private clickBtn(e) {
......@@ -54,6 +57,11 @@ export default class MapUI extends Container {
case this.taskBtn:
Tools.openTask();
break;
case this.clearanceBtn:
/// TODO 打开通关抽奖
console.error("TODO 打开通关抽奖");
break;
}
}
......@@ -79,10 +87,15 @@ export default class MapUI extends Container {
this.energyBox = this.addChild(new EnergyBox({}));
this.clearanceBtn = this.addChild(new Button(RES.getRes('clearanceBtn.png')));
this.clearanceBtn.position.set(0, 387);
this.clearanceBtn.visible = false;
}
public updateUI() {
this.energyBox.count = Tools.gameData.power;
const { topLevelVisitSuccess, isDrawTopLevelPrize } = Tools.gameData;
this.clearanceBtn.visible = topLevelVisitSuccess && !isDrawTopLevelPrize;
}
}
......@@ -91,7 +104,6 @@ export default class MapUI extends Container {
*/
class EnergyBox extends Container {
private addBtn: Button = null;
private countLabel: TextField = null;
private _count = 0;
......
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