Commit b8c8ebde authored by wjf's avatar wjf

l

parent cc964014
......@@ -273,7 +273,18 @@ export default class MainBase extends eui.UILayer {
for (var i = 0; i <= 9; i++) {
RES.getResAsync("curScoreNum" + i + "_png")
}
for (var i = 5; i <= 14; i++) {
RES.getResAsync("ele" + i + "_png")
}
for (var i = 1; i <= 10; i++) {
RES.getResAsync("fesEleSmallDis" + i + "_png")
}
for (var i = 1; i <= 13; i++) {
RES.getResAsync("lineLight" + i + "_png")
}
var arr = [
"fesRedBigLight", "fesRedBombSta1", "fesRedCap", "fesRedDown", "fesRedSmallLight", "fesRedUp", "xingxingbi",
"tinyRedLeft", "tinyRedMid", "tinyRedRight",
"festivalTargetBg",
"hairballDisBg",
"brownBallFace",
......@@ -310,13 +321,6 @@ export default class MainBase extends eui.UILayer {
// "guideBg",
// "guideKnowBtn",
"bonusShoot",
"ele5",
"ele6",
"ele7",
"ele8",
"ele9",
"ele10",
"ele11",
"leftArrow",
"chooseRect",
"lightedStar",
......@@ -435,7 +439,7 @@ export default class MainBase extends eui.UILayer {
}
protected async createGameScene() {
window['getaward'] = ()=>{getRedBombAward((param)=>{console.log(param)})}
window['getaward'] = () => { getRedBombAward((param) => { console.log(param) }) }
await Promise.all([
this.getAd(),
this.ajaxElement(),
......
......@@ -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",
"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,ele14_png,ele12_png,ele13_png,xingxingbi_png,tinyRedMid_png,tinyRedLeft_png,tinyRedRight_png",
"name": "main2"
},
{
......@@ -3282,6 +3282,186 @@
"url": "assets/hbCutTime/hbCutTime_btn_null.png",
"type": "image",
"name": "hbCutTime_btn_null_png"
},
{
"url": "assets/mainScene/xingxingbi.png",
"type": "image",
"name": "xingxingbi_png"
},
{
"url": "assets/mainScene/ele12.png",
"type": "image",
"name": "ele12_png"
},
{
"url": "assets/mainScene/ele13.png",
"type": "image",
"name": "ele13_png"
},
{
"url": "assets/mainScene/ele14.png",
"type": "image",
"name": "ele14_png"
},
{
"url": "assets/mainScene/fesEleSmallDis1.png",
"type": "image",
"name": "fesEleSmallDis1_png"
},
{
"url": "assets/mainScene/fesEleSmallDis2.png",
"type": "image",
"name": "fesEleSmallDis2_png"
},
{
"url": "assets/mainScene/fesEleSmallDis3.png",
"type": "image",
"name": "fesEleSmallDis3_png"
},
{
"url": "assets/mainScene/fesEleSmallDis4.png",
"type": "image",
"name": "fesEleSmallDis4_png"
},
{
"url": "assets/mainScene/fesEleSmallDis5.png",
"type": "image",
"name": "fesEleSmallDis5_png"
},
{
"url": "assets/mainScene/fesEleSmallDis6.png",
"type": "image",
"name": "fesEleSmallDis6_png"
},
{
"url": "assets/mainScene/fesEleSmallDis7.png",
"type": "image",
"name": "fesEleSmallDis7_png"
},
{
"url": "assets/mainScene/fesEleSmallDis8.png",
"type": "image",
"name": "fesEleSmallDis8_png"
},
{
"url": "assets/mainScene/fesEleSmallDis9.png",
"type": "image",
"name": "fesEleSmallDis9_png"
},
{
"url": "assets/mainScene/fesEleSmallDis10.png",
"type": "image",
"name": "fesEleSmallDis10_png"
},
{
"url": "assets/mainScene/fesRedBigLight.png",
"type": "image",
"name": "fesRedBigLight_png"
},
{
"url": "assets/mainScene/fesRedBombSta1.png",
"type": "image",
"name": "fesRedBombSta1_png"
},
{
"url": "assets/mainScene/fesRedCap.png",
"type": "image",
"name": "fesRedCap_png"
},
{
"url": "assets/mainScene/fesRedDown.png",
"type": "image",
"name": "fesRedDown_png"
},
{
"url": "assets/mainScene/fesRedSmallLight.png",
"type": "image",
"name": "fesRedSmallLight_png"
},
{
"url": "assets/mainScene/fesRedUp.png",
"type": "image",
"name": "fesRedUp_png"
},
{
"url": "assets/mainScene/lineLight1.png",
"type": "image",
"name": "lineLight1_png"
},
{
"url": "assets/mainScene/lineLight2.png",
"type": "image",
"name": "lineLight2_png"
},
{
"url": "assets/mainScene/lineLight3.png",
"type": "image",
"name": "lineLight3_png"
},
{
"url": "assets/mainScene/lineLight4.png",
"type": "image",
"name": "lineLight4_png"
},
{
"url": "assets/mainScene/lineLight5.png",
"type": "image",
"name": "lineLight5_png"
},
{
"url": "assets/mainScene/lineLight6.png",
"type": "image",
"name": "lineLight6_png"
},
{
"url": "assets/mainScene/lineLight7.png",
"type": "image",
"name": "lineLight7_png"
},
{
"url": "assets/mainScene/lineLight8.png",
"type": "image",
"name": "lineLight8_png"
},
{
"url": "assets/mainScene/lineLight9.png",
"type": "image",
"name": "lineLight9_png"
},
{
"url": "assets/mainScene/lineLight10.png",
"type": "image",
"name": "lineLight10_png"
},
{
"url": "assets/mainScene/lineLight11.png",
"type": "image",
"name": "lineLight11_png"
},
{
"url": "assets/mainScene/lineLight12.png",
"type": "image",
"name": "lineLight12_png"
},
{
"url": "assets/mainScene/lineLight13.png",
"type": "image",
"name": "lineLight13_png"
},
{
"url": "assets/mainScene/tinyRedLeft.png",
"type": "image",
"name": "tinyRedLeft_png"
},
{
"url": "assets/mainScene/tinyRedMid.png",
"type": "image",
"name": "tinyRedMid_png"
},
{
"url": "assets/mainScene/tinyRedRight.png",
"type": "image",
"name": "tinyRedRight_png"
}
]
}
\ No newline at end of file
......@@ -35,9 +35,7 @@ import { Pool } from '../something/Pool';
import { Tool } from '../something/Tool';
import { BonusTime } from '../something/uis/BonusTime';
import { ElementTargets } from '../something/uis/ElementTargets';
import { Loading2 } from '../something/uis/Loading2';
import { PropGuide } from '../something/uis/PropGuide';
import { PropNumShow } from '../something/uis/PropNumShow';
import { ScoreProgress } from '../something/uis/ScoreProgress';
import { StepNumber } from '../something/uis/StepNumber';
import { getBgOn, getSoundOn, playSound, SoundType, stopBg, toggleSound } from '../soundCtrl';
......@@ -66,6 +64,7 @@ import { PropBtnCon } from '../something/uis/PropBtnCon';
import { ChapterNum } from '../something/uis/ChapterNum';
import { CurScoreNum } from '../something/uis/CurScoreNum';
import { FestivalTarget } from '../something/uis/FestivalTarget';
import getRedBombAward from '../getRedBombAward';
const aniClass = {
"BoomAni": BoomAni,
......@@ -82,6 +81,7 @@ const aniClass = {
"EggBrokenAni": EggBrokenAni,
"HairballGreyDisAni": HairballGreyDisAni,
// "HairballBlackDisAni": HairballBlackDisAni,
// "FestivalEleSmallDisAni": FestivalEleSmallDisAni,
}
export const baseScore = 20;
/**
......@@ -107,6 +107,9 @@ export const effectBaseTimes = {
//三个toast和bonusTime
const movieClips: any = {}
//红包炸弹弹框名字
const redBombPanelName = "aaaaa";
export default class MainScene extends Scene {
get skinKey() { return 'Main2' }
......@@ -225,6 +228,8 @@ export default class MainScene extends Scene {
bonusTime: BonusTime;
//游戏操作引导
gameGuide: GameGuide;
//记录是否有红包炸弹弹框
redBombPanelMark: boolean;
start(data) {
super.start();
//第几关
......@@ -236,10 +241,13 @@ export default class MainScene extends Scene {
this.initTarget();
//添加节日元素,条件可能会变
if (111) {
//添加节日红包目标
this.festivalTarget = new FestivalTarget();
this.festivalTarget.x = 580;
this.festivalTarget.y = 115;
this.addChildAt(this.festivalTarget, 1);
//动效,修改最中间元素为红包
}
//初始化索引信息,包括10*10的,
Tool.init(Tool.getColOddEven(this.chapterData.map.lattices), !!(this.passElements && this.passElements[ElementType.LOLLIPOP]));
......@@ -898,10 +906,8 @@ export default class MainScene extends Scene {
}
}
sendPropUse(prop: PropType, index?: number) {
Loading2.instace.show();
this.removeChild(this.propGuide);
NetManager.ins.hc_useProp((s, data) => {
Loading2.instace.hide();
//还原事件
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
if (prop == PropType.BOOM || prop == PropType.HAMMER) {
......@@ -1792,8 +1798,10 @@ export default class MainScene extends Scene {
//判断步数是否为0;
if (this.steps == 0) {
//失败弹框
playSound(SoundType.fail);
PanelCtrl.instance.show("failed", { level: this.chapter });
// playSound(SoundType.fail);
var panelsDatas = this.returnPanels("failed", { level: this.chapter })
PanelCtrl.instance.showPanels(panelsDatas[0], panelsDatas[1], () => { });
// PanelCtrl.instance.show("failed", { level: this.chapter });
return
}
//果冻的时间980,气泡的时间1100,必须考虑直接执行的情况,所以必须同时判断
......@@ -1822,13 +1830,14 @@ export default class MainScene extends Scene {
if (Tool.alreadyDie(this.lattices)) {
showToast("元素已无法消除")
setTimeout(() => {
playSound(SoundType.fail);
PanelCtrl.instance.show("failed", { level: this.chapter });
// playSound(SoundType.fail);
var panelsDatas = this.returnPanels("failed", { level: this.chapter })
PanelCtrl.instance.showPanels(panelsDatas[0], panelsDatas[1], () => { });
// PanelCtrl.instance.show("failed", { level: this.chapter });
}, 1000)
} else {
//死图。替换顺序,出toast
showToast("没有可以消除的元素")
// PanelCtrl.instance.show(ModuleTypes.TOAST_PANEL, { msg: "没有可以消除的元素", isHideMask: true })
setTimeout(() => {
this.upsetElement()
}, 1000)
......@@ -1840,7 +1849,9 @@ export default class MainScene extends Scene {
this.gameGuide.show()
};
//允许移动
this.enableMouseEvt(true)
this.enableMouseEvt(true);
//检查是否有红包炸弹弹框;有就弹出;然后置空
this.openRedBombPanel();
}
}
/**
......@@ -2126,6 +2137,16 @@ export default class MainScene extends Scene {
//鸡蛋动效
this.playAni(RecoverName.EGGBROKEN_ANI, p)
}
//大红包
else if (ele.type == ElementType.FESTIVALELE_BIG) {
//动画也在放这里
ele.festivalEle.statusNum--;
}
//小红包
else if (ele.type == ElementType.FESTIVALELE_SMALL) {
//统一逻辑,个数等,都进里面
this.removeFestivalEleSmall(index);
}
}
}
//从消除列表移除
......@@ -2433,7 +2454,9 @@ export default class MainScene extends Scene {
this.upsetElement()
} else {
//允许移动
this.enableMouseEvt(true)
this.enableMouseEvt(true);
//检查是否有红包炸弹弹框;有就弹出;然后置空
this.openRedBombPanel();
}
}
}
......@@ -2490,50 +2513,24 @@ export default class MainScene extends Scene {
* @param callback
*/
submit(json: string) {
Loading2.instace.show();
NetManager.ins.hc_submit((s, data) => {
if (s) {
wait(200).then(() => {
updateMainTimerAfterGetData();//submit之后再判断一次home,更新倒计时
});
const submitData = DataManager.ins.getData('hc_submit').data;
var panelsDatas;
if (submitData.option) {
Loading2.instace.hide();
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL, { level: this.chapter, option: submitData.option });
panelsDatas = this.returnPanels(ModuleTypes.PRIZE_PANEL, { level: this.chapter, option: submitData.option });
// PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL, { level: this.chapter, option: submitData.option });
} else {
Loading2.instace.hide();
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL, { level: this.chapter });
panelsDatas = this.returnPanels(ModuleTypes.NO_PRIZE_PANEL, { level: this.chapter })
// PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL, { level: this.chapter });
}
// if (submitData.prizeType == 1) {
// //提交成功后捞结果
// NetManager.ins.getPlugOrderStatus((s) => {
// Loading2.instace.hide();
// playSound(SoundType.sucess);
// if (s) {
// const data = DataManager.ins.getData('getPlugOrderStatus');
// //区分奖品
// if (data.lottery && data.lottery.type != "thanks") {
// PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL, { level: this.chapter });
// } else {
// PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL, { level: this.chapter });
// }
// } else {
// //失败直接显示未中奖
// PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL, { level: this.chapter });
// }
// },
// submitData.prizeResponse.orderNum,
// () => { return DataManager.ins.getData('getPlugOrderStatus').result == 0 });
// } else if (submitData.prizeType == 2) {
// Loading2.instace.hide();
// PanelCtrl.instance.show('prize2', { level: this.chapter });
// } else {
// Loading2.instace.hide();
// PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL, { level: this.chapter });
// }
//弹出所有的
PanelCtrl.instance.showPanels(panelsDatas[0], panelsDatas[1], () => { })
} else {
Loading2.instace.hide();
if (!data) {
//错误弹框,网络错误
//提交失败
......@@ -2561,6 +2558,34 @@ export default class MainScene extends Scene {
DataManager.ins.getData("getNgameStartStatus").data.submitToken)
}
/**
* 打开红包炸弹弹框
*/
openRedBombPanel() {
if (this.redBombPanelMark) {
PanelCtrl.instance.show(redBombPanelName);
this.redBombPanelMark = false;
}
}
/**
* 为了能加入红包炸弹的弹框
* @param panel
* @param data
*/
returnPanels(panelName, data) {
var panels = [], params = [];
//如果需要弹出红包炸弹,要先出
if (this.redBombPanelMark) {
panels.push(redBombPanelName);
params.push(null);
this.redBombPanelMark = false;
}
panels.push(panelName);
params.push(data);
return [panels, params]
}
/**
* 播放动画
* @param name
......@@ -2673,16 +2698,7 @@ export default class MainScene extends Scene {
* @param index
*/
removeRock(index: number) {
//回收
let ele = this.lattices[index].element;
//添加进emptys
this.emptys.push(index)
//从容器移除
this.elementContainer.removeChild(ele);
//回收元素
Pool.recover(RecoverName.ELEMENT, ele);
//置空格子的element,
this.lattices[index].element = null;
this.removeOperation(index);
//播放动效
this.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index))
}
......@@ -2692,7 +2708,39 @@ export default class MainScene extends Scene {
*/
removeJelly(index: number) {
this.jellyBrokenMark = true;
//回收
this.removeOperation(index);
//播放动效,果冻的特效,待写
this.playAni(RecoverName.JELLYDIS_ANI, Tool.getPositionByIndex(index))
}
//移除小红包,包括动效,还有个数累计等等。发接口,等等
removeFestivalEleSmall(index: number) {
this.removeOperation(index);
//播放动效
this.playAni(RecoverName.FESTIVALELESMALLDIS_ANI, Tool.getPositionByIndex(index))
//查看次数,原先不为0,
if (this.festivalTarget.count) {
this.festivalTarget.count--;
//完成了,发接口,,
if (this.festivalTarget.count == 0) {
getRedBombAward(() => {
this.redBombPanelMark = true;
})
}
}
}
/**
* 移除元素的操作:
* 进入emptys
* 从场景移除
* 回收元素
* 格子元素置空
* @param index
*/
removeOperation(index: number): Element {
//没有格子,或者没有元素,
if (!this.lattices[index] || !this.lattices[index].element) return null
//先赋值指向
let ele = this.lattices[index].element;
//添加进emptys
this.emptys.push(index)
......@@ -2702,8 +2750,8 @@ export default class MainScene extends Scene {
Pool.recover(RecoverName.ELEMENT, ele);
//置空格子的element,
this.lattices[index].element = null;
//播放动效,果冻的特效,待写
this.playAni(RecoverName.JELLYDIS_ANI, Tool.getPositionByIndex(index))
//返回下,有地方要用
return ele
}
/**
* 禁用与开启事件
......@@ -2721,25 +2769,4 @@ export default class MainScene extends Scene {
this.quitBtn.touchEnabled = b;
this.enableTouch = b;
}
sample() {
var parser = new window["SVGA"].Parser();
parser.load("../egret/loading五神兽最终版.svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem)
// mv.lockStep=true;
mv.gotoAndPlay(1, true)
// mv.play()
// mv.gotoAndPlay(30, true)
// mv.gotoAndStop(10)
this.addChild(mv);
let fun
mv.addEventListener(egret.Event.COMPLETE, fun = function () {
console.log("播放完成")
// mv.removeEventListener(egret.Event.COMPLETE,fun,this)
// mv.stop()
// mv.startAniRange(30,60);
}, this)
}, function (error) {
alert(error.message);
})
}
}
\ No newline at end of file
import { ElementType } from "../enum/ElementType";
import { ElementType, FiveBaseElementTypes } from "../enum/ElementType";
import { EffectType } from "../enum/EffectType";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
......@@ -16,6 +16,7 @@ import { BubbleState } from "../states/BubbleState";
import { HairballGreyState } from "../states/HairballGreyState";
import { HairballBlackState } from "../states/HairballBlackState";
import { Tool } from "../Tool";
import { FestivalEle } from "./FestivalEle";
/**
......@@ -123,6 +124,8 @@ export class Element extends eui.Component {
column: number
//鸡蛋
chickenEgg: ChickenEgg;
//节日红包大
festivalEle: FestivalEle;
/**
* 所有的状态,注意,变色气泡特殊,不能和特效共存,所以初始化时,气泡的不能加特效。生成特效,去掉气泡
......@@ -140,7 +143,7 @@ export class Element extends eui.Component {
this.showImage = new eui.Image();
this.changeSource("ele" + this.type + "_png");
this.addChild(this.showImage);
// this.showImage.touchEnabled=false
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
if (!this.chickenEgg) {
......@@ -150,7 +153,16 @@ export class Element extends eui.Component {
}
this.addChild(this.chickenEgg)
}
//
//节日红包
else if (type == ElementType.FESTIVALELE_BIG) {
this.festivalEle = Pool.takeOut(RecoverName.FESTIVAL_ELE)
if (!this.festivalEle) {
this.festivalEle = new FestivalEle();
} else {
this.festivalEle.reset();
}
this.addChild(this.festivalEle)
}
}
......@@ -206,18 +218,34 @@ export class Element extends eui.Component {
Pool.recover(RecoverName.CHICKEN_EGG, this.chickenEgg);
this.chickenEgg = null;
}
//如果类型是节日红包大
if (type == ElementType.FESTIVALELE_BIG) {
this.festivalEle = this.festivalEle || Pool.takeOut(RecoverName.FESTIVAL_ELE)
if (!this.festivalEle) {
//新建
this.festivalEle = new FestivalEle();
} else {
this.festivalEle.reset();
}
this.addChild(this.festivalEle)
} else if (this.festivalEle) {
this.removeChild(this.festivalEle);
Pool.recover(RecoverName.FESTIVAL_ELE, this.festivalEle);
this.festivalEle = null;
}
}
/**
* 只修改类型,不改变其他状态
* @param type 只应该是基础元素和特殊元素
* 只修改类型,不改变其他状态,主要针对修改基础元素类型
* @param type
*/
resetType(type: ElementType) {
//如果重置成特殊元素,或鸡蛋,或石头,或果冻,或棒棒糖,直接用reset方法
if (type == ElementType.CHICKEN_EGG ||
type == ElementType.ROCK ||
type == ElementType.JELLY ||
type == ElementType.LOLLIPOP) {
//如果类型一致,return
if (this._type == type) return
//如果目标类型不是基础元素 或者原先不是基础元素
if (FiveBaseElementTypes.indexOf(type) == -1 ||
FiveBaseElementTypes.indexOf(this._type) == -1
) {
this.reset(type)
} else {
this._type = type;
......
......@@ -2,7 +2,7 @@ import { ElementType } from "../enum/ElementType";
//三种状态的图片,剩三种了
const images = {
2: "ele" + ElementType.CHICKEN_EGG + "_png",
2: "ele" + ElementType.FESTIVALELE_BIG + "_png",
1: "eggStatus1_png",
0: "eggStatus0_png"
}
......@@ -26,10 +26,10 @@ export class FestivalEle extends eui.Component {
set statusNum(value: number) {
if (value >= 0) {
this._statusNum = value;
//修改图片
if (this.showImage.source != images[this._statusNum]) {
this.changeSource(images[this._statusNum]);
}
//播放动画,然后循环动画
// if (this.showImage.source != images[this._statusNum]) {
// this.changeSource(images[this._statusNum]);
// }
} else {
this._statusNum = 0;
this.isActive = true;
......@@ -70,4 +70,7 @@ export class FestivalEle extends eui.Component {
}
}
\ No newline at end of file
}
// class
\ No newline at end of file
......@@ -34,6 +34,9 @@ export enum RecoverName {
//元素身上的鸡蛋
CHICKEN_EGG = "ChickenEgg",
//元素上的大红包
FESTIVAL_ELE = "FestivalEle",
//所有继承ani的,能单独播放的,不带回调的
ROCK_ANI = "RockAni",
ICE_ANI = "IceAni",
......@@ -49,6 +52,7 @@ export enum RecoverName {
EGGBROKEN_ANI = "EggBrokenAni",
HAIRBALLGREYDIS_ANI = "HairballGreyDisAni",
HAIRBALLBLACKDIS_ANI = "HairballBlackDisAni",
FESTIVALELESMALLDIS_ANI = "FestivalEleSmallDisAni",
//方形遮罩
RECT_MASK = "RectMask",
......
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