Commit 7b360eab authored by zjz1994's avatar zjz1994

动效暂存

parent e5f98ab7
......@@ -2424,12 +2424,22 @@ export default class MainScene extends Scene {
}
}
}
setTimeout(()=>{
this.eliminate();
canno.fireCanno();
// setTimeout(()=>{
// this.eliminate();
this.readyCannoArr.shift();
canno.resetCannoStat();
},200);
// this.readyCannoArr.shift();
// canno.resetCannoStat();
// },200);
}
/**
* 炮台发射完毕,开始炮台消除
*/
callBackFireCanno(canno:Element){
this.eliminate();
this.readyCannoArr.shift();
canno.resetCannoStat();
}
checkAllBlock() {
// this.lattices.filter(item => item.block).forEach((item) => {
......
......@@ -6,92 +6,59 @@ import { ElementType } from "../enum/ElementType";
export const Chapters22: ChapterData[] = [
//551
{
baseElementTypes: [0, 1, 2, 3, 4],
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
stepCount: 35,
stepCount: 25,
passTarget: {
type: 1,
elements: [{
type: 1,
count: 155
}, {
type: 34,
count: 15
}]
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 45,
},
],
},
starScores: [15000, 20000, 25000],
starScores: [1000, 5000, 10000],
map: {
lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 0, 1, 0, 1, 4, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 1, 1, 1, 1, 0, 1
],
connectedLats: [],
conveyor: [
[9, 63],
[17, 71]
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
conveyorConnectedLats: [
[63, 9],
[71, 17]
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements: [
1, 19, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 1, 1, 20, 1,
1, 1, 1, 2, 2, 2, 1, 1, 1,
1, 6, 1, 1, 1, 1, 1, 6, 1,
1, 1, 1, 1, 16, 1, 1, 1, 1,
1, 1, 1, 1, 16, 1, 1, 1, 1,
1, 22, 1, 1, 16, 1, 1, 1, 1,
5, 6, 1, 1, 2, 1, 1, 6, 5,
1, 1, 1, 2, 2, 2, 1, 1, 1
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
1, 1, 19, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 20, 0, 0, 0, 20, 0, 0,
0, 20, 10, 20, 0, 20, 10, 20, 0,
20, 10, 20, 10, 20, 10, 20, 10, 20,
20, 10, 20, 20, 10, 20, 20, 10, 20,
0, 20, 10, 20, 10, 20, 10, 20, 0,
0, 0, 20, 10, 20, 10, 20, 0, 0,
0, 0, 0, 20, 10, 20, 0, 0, 0,
0, 0, 0, 0, 20, 0, 0, 0, 0,
],
recycles: [],
generateLats: [{
index: 0,
type: null
}, {
index: 1,
type: null
}, {
index: 2,
type: null
}, {
index: 3,
type: null
}, {
index: 4,
type: null
}, {
index: 5,
type: null
}, {
index: 6,
type: null
}, {
index: 7,
type: null
}, {
index: 8,
type: null
}]
}
// recycles: [70, 71, 72, 73]
},
}
]
......@@ -45,6 +45,7 @@ export class Element extends eui.Component {
fishCanEliFlag: boolean;
cannoMoveClip:any;
cannoCnClip:any;
cannoStat:number[] = [1,61,121,181,241,361];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
......@@ -219,14 +220,44 @@ export class Element extends eui.Component {
}
changeShowCannoStat(){
this.cannolab.text = this._cannoStat+"";
this.cannoMoveClip&&this.cannoMoveClip.gotoAndPlay(this.cannoStat[this._cannoStat]);
this.changeMvPlay(this._cannoStat);
}
changeMvPlay(_stat:number){
if(this.cannoMoveClip){
var endframe:number;
var curframe:number = this.cannoMoveClip.currentFrame;
this.cannoMoveClip.gotoAndPlay(curframe,true);
if(_stat==0){
endframe = 1;
}else if(_stat==1){
endframe = 121;
}else if(_stat==2){
endframe = 181;
}else if(_stat==3){
endframe = 241;
}else if(_stat==4){
endframe = 361;
}
// this.changeShowCanno(curframe,endframe);
this.stopFrame = endframe;
}
}
/**
* 炮台能否发射
*/
checkCannoStat(){
if(this._cannoStat==3){
return true;
}
return false;
}
/**
* 炮台发射
*/
fireCanno(){
this.changeMvPlay(4);
}
resetCannoStat(){
this._cannoStat = 0;
this.changeShowCannoStat();
......@@ -235,6 +266,8 @@ export class Element extends eui.Component {
this._cannoStat += 1;
if(this._cannoStat>3){
this._cannoStat = 3;
}else{//充能动画
this.cannoCnClip.gotoAndPlay(1,true);
}
this.changeShowCannoStat();
}
......@@ -442,8 +475,9 @@ export class Element extends eui.Component {
this.addChild(this.cannolab);
this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
this.cannolab.visible = false;
this.touchEnabled = this.showImage.visible = type != ElementType.CANNO;
// this.cannolab.visible = false;
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
......@@ -477,51 +511,58 @@ export class Element extends eui.Component {
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;
var mvwidth = 102;
var mvheight = 116;
this.cannoMoveClip.x = (this.cannoboxwid-mvwidth)/2;
this.cannoMoveClip.y = 0;
this.cannobox.addChild(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);
});
var svgas = ["canno","cannofire","cannoparticle","cannolight"];
for(let i=0;i<svgas.length;i++){
let mvname = svgas[i];
svgaParser.load(resPath + 'resource/assets/svgas/'+mvname+'.svga',(videoItem)=>{
if(mvname=="canno"){
this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem);
this.cannoMoveClip.lockStep = true;
var mvwidth = 102;
var mvheight = 116;
this.cannoMoveClip.x = (this.cannoboxwid-mvwidth)/2;
this.cannoMoveClip.y = 0;
this.cannobox.addChild(this.cannoMoveClip);
this.cannoMoveClip.gotoAndStop(1);
this.cannoMoveClip.addEventListener(egret.Event.ENTER_FRAME,this.toFrameAni,this);
}else if(mvname=="cannolight"){
this.cannoCnClip = new window["SVGA"].EgretMovieClip(videoItem);
this.cannoCnClip.lockStep = true;
var mvwidth = 400;
var mvheight = 400;
this.cannoCnClip.x = (this.cannoboxwid-mvwidth)/2;
this.cannoCnClip.y = (this.cannoboxhei-mvheight)/2;
this.cannobox.addChild(this.cannoCnClip);
this.cannoCnClip.gotoAndStop(1);
this.cannoCnClip.addEventListener(egret.Event.COMPLETE,this.addOnePower,this);
console.log("光圈cannocnClip",this.cannoCnClip);
}else if(mvname=="cannoparticle"){
}
});
}
}
}
// curframeidx:number = 1;
// testChangeMoveClip(num:number){
// this.curframeidx += num;
// this.cannoMoveClip.gotoAndStop(this.curframeidx);
// }
stopFrame:number;
/**
* 炮台充能
* @param source
* 炮台动画停止
*/
listenCn(){
var statend = this.cannoStat[this._cannoStat+1];
if(this.cannoMoveClip.currentFrame>=statend){
// console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame);
this.cannoMoveClip.stop();
toFrameAni(){
var curframe = this.cannoMoveClip.currentFrame;
if(curframe>=this.stopFrame){
this.cannoMoveClip.gotoAndStop(this.stopFrame);
if(this.stopFrame==361){
console.log("炮台发射完毕");
}
}
}
/**
* 炮台动画播放一次完毕
* 光圈充能动画
*/
playComplete(){
this.cannoMoveClip.stop();
addOnePower(){
console.log("一次光圈充能");
this.cannoCnClip.gotoAndStop(1);
}
/**
* 替换资源时,同时修改
* @param source
......@@ -560,9 +601,9 @@ export class Element extends eui.Component {
egret.Tween.removeTweens(this.showImage);
//类型重置,showImage修改
this._type = type;
this.cannolab.visible = type == ElementType.CANNO;
this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
// this.cannolab.visible = false;
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