Commit e2f2dd58 authored by 邱旭's avatar 邱旭

1

parent 11a0fe50
......@@ -329,6 +329,7 @@ export default class MainBase extends eui.UILayer {
}
var arr = [
"rectLatWhite",
"redBombBStar","redBombYStar","redBombBSnow",
"fesRedBigLight", "fesRedBombSta1", "fesRedBombSta2", "fesRedCap", "fesRedDown", "fesRedSmallLight", "fesRedUp", "xingxingbi",
"tinyRedLeft", "tinyRedMid", "tinyRedRight",
"festivalTargetBg",
......
......@@ -97,7 +97,7 @@
"name": "h5"
},
{
"keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom18_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,eggPiece1_png,eggPiece2_png,eggPiece3_png,eggPiece4_png,eggPiece5_png,eggStatus0_png,eggStatus1_png,eggStatus2_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,ele9_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,greenCircleDown_png,greenCircleUp_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,jellyArrow_png,leftArrow_png,lightedStar_png,lineLight_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yellowCircleDown_png,yellowCircleUp_png,yezi1_png,bubbleStar19_png,bubleEle0_png,bubleEle1_png,bubleEle2_png,bubleEle3_png,bubleEle4_png,bubbleStar1_png,bubbleStar2_png,bubbleStar3_png,bubbleStar4_png,bubbleStar5_png,bubbleStar6_png,bubbleStar7_png,bubbleStar8_png,bubbleStar9_png,bubbleStar10_png,bubbleStar11_png,bubbleStar12_png,bubbleStar13_png,bubbleStar14_png,bubbleStar15_png,bubbleStar16_png,bubbleStar17_png,bubbleStar18_png,ele11_png,ele10_png,brownBallFace_png,eyeDownLeft_png,eyeSingle_png,greyBallFace_png,eyeDownRight_png,hairballPiece9_png,hairballPiece8_png,hairballPiece7_png,hairballPiece6_png,hairballPiece5_png,hairballPiece4_png,hairballPiece3_png,hairballPiece2_png,hairballPiece11_png,hairballPiece10_png,hairballPiece1_png,hairballDisBg_png,curScoreNum9_png,curScoreNum8_png,curScoreNum7_png,curScoreNum6_png,curScoreNum5_png,curScoreNum4_png,curScoreNum3_png,curScoreNum2_png,curScoreNum1_png,curScoreNum0_png,festivalTargetBg_png,lineLight9_png,lineLight8_png,lineLight7_png,lineLight6_png,lineLight5_png,lineLight4_png,lineLight3_png,lineLight2_png,lineLight13_png,lineLight12_png,lineLight11_png,lineLight10_png,lineLight1_png,fesRedUp_png,fesRedSmallLight_png,fesRedDown_png,fesRedCap_png,fesRedBombSta1_png,fesRedBigLight_png,fesEleSmallDis9_png,fesEleSmallDis8_png,fesEleSmallDis7_png,fesEleSmallDis6_png,fesEleSmallDis5_png,fesEleSmallDis4_png,fesEleSmallDis3_png,fesEleSmallDis2_png,fesEleSmallDis10_png,fesEleSmallDis1_png,ele12_png,ele13_png,xingxingbi_png,tinyRedMid_png,tinyRedLeft_png,tinyRedRight_png,rectLatWhite_png,fesRedBombSta2_png,ele14_png",
"keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom18_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,eggPiece1_png,eggPiece2_png,eggPiece3_png,eggPiece4_png,eggPiece5_png,eggStatus0_png,eggStatus1_png,eggStatus2_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,ele9_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,greenCircleDown_png,greenCircleUp_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,jellyArrow_png,leftArrow_png,lightedStar_png,lineLight_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yellowCircleDown_png,yellowCircleUp_png,yezi1_png,bubbleStar19_png,bubleEle0_png,bubleEle1_png,bubleEle2_png,bubleEle3_png,bubleEle4_png,bubbleStar1_png,bubbleStar2_png,bubbleStar3_png,bubbleStar4_png,bubbleStar5_png,bubbleStar6_png,bubbleStar7_png,bubbleStar8_png,bubbleStar9_png,bubbleStar10_png,bubbleStar11_png,bubbleStar12_png,bubbleStar13_png,bubbleStar14_png,bubbleStar15_png,bubbleStar16_png,bubbleStar17_png,bubbleStar18_png,ele11_png,ele10_png,brownBallFace_png,eyeDownLeft_png,eyeSingle_png,greyBallFace_png,eyeDownRight_png,hairballPiece9_png,hairballPiece8_png,hairballPiece7_png,hairballPiece6_png,hairballPiece5_png,hairballPiece4_png,hairballPiece3_png,hairballPiece2_png,hairballPiece11_png,hairballPiece10_png,hairballPiece1_png,hairballDisBg_png,curScoreNum9_png,curScoreNum8_png,curScoreNum7_png,curScoreNum6_png,curScoreNum5_png,curScoreNum4_png,curScoreNum3_png,curScoreNum2_png,curScoreNum1_png,curScoreNum0_png,festivalTargetBg_png,lineLight9_png,lineLight8_png,lineLight7_png,lineLight6_png,lineLight5_png,lineLight4_png,lineLight3_png,lineLight2_png,lineLight13_png,lineLight12_png,lineLight11_png,lineLight10_png,lineLight1_png,fesRedUp_png,fesRedSmallLight_png,fesRedDown_png,fesRedCap_png,fesRedBombSta1_png,fesRedBigLight_png,fesEleSmallDis9_png,fesEleSmallDis8_png,fesEleSmallDis7_png,fesEleSmallDis6_png,fesEleSmallDis5_png,fesEleSmallDis4_png,fesEleSmallDis3_png,fesEleSmallDis2_png,fesEleSmallDis10_png,fesEleSmallDis1_png,ele12_png,ele13_png,xingxingbi_png,tinyRedMid_png,tinyRedLeft_png,tinyRedRight_png,rectLatWhite_png,fesRedBombSta2_png,ele14_png,redBombYStar_png,redBombBStar_png,redBombBSnow_png",
"name": "main2"
},
{
......@@ -3856,6 +3856,21 @@
"url": "assets/redbombalert/redAlert_btn.png",
"type": "image",
"name": "redAlert_btn_png"
},
{
"url": "assets/mainScene/redBombBSnow.png",
"type": "image",
"name": "redBombBSnow_png"
},
{
"url": "assets/mainScene/redBombBStar.png",
"type": "image",
"name": "redBombBStar_png"
},
{
"url": "assets/mainScene/redBombYStar.png",
"type": "image",
"name": "redBombYStar_png"
}
]
}
\ No newline at end of file
......@@ -743,6 +743,7 @@ export default class MainScene extends Scene {
ele.y = p[1];
this.elementContainer.addChild(ele);
this.lattices[festivalIndex].element = ele;
Tool.removeEle(festivalIndex,this.emptys);
}
//动画,然后恢复this.enableMouseEvt(true);
let ani: FesRedBombShowAni = Pool.takeOut(RecoverName.FESREDBOMBSHOW_ANI)
......
......@@ -36,7 +36,7 @@ export default class Buy1Panel extends Panel {
ontap() {
NetManager.ins.clickLog(getlogItem(11));
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
NetManager.ins.hc_exchange((success, res) => {
this.buyBtn.enabled = true;
if(success) {
this.hidePanel();
......@@ -50,7 +50,11 @@ export default class Buy1Panel extends Panel {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
PanelCtrl.instance.show('shopTip', this.data);
if(res.code == '444444') {
showToast('操作太频繁,请稍后重试');
} else {
PanelCtrl.instance.show('shopTip', this.data);
}
}
}, PropType.HAMMER);//兑换道具
}
......
......@@ -32,7 +32,7 @@ export default class Buy2Panel extends Panel {
ontap() {
NetManager.ins.clickLog(getlogItem(8));
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
NetManager.ins.hc_exchange((success, res) => {
this.buyBtn.enabled = true;
if (success) {
if(SceneCtrl.instance.currentScene instanceof MainScene){
......@@ -45,7 +45,11 @@ export default class Buy2Panel extends Panel {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
}else{
PanelCtrl.instance.show('shopTip', this.data);
if(res.code == '444444') {
showToast('操作太频繁,请稍后重试');
} else {
PanelCtrl.instance.show('shopTip', this.data);
}
}
}, PropType.BOOM);//兑换道具
}
......
......@@ -40,7 +40,7 @@ export default class Buy3Panel extends Panel {
ontap() {
NetManager.ins.clickLog(getlogItem(14));
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
NetManager.ins.hc_exchange((success, res) => {
this.buyBtn.enabled = true;
if(success) {
if(SceneCtrl.instance.currentScene instanceof MainScene) {
......@@ -53,7 +53,11 @@ export default class Buy3Panel extends Panel {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
PanelCtrl.instance.show('shopTip', this.data);
if(res.code == '444444') {
showToast('操作太频繁,请稍后重试');
} else {
PanelCtrl.instance.show('shopTip', this.data);
}
}
}, PropType.CHANCE_NUM);//兑换道具
}
......
......@@ -4,10 +4,9 @@ import { RecoverName } from "../enum/RecoverName";
import { Element } from "../class/Element";
import { Tool } from "../Tool";
import { ElementType } from "../enum/ElementType";
import { Particle } from "../../../libs/particle/Particle";
export const stepPosition: number[] = [125, 115];
/**
* 需要回调的
* 手动修改this.shoot.rotation=
......@@ -15,71 +14,163 @@ export const stepPosition: number[] = [125, 115];
export class FesRedShootAni2 extends egret.DisplayObjectContainer {
light: LightingAni;
imageAni: ImageAni;
imageAniCon: egret.DisplayObjectContainer
imageAniCon: egret.DisplayObjectContainer;
head;
yStar;
bStar;
bSnow;
constructor() {
super()
this.light = new LightingAni();
this.addChild(this.light);
var arr = []
for (var i = 1; i <= 10; i++) {
arr.push("fesEleSmallDis" + i + "_png");
}
new Particle()
this.imageAniCon = new egret.DisplayObjectContainer();
this.imageAni = new ImageAni(arr);
this.imageAniCon.addChild(this.imageAni);
this.addChild(this.imageAniCon);
this.imageAni.visible = false
super();
let bStarTexture = RES.getRes("redBombBStar_png");
let yStarTexture = RES.getRes("redBombYStar_png");
let bSnowTexture = RES.getRes("redBombBSnow_png");
this.head = new eui.Image(bStarTexture);
this.head.scaleX = this.head.scaleY = 1.5;
this.addChild(this.head);
this.yStar = new eui.Image(yStarTexture);
this.yStar.scaleX = this.yStar.scaleY = 1;
this.addChild(this.yStar);
this.bStar = new eui.Image(bStarTexture);
this.bStar.scaleX = this.bStar.scaleY = 0.5;
this.addChild(this.bStar);
this.bSnow = new eui.Image(bSnowTexture);
this.bSnow.scaleX = this.bSnow.scaleY = 0.7;
this.addChild(this.bSnow);
}
reset() {
this.light.visible = true;
this.imageAni.visible = false;
this.light.scaleX = 0.2;
reset(startP: number[]) {
['head', 'yStar', 'bStar', 'bSnow'].forEach((v) => {
this[v].visible = false;
this[v].x = startP[0];
this[v].y = startP[1];
});
}
play(startP: number[], ele: Element, callback: Function) {
this.reset()
//算角度
var r = Tool.getForwardRotation(startP, [ele.x, ele.y])
this.light.rotation = r * 180 / Math.PI;
this.light.x = startP[0];
this.light.y = startP[1];
this.imageAniCon.x = ele.x;
this.imageAniCon.y = ele.y;
//247
var dis = Math.sqrt(
(startP[0] - ele.x) * (startP[0] - ele.x) +
(startP[1] - ele.y) * (startP[1] - ele.y)
)
var scaleX = dis / 247;
egret.Tween.get(this.light)
.to({ scaleX: scaleX, }, 400)
this.reset(startP);
let duration = 400;
let dis = Math.sqrt(
(startP[0] - ele.x) * (startP[0] - ele.x) + (startP[1] - ele.y) * (startP[1] - ele.y)
);
// yStar
let ysr = -(Tool.getForwardRotation(startP, [ele.x, ele.y]) - 1.5707963 + 0.2); // 算角度
let ysx = Math.sin(ysr) * (dis * 0.5) + startP[0]; // 算位置
let ysy = Math.cos(ysr) * (dis * 0.5) + startP[1];
egret.Tween.get(this.yStar).set({visible: true})
.wait(100).to({x: ysx, y: ysy}, duration);
egret.Tween.get(this.bStar).to({alpha: 0.6}, duration / 2)
.call(()=>{
egret.Tween.get(this.bStar).to({alpha: 1}, duration / 2)
});
// bStar
let bsr = -(Tool.getForwardRotation(startP, [ele.x, ele.y]) - 1.5707963 - 0.2); // 算角度
let bsx = Math.sin(bsr) * (dis * 0.8) + startP[0]; // 算位置
let bsy = Math.cos(bsr) * (dis * 0.8) + startP[1];
egret.Tween.get(this.bStar).set({visible: true})
.wait(50).to({x: bsx, y: bsy}, duration);
egret.Tween.get(this.bStar).wait(50)
.to({alpha: 0.8}, duration / 2)
.call(() => {
egret.Tween.get(this.bStar).to({alpha: 1}, duration / 2)
});
// bSnow
let bnr = -(Tool.getForwardRotation(startP, [ele.x, ele.y]) - 1.5707963 - 0.1); // 算角度
let bnx = Math.sin(bnr) * (dis * 0.3) + startP[0]; // 算位置
let bny = Math.cos(bnr) * (dis * 0.3) + startP[1];
egret.Tween.get(this.bSnow).set({visible: true})
.wait(150).to({x: bnx, y: bny}, duration);
egret.Tween.get(this.bSnow).wait(150)
.to({alpha: 0.3}, duration / 2)
.call(() => {
egret.Tween.get(this.bSnow).to({alpha: 1}, duration / 2)
});
this.head.visible = true;
egret.Tween.get(this.head)
.to({x: ele.x, y: ele.y}, duration)
.call(() => {
// 变换元素
ele.reset(ElementType.FESTIVALELE_SMALL);
ele.scaleX = ele.scaleY = 0.1
ele.scaleX = ele.scaleY = 0.1;
egret.Tween.get(ele)
.to({ scaleX: 1, scaleY: 1 }, 500, egret.Ease.backOut)
.to({scaleX: 1, scaleY: 1}, 500, egret.Ease.backOut)
//回调
callback();
this.imageAni.visible = true;
this.imageAni.play(() => {
if (this.$parent) {
this.$parent.removeChild(this)
};
Pool.recover(RecoverName.FESREDSHOOT_ANI2, this)
})
// 移除
if(this.$parent) {
this.$parent.removeChild(this)
}
// 回收
Pool.recover(RecoverName.FESREDSHOOT_ANI2, this);
// 隐藏
setTimeout(() => {
this.light.visible = false;
this.head.visible = false;
}, 200)
})
setTimeout(() => {
callback();
}, 200);
// 算角度
// var r = Tool.getForwardRotation(startP, [ele.x, ele.y]);
// this.particle.rotation = r * 180 / Math.PI + 90;
// this.light.x = startP[0];
// this.light.y = startP[1];
// this.imageAniCon.x = ele.x;
// this.imageAniCon.y = ele.y;
// //247
// var dis = Math.sqrt(
// (startP[0] - ele.x) * (startP[0] - ele.x) +
// (startP[1] - ele.y) * (startP[1] - ele.y)
// )
// var scaleX = dis / 247;
// egret.Tween.get(this.light)
// .to({ scaleX: scaleX, }, 400)
// .call(() => {
// ele.reset(ElementType.FESTIVALELE_SMALL);
// ele.scaleX = ele.scaleY = 0.1
// egret.Tween.get(ele)
// .to({ scaleX: 1, scaleY: 1 }, 500, egret.Ease.backOut)
//
// //回调
// callback();
//
// this.imageAni.visible = true;
// this.imageAni.play(() => {
// if (this.$parent) {
// this.$parent.removeChild(this)
// };
// Pool.recover(RecoverName.FESREDSHOOT_ANI2, this)
// })
// setTimeout(() => {
// this.light.visible = false;
// }, 200)
//
// })
}
}
class LightingAni extends egret.Bitmap {
sourceAll: string[];
currentFrame: number;
......@@ -91,13 +182,14 @@ class LightingAni extends egret.Bitmap {
* 所有时间,帧数按每秒30
*/
allTime: number
/**
* 播放完的回调
*/
constructor() {
super();
var arr = [];
for (var i = 1; i <= 13; i++) {
for(var i = 1; i <= 13; i++) {
arr.push("lineLight" + i + "_png")
}
this.anchorOffsetX = 23;
......@@ -112,12 +204,13 @@ class LightingAni extends egret.Bitmap {
this.allTime = this.sourceAll.length / 30 * 1000;
}
onEnterFrame() {
if (!this.stage) return
if(!this.stage) return
var dataNow = Date.now();
var deltaTime = dataNow - this.startTime;
var scale = deltaTime / this.allTime;
if (scale >= 1) {
if(scale >= 1) {
this.startTime = Date.now()
this.currentFrame = 0;
} else {
......
......@@ -18,6 +18,8 @@ import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getRotByTwoVectors } from "../anis/MagicRotateAni";
import { FesRedShootAni } from "../anisCall/FesRedShootAni";
import { FesRedShootAni2 } from "../anisCall/FesRedShootAni2";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
//孵鸡的数量
const chickenNum: number = 4;
......@@ -62,7 +64,7 @@ export class AiControl {
* 是否有毛球,
* 是否有变色气泡,
* 必须在初始化元素后执行,每关进入游戏都会初始化
* @param lattices
* @param lattices
*/
init(lattices: Lattice[]) {
this.hasJelly = judgeJellyExist(lattices);
......@@ -180,6 +182,21 @@ export class AiControl {
})
}, 100 * a)
}
loadSvga(getResPath() + 'resource/assets/svgas/雪花炸开效果.svga').then(
(mv:any)=>{
mv.stop();
setTimeout(()=>{
mv.gotoAndPlay(1, true);
mv.x = p[0] - 350;
mv.y = p[1] - 350;
thisObj.addChild(mv);
}, 100);
mv.addEventListener(egret.Event.COMPLETE, () => {
mv.stop();
thisObj.removeChild(mv);
}, this);
}
)
})
}
......@@ -259,8 +276,8 @@ export class AiControl {
/**
* 鸡蛋得孵化逻辑
* 与果冻不同,需要执行一次threeMatch,如无再执行callback,否则执行eleminate
* @param thisObj
* @param callback
* @param thisObj
* @param callback
*/
eggMotion(thisObj: MainScene, callback: Function) {
//无蛋,直接回调
......@@ -350,9 +367,9 @@ export class AiControl {
/**
* 变色气泡
*
* @param thisObj
* @param callback
*
* @param thisObj
* @param callback
*/
bubbleMotion(thisObj: MainScene, callback: Function) {
//无气泡,直接回调,气泡能生成,不能直接判断
......@@ -416,8 +433,8 @@ export class AiControl {
/**
* 跳动,以及褐色毛球的分裂
* 黑色毛球眩晕不执行跳动,不过结束后要重置为不眩晕状态,和callback同步执行
* @param thisObj
* @param callback
* @param thisObj
* @param callback
*/
hairballMotion(thisObj: MainScene, callback: Function) {
//没有毛球。直接回调
......@@ -609,7 +626,7 @@ export class AiControl {
/**
* 判断果冻是否存在
* @param lattices
* @param lattices
* @return false表示不存在,true表示存在
*/
function judgeJellyExist(lattices: Lattice[]) {
......@@ -623,7 +640,7 @@ function judgeJellyExist(lattices: Lattice[]) {
}
/**
* 判断毛球是否存在,甭管什么毛球
* @param lattices
* @param lattices
*/
function judgeHairballExist(lattices: Lattice[]) {
for (var i = 0; i < lattices.length; i++) {
......@@ -652,7 +669,7 @@ function judgeFesEleBigExist(lattices: Lattice[]) {
/**
* 判断气泡是否存在
* @param lattices
* @param lattices
*/
function judgeBubbleExist(lattices: Lattice[]) {
for (var i = 0; i < lattices.length; i++) {
......@@ -664,7 +681,7 @@ function judgeBubbleExist(lattices: Lattice[]) {
}
/**
* 获取所有鸡蛋的索引
* @param lattices
* @param lattices
* @return false表示不存在,true表示存在
*/
function getEggs(lattices: Lattice[]) {
......@@ -686,10 +703,10 @@ function getEggs(lattices: Lattice[]) {
* 判断可蔓延的方向,并返回蔓延终点的格子索引
* 判断可分裂的方向,并返回分裂终点的格子索引
* 判断可跳动的方向,并返回跳动终点的格子索引
*
*
* 4个方向随机,
* 得是基础元素,且无任何状态,可以有特效
* @param index
* @param index
* @return 没有返回null,注意判断时可能有0
*/
function judgeActionIndex(index: number, lattices: Lattice[]): number {
......
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