Commit 8783010d authored by zjz1994's avatar zjz1994

Merge branch 'hotfix20200330_' of http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole into 新增炮台

parents ff43736c c6af1c52
......@@ -411,8 +411,12 @@ export default class MainScene extends Scene {
var svgas = ["amazing", "great", "wonderful", "bonusTime"];
//如果有节日的加
if (this.festivalTarget) svgas.push("redBombLight");
svgas.push(...["canno","cannofire","cannolight","cannoparticle"]);//新增大炮的动画
for (let i = 0; i < svgas.length; i++) {
if (movieClips[svgas[i]]) continue;
let mvname = svgas[i];
svgaParser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem);
mv.lockStep = true;
......@@ -424,7 +428,7 @@ export default class MainScene extends Scene {
let fun;
mv.addEventListener(egret.Event.COMPLETE, fun = function (e) {
e.target.stop()
if (e.target.parent) {
if (e.target.parent&&mvname!="canno") {
e.target.parent.removeChild(e.target)
}
}, this)
......
......@@ -35,11 +35,17 @@ import { Fish } from "./Fish";
* 坐标原点需要坐落在格子的中心点
* 最好到时按,底图,动效,气泡,笼子,毛球,进行分层,如果多个状态要共存时,必须分层,到时气泡的动画,要写再自己的层里
*/
//加载器
let svgaParser;
export class Element extends eui.Component {
private _fishState = 0;
private _isNeb: boolean;//是否
get isNeb() { return this._isNeb }
fishCanEliFlag: boolean;
cannoMoveClip:any;
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
setFishNebFlag() {
if (this._fishState > 0) {
......@@ -421,7 +427,9 @@ export class Element extends eui.Component {
this.cannolab.x = 0;
this.cannolab.y = 0;
this.addChild(this.cannolab);
this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
......@@ -443,6 +451,26 @@ export class Element extends eui.Component {
}
this.addChild(this.festivalEle)
}
this.createCanno();
}
//添加炮台
createCanno(){
if(this.type==ElementType.CANNO){
if(this.cannoMoveClip){
return;
}
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
svgaParser.load(resPath + 'resource/assets/svgas/canno.svga', (videoItem) => {
this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem);
this.cannoMoveClip.lockStep = true;
this.cannoMoveClip.x = 0;
this.cannoMoveClip.y = 0;
console.log("paotai",this.cannoMoveClip);
});
}
}
/**
......@@ -484,6 +512,8 @@ export class Element extends eui.Component {
//类型重置,showImage修改
this._type = type;
this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
this.changeSource("ele" + type + "_png");
//特效重置
......
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