Commit 4bbae452 authored by 邱旭's avatar 邱旭

1

parents be52bb75 ffc786e9
This diff is collapsed.
......@@ -1249,4 +1249,19 @@ export class Tool {
console.error("未定义跑跳");
}
}
//炮台的旋转朝向
public static getCannoRoaByDir(cannodir:forwardDirection){
var roaidx:number;
if(cannodir==forwardDirection.left){
roaidx = 0;
}else if(cannodir==forwardDirection.up){
roaidx = 1;
}else if(cannodir==forwardDirection.right){
roaidx = 2;
}else if(cannodir==forwardDirection.down){
roaidx = 3;
}
var roanum = [-90,0,90,180][roaidx];
return roanum;
}
}
\ No newline at end of file
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//551-575
export const Chapters22: ChapterData[] = [
//1引导基本消除
{
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 45,
},
],
},
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, 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,
],
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements: [
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, 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, 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, 14, 11, 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: [70, 71, 72, 73]
},
}
]
......@@ -6,61 +6,58 @@ import { ElementType } from "../enum/ElementType";
export const Chapters22: ChapterData[] = [
//551
{
baseElementTypes: [0, 1, 2, 3, 4],
baseElementTypes: [0, 2, 3, 4, 1],
bubbleProbability: 0,
stepCount: 35,
passTarget: {
type: 1,
elements: [{
type: 1,
count: 155
type: 22,
count: 20
}, {
type: 34,
count: 15
type: 24,
count: 20
}, {
type: 26,
count: 20
}]
},
starScores: [15000, 20000, 25000],
map: {
lattices: [
1, 1, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 0, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 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, 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]
],
conveyorConnectedLats: [
[63, 9],
[71, 17]
1, 1, 1, 1, 1, 1, 1, 1, 1
],
connectedLats: [],
conveyor: [],
conveyorConnectedLats: [],
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
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 13, 22, 1, 22, 13, 1, 1,
1, 1, 22, 13, 1, 13, 22, 1, 1,
1, 1, 22, 22, 22, 22, 22, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 18, 18, 18, 18, 18, 1, 1
],
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, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 14, 11, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
],
recycles: [],
......@@ -71,25 +68,46 @@ export const Chapters22: ChapterData[] = [
index: 1,
type: null
}, {
index: 2,
index: 7,
type: null
}, {
index: 3,
index: 8,
type: null
}, {
index: 4,
index: 11,
type: null
}, {
index: 5,
index: 12,
type: null
}, {
index: 6,
index: 13,
type: null
}, {
index: 7,
index: 14,
type: null
}, {
index: 8,
index: 15,
type: null
}, {
index: 46,
type: null
}, {
index: 47,
type: null
}, {
index: 48,
type: null
}, {
index: 49,
type: null
}, {
index: 50,
type: null
}, {
index: 51,
type: null
}, {
index: 52,
type: null
}]
}
......
......@@ -30,6 +30,7 @@ import { Monster } from "./Monster";
import { State } from "./State";
import wait from "../../../libs/new_tc/wait";
import { Fish } from "./Fish";
import MainScene from "../../mainScene/MainScene";
/**
* 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点
......@@ -45,8 +46,17 @@ export class Element extends eui.Component {
fishCanEliFlag: boolean;
cannoMoveClip:any;
cannoStat:number[] = [1,61,121,181,241,361];
// cannoCnClip:any;
// cannoStat:number[] = [1,71,131,191,241,361];
/**
* 1--初始
* 71--一格能量
* 131--两格
* 191--三格
* 351--开始蓄力
* 441--开始发射,
* 481--结束
*/
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
setFishNebFlag() {
if (this._fishState > 0) {
......@@ -196,45 +206,78 @@ export class Element extends eui.Component {
}
_cannoDir:forwardDirection;
private _cannoStat:number = 0;
resetToCannoView(cannodir:forwardDirection){
_cannoStat:number = 0;
cannoAmnStat:number = 0;
mainScene:MainScene;
resetToCannoView(cannodir:forwardDirection,mainscene:MainScene){
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;
var roaidx:number;
if(cannodir==forwardDirection.left){
roaidx = 0;
}else if(cannodir==forwardDirection.up){
roaidx = 1;
}else if(cannodir==forwardDirection.right){
roaidx = 2;
}else if(cannodir==forwardDirection.down){
roaidx = 3;
}
this.cannobox.rotation = [-90,0,90,180][roaidx];
this.mainScene = mainscene;
var roanum = Tool.getCannoRoaByDir(cannodir);
this.cannobox.rotation = roanum;
}
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;
if(curframe>=351){
if(_stat==3||_stat==2){
return;
}
}
if(_stat==0){
curframe = 0;
endframe = 1;
}else if(_stat==1){
curframe = 61;
endframe = 71;
}else if(_stat==2){
curframe = 121
endframe = 131;
}else if(_stat==3){
curframe = 181;
endframe = 191;
}else if(_stat==4){
curframe = 351;
endframe = 481;
}
// console.log("ele播放大炮动画",curframe,endframe,_stat);
// this.cannoMoveClip.gotoAndPlay(curframe,true);
this.stopFrame = endframe;
this.cannoMoveClip.gotoAndPlay(curframe,1);
}
}
/**
* 炮台能否发射
*/
checkCannoStat(){
if(this._cannoStat==3){
return true;
}
return false;
}
/**
* 炮台发射
*/
fireCanno(){
// console.error("ele播放蓄力动画-----",this.index,this.cannoMoveClip.currentFrame);
this.changeMvPlay(4);
}
resetCannoStat(){
this._cannoStat = 0;
this.changeShowCannoStat();
this.changeMvPlay(this._cannoStat);
}
addOneCannoStat(){
this._cannoStat += 1;
if(this._cannoStat>3){
this._cannoStat = 3;
}else{//充能动画
// this.cannoCnClip.gotoAndPlay(1,true);
}
this.changeShowCannoStat();
}
......@@ -442,7 +485,8 @@ 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.touchEnabled = this.showImage.visible = type != ElementType.CANNO;
this.cannolab.visible = false;
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
......@@ -477,51 +521,51 @@ 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 = ["canno1"]//,"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=="canno1"){
this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem);
// this.cannoMoveClip.lockStep = true;
var mvwidth = 82;
var mvheight = 132;
this.cannoMoveClip.x = (this.cannoboxwid-mvwidth)/2;
this.cannoMoveClip.y = -mvheight/4;
this.cannobox.addChild(this.cannoMoveClip);
this.cannoMoveClip.gotoAndStop(1);
this.cannoMoveClip.addEventListener(egret.Event.ENTER_FRAME,this.toFrameAni,this);
}
});
}
}
}
// 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==441){//发射光柱
this.mainScene.selectPlayCannoFire(this.index);
}
if(curframe>=this.stopFrame){
if(this.stopFrame==481){
this.cannoMoveClip.gotoAndStop(1);
return;
// console.log("炮台发射完毕");
}
this.cannoMoveClip.gotoAndStop(this.stopFrame-1);
}
}
/**
* 炮台动画播放一次完毕
*/
playComplete(){
this.cannoMoveClip.stop();
}
// /**
// * 光圈充能动画,现放在mainscene
// */
// addOnePower(){
// console.log("一次光圈充能");
// this.cannoCnClip.gotoAndStop(1);
// }
/**
* 替换资源时,同时修改
* @param source
......@@ -560,9 +604,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