Commit 8422ba1b authored by haiyoucuv's avatar haiyoucuv

换了点皮,换了下接口

parent a995fc3a
This diff is collapsed.
......@@ -5,7 +5,7 @@
"data": {
"rule": "测试活动规则测试活动规则测试活动规则测试活动规则测试活动规则测试活动规则测试",
"currentLevel": 120,
"power": 100,
"power": 0,
"tools": {
"steps": 100,
"booms": 100,
......
{
"groups": [
{
"keys": "增加体力背景.png,无字按钮底.png",
"name": "BuyPowerPanel"
},
{
"keys": "积分不足背景.png,赚取积分.png",
"name": "CreditsOutPanel"
},
{
"keys": "兑换成功背景.png,知道啦.png",
"name": "ExchangeSucPanel"
},
{
"keys": "失败Bg.png,失败重新闯关.png",
"name": "FailedPanel"
......@@ -28,42 +16,26 @@
"keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel"
},
{
"keys": "noPrizeBg.png,知道了.png",
"name": "NoPrizePanel"
},
{
"keys": "步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png",
"name": "NoStepPanel"
},
{
"keys": "prizePanel.png,prizePanelBtn.png",
"name": "PrizePanel"
},
{
"keys": "活动规则背景.png",
"name": "RulePanel"
},
{
"keys": "开始闯关Bg.png",
"name": "StartPanel"
},
{
"keys": "关卡弹窗Bg.png",
"name": "StartPanelPrize"
},
{
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,查看奖品.png,继续闯关红.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"name": "SuccessPanel"
},
{
"keys": "任务背景.png,去完成.png,去完成灰.png,待领取.png",
"name": "TaskPanel"
},
{
"keys": "道具不足背景.png",
"name": "ToolsOutPanel"
},
{
"keys": "使用道具背景.png",
"name": "UseToolPanel"
......
export const ResJson = {
"groups": [
{
"keys": "增加体力背景.png,无字按钮底.png",
"name": "BuyPowerPanel"
},
{
"keys": "积分不足背景.png,赚取积分.png",
"name": "CreditsOutPanel"
},
{
"keys": "兑换成功背景.png,知道啦.png",
"name": "ExchangeSucPanel"
},
{
"keys": "失败Bg.png,失败重新闯关.png",
"name": "FailedPanel"
......@@ -28,42 +16,26 @@ export const ResJson = {
"keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel"
},
{
"keys": "noPrizeBg.png,知道了.png",
"name": "NoPrizePanel"
},
{
"keys": "步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png",
"name": "NoStepPanel"
},
{
"keys": "prizePanel.png,prizePanelBtn.png",
"name": "PrizePanel"
},
{
"keys": "活动规则背景.png",
"name": "RulePanel"
},
{
"keys": "开始闯关Bg.png",
"name": "StartPanel"
},
{
"keys": "关卡弹窗Bg.png",
"name": "StartPanelPrize"
},
{
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,查看奖品.png,继续闯关红.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
"name": "SuccessPanel"
},
{
"keys": "任务背景.png,去完成.png,去完成灰.png,待领取.png",
"name": "TaskPanel"
},
{
"keys": "道具不足背景.png",
"name": "ToolsOutPanel"
},
{
"keys": "使用道具背景.png",
"name": "UseToolPanel"
......
......@@ -87,46 +87,13 @@ export const SkinJson = {
{
"name": "闯关成功",
"x": 53,
"y": 190,
"y": 209,
"alpha": 1,
"type": "sprite",
"props": {
"source": "闯关成功.png"
}
},
{
"name": "继续闯关大",
"x": 163,
"y": 1109,
"alpha": 1,
"type": "button",
"props": {
"tUp": "继续闯关大.png"
},
"id": "noPrizeAgainBtn"
},
{
"name": "继续闯关小",
"x": 93,
"y": 1109,
"alpha": 1,
"type": "button",
"props": {
"tUp": "继续闯关小.png"
},
"id": "againBtn"
},
{
"name": "去抽奖",
"x": 383,
"y": 1109,
"alpha": 1,
"type": "button",
"props": {
"tUp": "去抽奖.png"
},
"id": "goPrizeBtn"
},
{
"name": "提示文案",
"x": 182,
......@@ -137,7 +104,6 @@ export const SkinJson = {
"text": "太厉害了!获得抽奖资格!",
"size": 34,
"fillColor": "#df5942",
"textAlpha": 1,
"bold": true
},
"id": "tipsTex"
......@@ -145,7 +111,7 @@ export const SkinJson = {
{
"name": "红包奖励",
"x": 130,
"y": 850,
"y": 862,
"alpha": 1,
"type": "sprite",
"props": {
......@@ -153,10 +119,24 @@ export const SkinJson = {
},
"id": "prizeImg"
},
{
"name": "提示文案",
"x": 182,
"y": 1095,
"alpha": 1,
"type": "text",
"props": {
"text": "奖品可以在“我的奖品”页面查看",
"size": 24,
"fillColor": "#df5942",
"bold": true
},
"id": "tipsTex2"
},
{
"name": "关闭按钮",
"x": 631,
"y": 421,
"x": 625,
"y": 431,
"alpha": 1,
"type": "button",
"props": {
......
......@@ -2,14 +2,12 @@ import { RES } from "../module/RES";
import { layers } from "../module/views/layers";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import { sendTbNet, TbNetName, getTbData } from "./TaoBaoNet";
import { sendTbNet, TbNetName } from "./TaoBaoNet";
import { PropType } from "./something/enum/PropType";
import { showToast } from "../module/ctrls";
import { showPanel } from "../module/ctrls";
import { FailedPanel } from "./panels/FailedPanel";
import { SuccessPrizePanel } from "./panels/SuccessPrizePanel";
import { SuccessNoPrizePanel } from "./panels/SuccessNoPrizePanel";
import { CreditsOutPanel } from "./panels/CreditsOutPanel";
/**
* 定制,记录一些全局量和方法
......@@ -117,12 +115,10 @@ 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 == 120 && (!data.prize || !data.prize.image)) {
data.prize = data.prize || {};
data.prize.image = Tools.baseInfo.levelPrize['level_120'];
}
} else if (
(data.prize && data.prize.image)
|| (data.tool && data.tool.type)
) { // 闯关成功,奖励关卡
showPanel(SuccessPrizePanel, data);
} else { // 闯关成功,不是奖励关卡
showPanel(SuccessNoPrizePanel, data);
......
import { Panel } from "../../module/views/Panel";
import MouseEvent = FYGE.MouseEvent;
import { showPanel } from "../../module/ctrls";
import { TaskPanel } from "./TaskPanel";
export class NoEnergyPanel extends Panel {
get groupNames() {
......@@ -25,6 +26,7 @@ export class NoEnergyPanel extends Panel {
initEvents() {
super.initEvents();
this.okBtn.addEventListener(MouseEvent.CLICK, () => {
showPanel(TaskPanel);
this.hidePanel();
}, this);
}
......
......@@ -78,8 +78,9 @@ export class StartPanelPrize extends Panel {
const {level, isPlayed} = this.data;
this.enableMouseEvt(false);
if (!isPlayed && Tools.propInfo.power <= 0) {// 体力不足
showPanel(NoEnergyPanel);
this.enableMouseEvt(true);
showPanel(NoEnergyPanel);
this.hidePanel();
return;
}
sendTbNet(TbNetName.dojoin, {level: level},
......@@ -87,9 +88,6 @@ export class StartPanelPrize extends Panel {
this.enableMouseEvt(true);
if (!success) return;
// 访问页面埋点
sendTbNet(TbNetName.reportAnalytics, {logkey: 'join'});
Tools.propInfo.power = res.data.power;
changeScene(PlayScene, {chapter: level});
this.hidePanel();
......
......@@ -4,12 +4,19 @@ import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import { PropType } from "../something/enum/PropType";
import { RES } from "../../module/RES";
import { changeScene } from "../../module/ctrls";
import { MapScene } from "../scene/map/MapScene";
import MouseEvent = FYGE.MouseEvent;
import Button = FYGE.Button;
import Texture = FYGE.Texture;
const propImg = {
[PropType.BOOMS]: 'boomBtn.png',
[PropType.HAMMERS]: 'hammerBtn.png',
[PropType.STEPS]: 'stepBtn.png'
}
export class SuccessPrizePanel extends Panel {
get groupNames() {
......@@ -34,57 +41,62 @@ export class SuccessPrizePanel extends Panel {
closeBtn: FYGE.Button;
tipsTex: FYGE.TextField;
againBtn: FYGE.Button;
noPrizeAgainBtn: FYGE.Button;
goPrizeBtn: FYGE.Button;
tipsTex2: FYGE.TextField;
prizeImg: Sprite;
private starGroup: SuccessStarGroup = null;
initUi() {
const {level, stars, tool, prize} = this.data;
this.tipsTex.textWidth = 750;
this.tipsTex.x = 0;
this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex2.textWidth = 750;
this.tipsTex2.x = 0;
this.tipsTex2.textAlign = TEXT_ALIGN.CENTER;
this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(375, 648);
this.starGroup.position.set(375, 663);
this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 375;
this.starGroup.play(this.data.stars);
if (this.data.tool && this.data.tool.type) {
this.againBtn.visible = false;
this.goPrizeBtn.visible = false;
this.tipsTex.text = '闯关成功!获得奖励:';
this.prizeImg.scale.set(1.4, 1.4);
switch (this.data.tool.type) {
case PropType.BOOMS:
this.prizeImg.texture = RES.getRes('boomBtn.png');
break;
case PropType.HAMMERS:
this.prizeImg.texture = RES.getRes('hammerBtn.png');
break;
case PropType.STEPS:
this.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"))
this.starGroup.play(stars);
if (tool && tool.type) {
this.tipsTex.text = '\t闯关成功!获得奖励:';
this.prizeImg.scale.set(1.8, 1.8);
this.prizeImg.texture = RES.getRes(propImg[tool.type]);
if (stars == 3) {
this.tipsTex2.visible = false;
this.prizeImg.y = 879;
this.addChild(new Button(RES.getRes('继续闯关大.png')))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(163, 1109);
} else {
this.noPrizeAgainBtn.visible = false;
this.tipsTex2.text = '满星通关可抽取更大奖励哦';
this.addChild(new Button(RES.getRes('继续闯关小.png')))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(388, 1145);
this.addChild(new Button(RES.getRes('闯关成功不满星按钮.png')))
.addEventListener(MouseEvent.CLICK, this.again, this)
.position.set(100, 1145);
}
} else if (prize && prize.image) {
this.prizeImg.texture = Texture.fromUrl(prize.image);
this.tipsTex2.text = '奖品可以在“我的奖品”页面查看';
this.addChild(new Button(RES.getRes('继续闯关红.png')))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(388, 1145);
this.prizeImg.texture = Texture.fromUrl(this.data.prize.image);
// this.tipsTex.text = '\t\t闯关成功!获得抽大奖机会!';
this.tipsTex.text = '\t闯关成功!有机会抽取如下奖品';
this.addChild(new Button(RES.getRes('查看奖品.png')))
.addEventListener(MouseEvent.CLICK, this.lookPrize, this)
.position.set(100, 1145);
}
}
......@@ -92,6 +104,16 @@ export class SuccessPrizePanel extends Panel {
super.start();
}
/**
* 查看奖品
*/
private lookPrize() {
/// TODO 查看奖品
console.log('查看奖品');
changeScene(MapScene);
super.hidePanel();
}
/**
* 挑战满星
*/
......@@ -112,13 +134,6 @@ export class SuccessPrizePanel extends Panel {
super.hidePanel();
}
public goPrize() {
// 去抽奖
super.hidePanel();
}
public hidePanel() {
changeScene(MapScene);
super.hidePanel();
......@@ -126,9 +141,6 @@ export class SuccessPrizePanel extends Panel {
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() {
......
......@@ -223,7 +223,7 @@ export class MapScene extends Scene {
// Tools.gameOver({
// level: 1,
// score: 666,
// stars: 3,
// stars: 2,
// isVisitSuccess: true,
// isPrizeLevel: false,
// // tool: {
......
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