Commit a69ebbe6 authored by zjz1994's avatar zjz1994

调整大炮资源

parent eafaa47d
......@@ -1057,8 +1057,6 @@ export default class MainScene extends Scene {
this.soundBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_soundBtnn, this)
this.musicBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_musicBtn, this)
this.quitBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_quitBtn, this)
}
removeEvents() {
......
......@@ -45,7 +45,8 @@ export class Element extends eui.Component {
fishCanEliFlag: boolean;
cannoMoveClip:any;
cannoStat:number[] = [1,121,181,241,361];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
setFishNebFlag() {
if (this._fishState > 0) {
......@@ -200,10 +201,10 @@ export class Element extends eui.Component {
this._cannoDir = cannodir;
this.resetCannoStat();
this.showImage.x = 0;
this.showImage.y = 0;
this.showImage.anchorOffsetX = this.showImage.width / 2;
this.showImage.anchorOffsetY = this.showImage.height / 2;
// this.showImage.x = 0;
// this.showImage.y = 0;
// this.showImage.anchorOffsetX = this.showImage.width / 2;
// this.showImage.anchorOffsetY = this.showImage.height / 2;
var roaidx:number;
if(cannodir==forwardDirection.left){
roaidx = 0;
......@@ -214,7 +215,7 @@ export class Element extends eui.Component {
}else if(cannodir==forwardDirection.down){
roaidx = 3;
}
this.showImage.rotation = [-90,0,90,180][roaidx];
this.cannobox.rotation = [-90,0,90,180][roaidx];
}
changeShowCannoStat(){
this.cannolab.text = this._cannoStat+"";
......@@ -441,6 +442,7 @@ export class Element extends eui.Component {
this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
this.cannolab.visible = false;
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
......@@ -485,10 +487,35 @@ export class Element extends eui.Component {
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(){
console.log("炮台充能",this.cannoMoveClip.currentFrame);
}
/**
* 炮台动画播放一次完毕
*/
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