Commit fad806bf authored by wjf's avatar wjf

l

parent 303e94ae
{
"code": "530001",
"data": {
"power": 1231,
"tools": {
"STEPS": 3,
"BOOMS": 4,
"HAMMERS": 5
},
"isvip": false,
"url": "//market.m.taobao.com/apps/market/shopmember/index.html?wh_weex=true&sellerId=2207623078795&extraInfo=%7B%22source%22%3A%22isvapp%22%2C%22entrance%22%3A%22duiba%22%7D"
},
"success": false,
"success": true,
"message": "需要成为会员"
}
\ No newline at end of file
{
"success": false,
"success": true,
"message": "您还不是会员",
"data": {
"isvip": false,
......
{
"groups": [
{
"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"
},
{
......@@ -37,7 +37,11 @@
"name": "FreePowerPanel"
},
{
"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": "joinBg.png,joinBtn.png",
"name": "JoinPanel"
},
{
"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"
},
{
......@@ -73,8 +77,8 @@
"name": "playScene"
},
{
"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"
"keys": "活动规则背景.png",
"name": "RulePanel"
},
{
"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",
......
This diff is collapsed.
import { removeTweens } from "../module/ctrls";
import { RES } from "../module/RES";
interface LottieData {
"fr": number,//珍露 30 60等
......@@ -12,7 +13,8 @@ interface LottieData {
interface LayerData {
"ind": number,//id唯一
"ty": number,//类型,暂时只有2
"nm": "owl_sleep.png",//暂时就是图片
"nm": string//"owl_sleep.png",//暂时就是图片
"refId": string,
"parent"?: number,//父级id
"ks": KsData;
"ip": number,//开始帧
......@@ -109,7 +111,7 @@ export class Lottie extends FYGE.Container {
let layer = layers[i];
if (!layer.parent) {
let c = this.addChild(new FYGE.Container())
c.addChild(FYGE.Sprite.fromFrame(layer.nm));
c.addChild(new FYGE.Sprite(RES.getRes(layer.nm) || RES.getRes(layer.refId + ".png")));
c.name = layer.nm;
//记录一下数据
c["layerData"] = layer;
......@@ -123,8 +125,8 @@ export class Lottie extends FYGE.Container {
while (layers.length) {
for (var j = layers.length - 1; j >= 0; j--) {
let layer = layers[j];
if (hash[layer.parent]) {
let c = hash[layer.parent].addChild(FYGE.Sprite.fromFrame(layer.nm));
if (hash[layer.parent]) {//这种方式有问题,谁先添加有bug
let c = hash[layer.parent].addChildAt(new FYGE.Sprite(RES.getRes(layer.nm) || RES.getRes(layer.refId + ".png")), layer["td"] || 999);
c.name = layer.nm;
//记录一下数据
c["layerData"] = layer;
......@@ -144,9 +146,9 @@ export class Lottie extends FYGE.Container {
//取第一个数据
let data: LayerData = c["layerData"];
//@ts-ignore 透明度
c.alpha = data.ks.o.k[0] ? data.ks.o.k[0].s[0] : data.ks.o.k / 100;
c.alpha = data.ks.o.k[0] ? data.ks.o.k[0].s[0]/100 : data.ks.o.k / 100;
//@ts-ignore 选转
c.rotation = data.ks.r.k[0] ? data.ks.r.k[0].s[0] : data.ks.r.k / 100;
c.rotation = data.ks.r.k[0] ? data.ks.r.k[0].s[0] : data.ks.r.k;
//锚点,用贴图锚点
var ad = typeof data.ks.a.k[0] == "number" ? data.ks.a.k : data.ks.a.k[0].s;
c.anchor.set(ad[0], ad[1])
......@@ -216,7 +218,7 @@ export class Lottie extends FYGE.Container {
obj = { rotation: d.s[0] }
break;
case "o":
obj = { alpha: d.s[0] }
obj = { alpha: d.s[0]/100 }
break;
case "s":
obj = { scaleX: d.s[0] / 100, scaleY: d.s[1] / 100 }
......@@ -241,7 +243,7 @@ export class Lottie extends FYGE.Container {
if (dis["layerData"].ks[type].x) {
var xs = dis["layerData"].ks[type].x;
if (xs.indexOf("loopOut") >= 0) {
//如果是往复的,
//如果是往复的,还有问题,没考虑第二个参数
if (xs.indexOf("pingpong") >= 0 && data[data.length - 1].t < this.rawData.op) {
var round = Math.round(this.rawData.op / data[data.length - 1].t)
var dir = false;
......@@ -262,10 +264,23 @@ export class Lottie extends FYGE.Container {
}
//如果是循环的,且没满一个循环的
else if (xs.indexOf("cycle") >= 0 && data[data.length - 1].t < this.rawData.op) {
//补满
for (var o = 0; o < objArr.length; o++) {
tween.to(objArr[o].obj, objArr[o].deltaTime);
//循环的是往后哪几帧
var rr = xs.replace(/[^0-9]/ig, "");
var num = Math.round((this.rawData.op - data[data.length - 1 - rr].t) / (data[data.length - 1].t - data[data.length - 1 - rr].t));
//objArr只有一部分是进行循环的。
objArr = objArr.slice(-(xs.replace(/[^0-9]/ig, "")))
if (dis["layerData"].nm == "bonus_light_11.png") { console.log(dis.alpha) }
while (--num) {
//补满
for (var o = 0; o < objArr.length; o++) {
tween.to(objArr[o].obj, objArr[o].deltaTime);
}
}
//补满
// for (var o = 0; o < objArr.length; o++) {
// tween.to(objArr[o].obj, objArr[o].deltaTime);
// }
}
}
}
......@@ -289,7 +304,7 @@ export class Lottie extends FYGE.Container {
})
}
destroy(){
destroy() {
removeTweens(this);
super.destroy();
}
......
......@@ -2,7 +2,7 @@
import { layers, destroyLayers } from "../module/views/layers";
import { RES } from "../module/RES";
import { changeScene, showWaiting, destroyAllCtrls } from "../module/ctrls";
import { changeScene, showWaiting, destroyAllCtrls, showPanel } from "../module/ctrls";
import { ResJson } from "./ResJson";
import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet";
......@@ -11,6 +11,7 @@ import { G_EVENT } from "./common/G_EVENT";
import { MapScene } from "./scene/map/MapScene";
import { PlayScene } from "./scene/PlayScene";
import { LoadingScene } from "./scene/LoadingScene";
import { JoinPanel } from "./panels/JoinPanel";
/**
* 全局事件,为了和小程序交互
......@@ -85,6 +86,7 @@ export class Main {
// changeScene(StoryScene);
// changeScene(AdoptScene);
// console.log("恶趣味去")
// showPanel(JoinPanel)
//测试
// sendTbNet(TbNetName.aaa, {}, (s, res) => {
// console.log(res)
......@@ -106,14 +108,13 @@ export class Main {
run() {
this._pause = false
//@ts-ignore Tween计时清零
FYGE.Tween._lastTime = null
// FYGE.Tween._lastTime = null //下面的_pause 不执行,先去掉,试试有没有问题
GDispatcher.dispatchEvent(G_EVENT.ON_SHOW);
}
//在小程序隐藏时调用onHide
pause() {
// this._pause = true;//先去掉吧
GDispatcher.dispatchEvent(G_EVENT.ON_HIDE);
}
......
export const ResJson = {
"groups": [
{
"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"
},
{
......@@ -37,7 +37,11 @@ export const ResJson = {
"name": "FreePowerPanel"
},
{
"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": "joinBg.png,joinBtn.png",
"name": "JoinPanel"
},
{
"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"
},
{
......@@ -73,8 +77,8 @@ export const ResJson = {
"name": "playScene"
},
{
"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"
"keys": "活动规则背景.png",
"name": "RulePanel"
},
{
"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",
......
......@@ -5,6 +5,7 @@ import DisplayObject = FYGE.DisplayObject;
import Ease = FYGE.Ease;
import { sendTbNet, TbNetName } from "./TaoBaoNet";
import { PropType } from "./something/enum/PropType";
import { showToast } from "../module/ctrls";
/**
* 定制,记录一些全局量和方法
......@@ -101,7 +102,7 @@ export class Tools {
*/
public static consumerTools(type: PropType): Promise<boolean> {
return new Promise((resolve, reject) => {
sendTbNet(TbNetName.consumerTools, {type}, (s, res) => {
sendTbNet(TbNetName.consumerTools, { type }, (s, res) => {
if (s) {
//修改道具数量
this.gameData.tools = res.data.tools;
......@@ -119,16 +120,17 @@ export class Tools {
*/
public static async exchange(type: PropType): Promise<boolean | string> {
//先获取积分,判断是否有积分
var creditsData = await sendTbNet(TbNetName.queryCredits)
var creditsData = await sendTbNet(TbNetName.queryCredits, null, null, true)
//接口失败,没数据时,返回false
if (!creditsData || !creditsData.data) {
showToast("网络异常,请重试")//上面禁掉了提示,这里提示下
return false
}
//非会员,返回会员路径
if (creditsData && !creditsData.success && !creditsData.data.isvip) {
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) {
//修改道具数量和体力
this.gameData.power = res.data.power;
......@@ -147,11 +149,11 @@ export class Tools {
var tbMy = my
if (!tbMy) return;
//@ts-ignore
const {cloud} = getApp();
const { cloud } = getApp();
//测试地址//到时云存储传一个小json,,改路径
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', '');
tbMy.downloadFile({
url: url,
......@@ -160,10 +162,10 @@ export class Tools {
tbMy.getFileSystemManager().readFile({
filePath: i,
// encoding: "utf8",
success: function(r) {
success: function (r) {
},
fail: function(res) {
fail: function (res) {
}
})
......@@ -307,11 +309,11 @@ export class Tools {
showTime: number = 300
) {
Tween.get(target)
.set({alpha: 0, visible: true})
.to({alpha: 1}, showTime, Ease.quadIn)
.set({ alpha: 0, visible: true })
.to({ alpha: 1 }, showTime, Ease.quadIn)
.wait(time)
.to({alpha: 0}, showTime, Ease.quadOut)
.set({alpha: 0, visible: false})
.to({ alpha: 0 }, showTime, Ease.quadOut)
.set({ alpha: 0, visible: false })
.call(() => {
call();
});
......
This diff is collapsed.
import { Panel } from "../../module/views/Panel";
import { RES } from "../../module/RES";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { wait } from "../../module/ctrls";
export class JoinPanel extends Panel {
get groupNames() {
return ["JoinPanel"]
}
data: { url: string }
initUi() {
this.addChild(FYGE.Sprite.fromFrame("joinBg.png"))
this.addChild(new FYGE.Button(RES.getRes("关闭按钮.png")))
.addEventListener(FYGE.MouseEvent.CLICK, () => { this.hidePanel(); }, this)
.position.set(634, 472)
this.addChild(new FYGE.Button(RES.getRes("joinBtn.png")))
.addEventListener(FYGE.MouseEvent.CLICK, () => {
this.enableMouseEvt(false);
wait(() => { this.enableMouseEvt(true) }, 2000)
sendTbNet(TbNetName.navigateToOutside, { url: this.data.url })
}, this)
.position.set(166, 744)
}
}
import { Panel } from "../../module/views/Panel";
import { PropType } from "../something/enum/PropType";
import { getTbData, TbNetName } from "../TaoBaoNet";
import { Tools } from "../Tools";
import { showWaiting, hideWaiting, getCurrentScene, showPanel, showToast } from "../../module/ctrls";
import { JoinPanel } from "./JoinPanel";
export class ToolsOutPanel extends Panel {
get groupNames() {
......@@ -9,24 +13,50 @@ export class ToolsOutPanel extends Panel {
get skinName() {
return "ToolsOutPanel"
}
get closeBtns() {
return [this.consideBtn, this.closeBtn]
}
consideBtn: FYGE.Button;
sureBtn: FYGE.Button;
closeBtn: FYGE.Button;
msgTxt: FYGE.TextField;
data:{type:PropType}
msgTxt: FYGE.TextField;
initUi() {
data: { type: PropType }
initUi() {
// 文案居中
Tools.changeTextAlign(this.msgTxt, FYGE.TEXT_ALIGN.CENTER, 500)
}
start(data) {
super.start();
//文案按接口返回的来
this.msgTxt.text = "要消耗" +
getTbData(TbNetName.getActivityBaseInfoById).data.buyCredits[data.type] +
"积分兑换吗?"
}
initEvents() {
super.initEvents();
this.sureBtn.addEventListener(FYGE.MouseEvent.CLICK, async () => {
//购买道具
showWaiting();
var res = await Tools.exchange(this.data.type);
hideWaiting();
//如果是链接,弹出加入会员弹框
if (typeof res == "string") {
showPanel(JoinPanel, { url: res })
}
//成功了,关闭弹框,修改道具信息
else if (res) {
showToast("兑换成功")
this.hidePanel();
getCurrentScene().updateScene()
}
}, this)
}
removeEvents() {
......
......@@ -23,6 +23,20 @@ export class LoadingScene extends Scene {
this.y = -layers.stageOffsetY
//背景
this.addChild(FYGE.Sprite.fromFrame("loadingBg.jpg"))
//光
var l1 = this.addChild(FYGE.Sprite.fromFrame("lighting_1.png"))
l1.position.set(543, 765)
var l2 = this.addChild(FYGE.Sprite.fromFrame("lighting_2.png"))
l2.position.set(545, 765)
l2.visible = false;
FYGE.Tween.get(l1, { loop: true })
.wait(500)
.call(() => { l1.visible = !l1.visible })
FYGE.Tween.get(l2, { loop: true })
.wait(500)
.call(() => { l2.visible = !l2.visible })
// console.log(a.position,b.position)
//摩天轮
var wheel = this.addChild(FYGE.Sprite.fromFrame("wheel.png"))
.addEventListener(FYGE.Event.ENTER_FRAME, () => {
......@@ -75,9 +89,6 @@ export class LoadingScene extends Scene {
(750 - 500) / 2,
1288 - 24 + 18 + 48
))
}
async start() {
......@@ -87,7 +98,7 @@ export class LoadingScene extends Scene {
GDispatcher.dispatchEvent(FYGE.Event.PROGRESS, 0.2)
//获取app数据
const {data} = await sendTbNet(TbNetName.getAppData);
const { data } = await sendTbNet(TbNetName.getAppData);
Tools.globalData = data;
GDispatcher.dispatchEvent(FYGE.Event.PROGRESS, 0.3)
//询问读取权限,不阻止进程
......@@ -129,7 +140,7 @@ export class LoadingScene extends Scene {
// private lastP=0
progressEvent(e: FYGE.Event) {
FYGE.Tween.get(this.progressBar, null, null, true)
.to({value: e.data}, 2000/**(p-this.lastP)*/)
.to({ value: e.data }, 2000/**(p-this.lastP)*/)
.call(() => {
if (e.data >= 1) {
GDispatcher.removeEventListener(FYGE.Event.PROGRESS, this.progressEvent, this);
......@@ -196,19 +207,19 @@ class Title extends FYGE.Container {
this.y = -560;//待调整
//新建就动画出现吧,
FYGE.Tween.get(this)
.to({y: targetY + 25}, 300)
.to({y: targetY - 30}, 100)
.to({y: targetY}, 100);
.to({ y: targetY + 25 }, 300)
.to({ y: targetY - 30 }, 100)
.to({ y: targetY }, 100);
[line, title].forEach((e) => {
FYGE.Tween.get(e)
.to({rotation: 1.5}, 300)
.to({rotation: -0.5}, 100)
.to({rotation: 0}, 100)
.to({ rotation: 1.5 }, 300)
.to({ rotation: -0.5 }, 100)
.to({ rotation: 0 }, 100)
if (e === line) {
FYGE.Tween.get(e)
.to({scaleY: 1.05}, 300)
.to({scaleY: 0.96}, 100)
.to({scaleY: 1}, 100)
.to({ scaleY: 1.05 }, 300)
.to({ scaleY: 0.96 }, 100)
.to({ scaleY: 1 }, 100)
}
})
......
......@@ -55,6 +55,8 @@ import { RES } from '../../module/RES';
import { showToast, showWaiting, showPanel, hideWaiting } from '../../module/ctrls';
import { layers } from '../../module/views/layers';
import { ToolsOutPanel } from '../panels/ToolsOutPanel';
import { Lottie } from '../Lottie';
import { bb } from '../bb';
const aniClass = {
"BoomAni": BoomAni,
......@@ -94,8 +96,13 @@ export const effectBaseTimes = {
}
//加载器
let svgaParser;
//三个toast和bonusTime
const movieClips: any = {}
//三个toast和bonusTime
const movieClips = {
wonderful: null,
amazing: null,
great: null,
bonusTime: null
}
//红包炸弹弹框名字
const redBombPanelName = "RedBombAlert";
......@@ -106,7 +113,7 @@ const festivalIndex: number = 40
export class PlayScene extends Scene {
get groupNames() {
return ["playScene", "fiveVerHorDis", "bonusTime"]
return ["playScene", "fiveVerHorDis"]
}
//关卡数据
......@@ -226,7 +233,7 @@ export class PlayScene extends Scene {
//步数道具引导时的圆
stepCircle: FYGE.Graphics//Shape;
//bonus Time 提示
bonusTime: BonusTime;
// bonusTime: BonusTime;
//游戏操作引导
gameGuide: GameGuide;
//记录是否有红包炸弹弹框
......@@ -314,34 +321,15 @@ export class PlayScene extends Scene {
* 加载所有用到的svga
* 重写,变成其他动画
*/
initSvgas() {
// var resPath = getResPath();
// if (!svgaParser) svgaParser = new window["SVGA"].Parser();
// var svgas = ["amazing", "great", "wonderful", "bonusTime"];
// //如果有节日的加
// if (this.festivalTarget) svgas.push("redBombLight");
// for (let i = 0; i < svgas.length; i++) {
// if (movieClips[svgas[i]]) continue;
// svgaParser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
// var mv = new window["SVGA"].EgretMovieClip(videoItem);
// mv.lockStep = true;
// if (svgas[i] != "bonusTime") {
// mv.x = (750 - 520) / 2;
// mv.y = 500;
// }
// mv.stop();
// let fun;
// mv.addEventListener(FYGE.Event.COMPLETE, fun = function (e) {
// e.currentTarget.stop()
// if (e.currentTarget.parent) {
// e.currentTarget.parent.removeChild(e.currentTarget)
// }
// }, this)
// movieClips[svgas[i]] = mv;
// }, function (error) {
// // alert(error.message);
// })
// }
async initSvgas() {
//这里加载资源吧
await RES.loadGroup("bonusTime")
var bonusTime = new Lottie(bb)
bonusTime.position.set(
(750 - bonusTime.videoWidth) / 2,
(1624 - bonusTime.videoHeight) / 2 - layers.stageOffsetY
)
movieClips.bonusTime = bonusTime;
}
//初始化界面ui,,道具弄在这里s
......@@ -398,9 +386,9 @@ export class PlayScene extends Scene {
this.propGuide = new PropGuide(this.propBtnCon.y - 10);
// this.addChild(this.propGuide);
//bonusTime引导,备用的,无需加入场景
this.bonusTime = new BonusTime();
this.bonusTime.x = 375
this.bonusTime.y = 1624 / 2 - layers.stageOffsetY;
// this.bonusTime = new BonusTime();
// this.bonusTime.x = 375
// this.bonusTime.y = 1624 / 2 - layers.stageOffsetY;
}
initTarget() {
......@@ -1835,9 +1823,9 @@ export class PlayScene extends Scene {
//连消基数为1
this.commonContinuityTimes = 1;
this.effectContinuityTimes = 1;
this.addChild(this.bonusTime);
this.bonusTime.play(1, () => {
this.removeChild(this.bonusTime)
this.addChild(movieClips.bonusTime);
movieClips.bonusTime.play(1, () => {
this.removeChild(movieClips.bonusTime)
this.terminateSteps();
})
return
......
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