Commit d5821064 authored by wjf's avatar wjf

1

parent 3a9c0c89
This diff is collapsed.
This diff is collapsed.
......@@ -9,6 +9,6 @@ var endPath = './released/';
fs.writeFileSync(endPath + "output.js",
'import * as FYGE from "fyge-tbmini";\n' +
'import * as SvgaParser from "svga-parser";\n' +
// 'import * as SvgaParser from "svga-parser";\n' +
fs.readFileSync("./output.js"));
console.log("js生成")
This diff is collapsed.
......@@ -17,7 +17,9 @@ export class CreditsOutPanel extends Panel {
super.initEvents();
this.earnBtn.addEventListener(FYGE.MouseEvent.CLICK, () => {
Tools.btnDelay(this);
sendTbNet(TbNetName.navigateToOutside, { url: "" })//TODO 赚积分路径待写
sendTbNet(TbNetName.navigateToOutside, {
url: "https://market.m.taobao.com/app/tb-source-app/shopact/pages/index?wh_weex=true&pathInfo=shop/activity&userId=2275046294&shopId=114637892&pageId=187145736&alisite=true"
})//赚积分路径
}, this)
}
removeEvents() {
......
This diff is collapsed.
......@@ -189,13 +189,10 @@ export class PlayScene extends Scene {
*/
connectState: number = 2;
//皮肤上的 //注意都需要重写
public settingGroup: FYGE.Container;
public settingbg: FYGE.Sprite;
public soundBtn: FYGE.Sprite;
public musicBtn: FYGE.Sprite;
public questionBtn: FYGE.Sprite;
public quitBtn: FYGE.Sprite;
public settingBtn: FYGE.Button;
public settingBtn: SettingBtn;
/**
* 分数为目标时的文案
*/
targetScoreTxt: FYGE.BitmapText;
/**
* 剩余步数
......@@ -268,8 +265,9 @@ export class PlayScene extends Scene {
//通关目标分数
this.targetScoreTxt = this.addChild(new FYGE.BitmapText(commonTextArr));
this.targetScoreTxt.position.set(375, 193);
//设置,待定
this.addChild(FYGE.Sprite.fromFrame("settingBtn.png")).position.set(618, 16)
//设置
this.settingBtn = this.addChild(new SettingBtn())
this.settingBtn.position.set(618, 16)
}
data: { chapter: number }
start(data: { chapter: number }) {
......@@ -298,7 +296,7 @@ export class PlayScene extends Scene {
//重置基础元素类型及特效
this.initBaseElement();
//设置栏置顶
this.addChild(this["settingAll"])
// this.addChild(this.settingBtn)
//先判断是否添加节日元素,如果加节日元素,就按initFestivalEle里的来
if (!this.initFestivalEle()) {
//检查一次三消
......@@ -322,6 +320,12 @@ export class PlayScene extends Scene {
this.initSvgas();
//AiControl初始化,
AiControl.ins.init(this.lattices);
//测试波纹
// let fun = ()=>{
// RectsWaveAni(this.lattices,this.map,fun);
// }
// fun()
}
/**
......@@ -782,22 +786,10 @@ export class PlayScene extends Scene {
//侦听事件
initEvents() {
this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
// this.settingBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onTap_settingBtn, this)
// this.questionBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onTap_questionBtn, this)
// this.soundBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onTap_soundBtnn, this)
// this.musicBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onTap_musicBtn, this)
// this.quitBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onTap_quitBtn, this)
}
removeEvents() {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
// this.settingBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onTap_settingBtn, this);
// this.questionBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onTap_questionBtn, this)
// this.soundBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onTap_soundBtnn, this)
// this.musicBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onTap_musicBtn, this)
// this.quitBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onTap_quitBtn, this)
this.propBtnCon.boomBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onTap_boomBtn, this)
this.propBtnCon.hammerBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onTap_hammerBtn, this)
......@@ -1850,7 +1842,10 @@ export class PlayScene extends Scene {
this.addChild(movieClips.bonusTime);
movieClips.bonusTime.play(1, () => {
this.removeChild(movieClips.bonusTime)
this.terminateSteps();
//来个波纹
RectsWaveAni(this.lattices, this.map, () => {
this.terminateSteps();
})
})
return
}
......@@ -2661,7 +2656,6 @@ export class PlayScene extends Scene {
ani.y = p[1];
ani.play();
if (name == RecoverName.MAGICLION_ANI) {
console.log(this.getChildIndex(this.map))
//具体索引还要改
// console.log()
this.addChildAt(ani, this.getChildIndex(this.map) + 1);
......@@ -2868,3 +2862,38 @@ export class PlayScene extends Scene {
// }
// return currentTarget
// }
class SettingBtn extends FYGE.Container {
constructor() {
super()
//背景
var bg = this.addChild(new FYGE.Sprite(RES.getRes("settingBg.png")))
bg.position.set(6, 50)
bg.visible = false;
//音乐
var musicBtn = this.addChild(new class extends FYGE.Sprite {
private isOn: boolean;
constructor() {
var t = RES.getRes("musicOn.png")
super(t)
this.addEventListener(FYGE.MouseEvent.CLICK, () => {
this.isOn = !this.isOn;
this.texture = RES.getRes(this.isOn ? "musicOn.png" : "musicOff.png");
//播放或暂停音乐接口
}, this);
}
});
musicBtn.position.set(11, 97);
musicBtn.visible = false;
//主按钮
var btn = this.addChild(new FYGE.Button(RES.getRes("settingBtn.png")))
.addEventListener(FYGE.MouseEvent.CLICK, () => {
console.log(9999)
musicBtn.visible = !musicBtn.visible
bg.visible = !bg.visible
}, this)
console.log(btn)
}
}
\ No newline at end of file
......@@ -23,6 +23,7 @@ export function drawBg(paths: PathData[], lattices?: number[]) {
// }
}
}
bg.updateShape()//只有这样之后bounds才是正确的,注意引擎有时间修改
//缓存掉
var bounds = bg.getLocalBounds();
let w: number = bounds.width;
......
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