Commit 1eb5c963 authored by wildfirecode's avatar wildfirecode

Merge branch 'hotfix20200330_' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into hotfix20200330_

parents ace8917c f8f6bc52
...@@ -1057,8 +1057,6 @@ export default class MainScene extends Scene { ...@@ -1057,8 +1057,6 @@ export default class MainScene extends Scene {
this.soundBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_soundBtnn, this) this.soundBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_soundBtnn, this)
this.musicBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_musicBtn, this) this.musicBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_musicBtn, this)
this.quitBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_quitBtn, this) this.quitBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_quitBtn, this)
} }
removeEvents() { removeEvents() {
......
...@@ -45,6 +45,7 @@ export class Element extends eui.Component { ...@@ -45,6 +45,7 @@ export class Element extends eui.Component {
fishCanEliFlag: boolean; fishCanEliFlag: boolean;
cannoMoveClip:any; cannoMoveClip:any;
cannoStat:number[] = [1,61,121,181,241,361];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。 //尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
setFishNebFlag() { setFishNebFlag() {
...@@ -200,10 +201,10 @@ export class Element extends eui.Component { ...@@ -200,10 +201,10 @@ export class Element extends eui.Component {
this._cannoDir = cannodir; this._cannoDir = cannodir;
this.resetCannoStat(); this.resetCannoStat();
this.showImage.x = 0; // this.showImage.x = 0;
this.showImage.y = 0; // this.showImage.y = 0;
this.showImage.anchorOffsetX = this.showImage.width / 2; // this.showImage.anchorOffsetX = this.showImage.width / 2;
this.showImage.anchorOffsetY = this.showImage.height / 2; // this.showImage.anchorOffsetY = this.showImage.height / 2;
var roaidx:number; var roaidx:number;
if(cannodir==forwardDirection.left){ if(cannodir==forwardDirection.left){
roaidx = 0; roaidx = 0;
...@@ -214,10 +215,11 @@ export class Element extends eui.Component { ...@@ -214,10 +215,11 @@ export class Element extends eui.Component {
}else if(cannodir==forwardDirection.down){ }else if(cannodir==forwardDirection.down){
roaidx = 3; roaidx = 3;
} }
this.showImage.rotation = [-90,0,90,180][roaidx]; this.cannobox.rotation = [-90,0,90,180][roaidx];
} }
changeShowCannoStat(){ changeShowCannoStat(){
this.cannolab.text = this._cannoStat+""; this.cannolab.text = this._cannoStat+"";
this.cannoMoveClip.gotoAndPlay(this.cannoStat[this._cannoStat]);
} }
checkCannoStat(){ checkCannoStat(){
if(this._cannoStat==3){ if(this._cannoStat==3){
...@@ -441,6 +443,7 @@ export class Element extends eui.Component { ...@@ -441,6 +443,7 @@ export class Element extends eui.Component {
this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO; this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO; this.showImage.visible = type != ElementType.CANNO;
this.cannolab.visible = false;
//鸡蛋 //鸡蛋
if (type == ElementType.CHICKEN_EGG) { if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG) this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
...@@ -485,10 +488,39 @@ export class Element extends eui.Component { ...@@ -485,10 +488,39 @@ export class Element extends eui.Component {
console.log("paotai",this.cannoMoveClip); console.log("paotai",this.cannoMoveClip);
//1空,121,181,241,361
// this.cannoMoveClip.gotoAndStop(1);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(180);
this.cannoMoveClip.addEventListener(egret.Event.ENTER_FRAME,this.listenCn,this);
this.cannoMoveClip.addEventListener(egret.Event.COMPLETE,this.playComplete,this);
}); });
} }
} }
// curframeidx:number = 1;
// testChangeMoveClip(num:number){
// this.curframeidx += num;
// this.cannoMoveClip.gotoAndStop(this.curframeidx);
// }
/**
* 炮台充能
* @param source
*/
listenCn(){
var statend = this.cannoStat[this._cannoStat+1];
if(this.cannoMoveClip.currentFrame>=statend){
console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame);
this.cannoMoveClip.stop();
}
}
/**
* 炮台动画播放一次完毕
*/
playComplete(){
this.cannoMoveClip.stop();
}
/** /**
* 替换资源时,同时修改 * 替换资源时,同时修改
......
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