Commit dd9d6742 authored by haiyoucuv's avatar haiyoucuv

Success Panel Effect!

parent f2b1003a
This diff is collapsed.
......@@ -4,7 +4,7 @@
"message": "OK",
"data": {
"power": 100,
"currentLevel": 120,
"currentLevel": 96,
"tools": {
"STEPS": 1,
"BOOMS": 2,
......
......@@ -73,7 +73,7 @@
"name": "fiveVerHorDis"
},
{
"keys": "bg_loading_back.jpg",
"keys": "img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.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,proDown.png,wheel.png",
"name": "loadingScene"
},
{
......
......@@ -73,7 +73,7 @@ export const ResJson = {
"name": "fiveVerHorDis"
},
{
"keys": "bg_loading_back.jpg",
"keys": "img_line1.png,img_line2.png,img_line3.png,img_line4.png,img_line5.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,proDown.png,wheel.png",
"name": "loadingScene"
},
{
......
......@@ -9,6 +9,28 @@ export const SkinJson = {
"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,
......@@ -55,7 +77,7 @@ export const SkinJson = {
{
"name": "关卡文字",
"x": 300,
"y": 521,
"y": 501,
"alpha": 1,
"type": "text",
"props": {
......@@ -100,6 +122,28 @@ export const SkinJson = {
"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,
......@@ -146,7 +190,7 @@ export const SkinJson = {
{
"name": "关卡文字",
"x": 300,
"y": 521,
"y": 501,
"alpha": 1,
"type": "text",
"props": {
......
......@@ -11,7 +11,7 @@ import { RES } from "../../module/RES";
export class SuccessNoPrizePanel extends Panel {
get groupNames() {
return ["SuccessPanel", 'starLight']
return ['SuccessPanel', 'starLight']
}
get skinName() {
......@@ -36,6 +36,8 @@ export class SuccessNoPrizePanel extends Panel {
againBtn: FYGE.Button;
continueBtn: FYGE.Button;
totalContinueBtn: FYGE.Button;
light1: Sprite;
light2: Sprite;
private starGroup: SuccessStarGroup = null;
......@@ -49,9 +51,20 @@ export class SuccessNoPrizePanel extends Panel {
this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 680);
this.lightEffect();
this.starGroup.play(3);
}
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);
}
start(data) {
super.start();
}
......
......@@ -3,10 +3,11 @@ import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
export class SuccessPrizePanel extends Panel {
get groupNames() {
return ["SuccessPanel", 'starLight']
return ['SuccessPanel', 'starLight']
}
get skinName() {
......@@ -31,6 +32,8 @@ export class SuccessPrizePanel extends Panel {
againBtn: FYGE.Button;
noPrizeAgainBtn: FYGE.Button;
goPrizeBtn: FYGE.Button;
light1: Sprite;
light2: Sprite;
private starGroup: SuccessStarGroup = null;
......@@ -44,9 +47,20 @@ export class SuccessPrizePanel extends Panel {
this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 678);
this.lightEffect();
this.starGroup.play(4);
}
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);
}
start(data) {
super.start();
}
......
......@@ -241,7 +241,7 @@ class CheckCurEffect extends Container {
this.light1.anchorTexture.set(0.5, 0.5);
this.light2.anchorTexture.set(0.5, 0.5);
this.position.set(53, 50);
this.position.set(55, 50);
this.mouseEnable = this.mouseChildren = false;
}
......
......@@ -20,11 +20,19 @@ export default class MapPart extends Container {
}
protected initIcon() {
this.data.forEach((value, index) => {
// 坑爹的头像,所以倒着加,可以解决层级问题
for (let i = this.data.length - 1; i >= 0; i--) {
const value = this.data[i];
const nBtn = this.addChild(new CheckBtn(value));
nBtn.position.set(this.btnPos[index][0], this.btnPos[index][1]);
nBtn.position.set(this.btnPos[i][0], this.btnPos[i][1]);
MapScene.checkArr[value.check] = nBtn;
});
}
// this.data.forEach((value, index) => {
// const nBtn = this.addChild(new CheckBtn(value));
//
// nBtn.position.set(this.btnPos[index][0], this.btnPos[index][1]);
// MapScene.checkArr[value.check] = nBtn;
// });
}
}
......@@ -5,7 +5,6 @@ import MapUI from "./MapUI";
import MapMid from "./MapMid";
import CheckBtn, { CHECK_TYPE } from "./CheckBtn";
import { layers } from "../../../module/views/layers";
import { sendTbNet, TbNetName } from "../../TaoBaoNet";
import ScrollPage = FYGE.ScrollPage;
import Container = FYGE.Container;
import { Tools } from "../../Tools";
......@@ -50,18 +49,25 @@ export class MapScene extends Scene {
this.initMap();
this.updateMapCheck();
showPanel(SuccessPrizePanel);
showPanel(SuccessNoPrizePanel)
}
private updateMapCheck() {
sendTbNet(TbNetName.getIndex, {},
(success, res) => {
if (!success) return;
if (this.data.from == 'loading') {
this.initMapByData(Tools.gameData);
} else {
Tools.getIndex().then((success) => {
if (success) {
this.initMapByData(Tools.gameData);
}
});
}
}
this.uiLayer.energyBox.count = res.data.power;
private initMapByData(data) {
this.uiLayer.energyBox.count = data.power;
const currentLevel = res.data.currentLevel;
const currentLevel = data.currentLevel;
// 已经通关的
for (let i = 1; i < currentLevel; i++) {
......@@ -85,19 +91,16 @@ export class MapScene extends Scene {
}
// 闯关记录里有的
res.data.visitors.forEach((v) => {
data.visitors.forEach((v) => {
MapScene.checkArr[v.level].data = v;
});
// 奖励关卡
res.data.prizes.forEach((v) => {
data.prizes.forEach((v) => {
MapScene.checkArr[v.level].isPrize = true;
});
this.scrollToCheck(currentLevel);
}
);
}
public initMap() {
......
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