Commit 285e9aa1 authored by wildfirecode's avatar wildfirecode

1

parent b8f9f8cc
...@@ -286,7 +286,7 @@ export default class MainBase extends eui.UILayer { ...@@ -286,7 +286,7 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync("ele" + i + "Line" + "_png") RES.getResAsync("ele" + i + "Line" + "_png")
RES.getResAsync("ele" + i + "Exp" + "_png") RES.getResAsync("ele" + i + "Exp" + "_png")
} }
for (var i = 0; i < 20; i++) { for (var i = 0; i < 21; i++) {
RES.getResAsync("ele" + i + "_png") RES.getResAsync("ele" + i + "_png")
} }
for (var i = 1; i <= 27; i++) { for (var i = 1; i <= 27; i++) {
...@@ -451,6 +451,7 @@ export default class MainBase extends eui.UILayer { ...@@ -451,6 +451,7 @@ export default class MainBase extends eui.UILayer {
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga'); loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga');
loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga'); loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga');
loadSvga(getResPath() + 'resource/assets/svgas/sprize.svga'); loadSvga(getResPath() + 'resource/assets/svgas/sprize.svga');
loadSvga(getResPath() + 'resource/assets/svgas/monster.svga');
} }
catch (e) { catch (e) {
console.error(e); console.error(e);
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
"name": "h5" "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,redBombYStar_png,redBombBStar_png,redBombBSnow_png,线条尾部炸开_00000_png,线条尾部炸开_00001_png,线条尾部炸开_00002_png,线条尾部炸开_00003_png,线条尾部炸开_00004_png,线条尾部炸开_00005_png,线条尾部炸开_00006_png,线条尾部炸开_00007_png,线条尾部炸开_00008_png,ele15_png,ele16_png,ele17_png,ele18_png,ele19_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,线条尾部炸开_00000_png,线条尾部炸开_00001_png,线条尾部炸开_00002_png,线条尾部炸开_00003_png,线条尾部炸开_00004_png,线条尾部炸开_00005_png,线条尾部炸开_00006_png,线条尾部炸开_00007_png,线条尾部炸开_00008_png,ele15_png,ele16_png,ele17_png,ele18_png,ele19_png,ele20_png,empty_png",
"name": "main2" "name": "main2"
}, },
{ {
...@@ -4212,6 +4212,16 @@ ...@@ -4212,6 +4212,16 @@
"url": "assets/backindex/backindex.png", "url": "assets/backindex/backindex.png",
"type": "image", "type": "image",
"name": "backindex_png" "name": "backindex_png"
},
{
"url": "assets/mainScene/ele20.png",
"type": "image",
"name": "ele20_png"
},
{
"url": "assets/mainScene/empty.png",
"type": "image",
"name": "empty_png"
} }
] ]
} }
\ No newline at end of file
...@@ -752,13 +752,14 @@ export default class MainScene extends Scene { ...@@ -752,13 +752,14 @@ export default class MainScene extends Scene {
this.elementContainer.addChild(jelly); this.elementContainer.addChild(jelly);
this.lattices[i].element = jelly; this.lattices[i].element = jelly;
break; break;
//果冻怪物
case ElementConfigType.JELLY_MONSTER: case ElementConfigType.JELLY_MONSTER:
// let jelly: Element = Tool.getElement(ElementType.JELLY) let monster: Element = Tool.getElement(ElementType.JELLY_MONSTER)
// jelly.x = p[0]; monster.x = p[0];
// jelly.y = p[1]; monster.y = p[1];
// this.elementContainer.addChild(jelly); this.elementContainer.addChild(monster);
// this.lattices[i].element = jelly; this.lattices[i].element = monster;
this.emptys.push(i); monster.resetMonster();
break; break;
//鸡蛋 //鸡蛋
case ElementConfigType.CHICKEN_EGG: case ElementConfigType.CHICKEN_EGG:
......
...@@ -334,7 +334,8 @@ export class Tool { ...@@ -334,7 +334,8 @@ export class Tool {
return false return false
} }
//上方元素为冰淇淋 //上方元素为冰淇淋
else if (lat.element.type == ElementType.LOLLIPOP) { else if (lat.element.type == ElementType.LOLLIPOP ||
lat.element.type == ElementType.JELLY_MONSTER) {
return false return false
} }
//剩下情况 //剩下情况
...@@ -430,6 +431,7 @@ export class Tool { ...@@ -430,6 +431,7 @@ export class Tool {
ele.type == ElementType.JELLY || ele.type == ElementType.JELLY ||
ele.type == ElementType.CHICKEN_EGG || ele.type == ElementType.CHICKEN_EGG ||
ele.type == ElementType.LOLLIPOP || ele.type == ElementType.LOLLIPOP ||
ele.type == ElementType.JELLY_MONSTER ||
ele.type == ElementType.FESTIVALELE_BIG || ele.type == ElementType.FESTIVALELE_BIG ||
ele.type == ElementType.FESTIVALELE_SMALL || ele.type == ElementType.FESTIVALELE_SMALL ||
ele.hasState(StateType.LOCK) || ele.hasState(StateType.LOCK) ||
...@@ -665,19 +667,19 @@ export class Tool { ...@@ -665,19 +667,19 @@ export class Tool {
if (effectElement.effectType == EffectType.MAGICLION) { if (effectElement.effectType == EffectType.MAGICLION) {
//上格子 //上格子
var up = lattices[effectElement.index - Tool.colNum]; var up = lattices[effectElement.index - Tool.colNum];
if (this.judgeMove(up) && up.element.type != ElementType.LOLLIPOP) return [effectElement, up.element]; if (this.judgeMove(up) && up.element.type != ElementType.LOLLIPOP&& up.element.type != ElementType.JELLY_MONSTER) return [effectElement, up.element];
//下格子 //下格子
var down = lattices[effectElement.index + Tool.colNum]; var down = lattices[effectElement.index + Tool.colNum];
if (this.judgeMove(down) && down.element.type != ElementType.LOLLIPOP) return [effectElement, down.element]; if (this.judgeMove(down) && down.element.type != ElementType.LOLLIPOP&& up.element.type != ElementType.JELLY_MONSTER) return [effectElement, down.element];
//左格子 //左格子
var col = Tool.indexToRc(effectElement.index)[1];//列数 var col = Tool.indexToRc(effectElement.index)[1];//列数
if (col != 0) { if (col != 0) {
var left = lattices[effectElement.index - 1]; var left = lattices[effectElement.index - 1];
if (this.judgeMove(left) && left.element.type != ElementType.LOLLIPOP) return [effectElement, left.element]; if (this.judgeMove(left) && left.element.type != ElementType.LOLLIPOP && up.element.type != ElementType.JELLY_MONSTER) return [effectElement, left.element];
} }
if (col != Tool.colNum - 1) { if (col != Tool.colNum - 1) {
var right = lattices[effectElement.index + 1]; var right = lattices[effectElement.index + 1];
if (this.judgeMove(right) && right.element.type != ElementType.LOLLIPOP) return [effectElement, right.element]; if (this.judgeMove(right) && right.element.type != ElementType.LOLLIPOP && up.element.type != ElementType.JELLY_MONSTER) return [effectElement, right.element];
} }
continue continue
} }
......
...@@ -52,10 +52,14 @@ export const Chapters14: ChapterData[] = [ ...@@ -52,10 +52,14 @@ export const Chapters14: ChapterData[] = [
1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 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, 1, 1, 1, 1, 1, 1,
1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 12, 1, 1, 2, 1, 1, 12, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1], 1, 1, 1, 2, 2, 2, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2,
1, 12, 1, 1, 2, 1, 1, 12, 1,
1, 1, 1, 2, 2, 2, 1, 1, 1,
1, 1, 1, 1, 2, 1, 1, 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], recycles: [], generateLats: [{ index: 0, type: null }, { index: 2, type: null }, { index: 3, type: null }, { index: 5, type: null }, { index: 6, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 16, type: null }] 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], recycles: [], generateLats: [{ index: 0, type: null }, { index: 2, type: null }, { index: 3, type: null }, { index: 5, type: null }, { index: 6, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 16, type: null }]
} }
} }
] ]
\ No newline at end of file
...@@ -25,12 +25,84 @@ import { createCandyDis1Ani } from "../anis/candy/createCandyDis1Ani"; ...@@ -25,12 +25,84 @@ import { createCandyDis1Ani } from "../anis/candy/createCandyDis1Ani";
import { createCandyDis2Ani } from "../anis/candy/createCandyDis2Ani"; import { createCandyDis2Ani } from "../anis/candy/createCandyDis2Ani";
import { createCandyDis3Ani } from "../anis/candy/createCandyDis3Ani"; import { createCandyDis3Ani } from "../anis/candy/createCandyDis3Ani";
import { createCandyDis4Ani } from "../anis/candy/createCandyDis4Ani"; import { createCandyDis4Ani } from "../anis/candy/createCandyDis4Ani";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
/** /**
* 考虑到底继承白鹭的啥Component还是Container * 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点 * 坐标原点需要坐落在格子的中心点
* 最好到时按,底图,动效,气泡,笼子,毛球,进行分层,如果多个状态要共存时,必须分层,到时气泡的动画,要写再自己的层里 * 最好到时按,底图,动效,气泡,笼子,毛球,进行分层,如果多个状态要共存时,必须分层,到时气泡的动画,要写再自己的层里
*/ */
export class Element extends eui.Component { export class Element extends eui.Component {
_mv;
async resetMonster() {
const mv: any = await loadSvga(getResPath() + 'resource/assets/svgas/monster.svga');
this._mv = mv;
this.addChild(mv);
mv.anchorOffsetX = 150;
mv.anchorOffsetY = 150;
mv.x = - 3;
mv.y = - 6;
// mv.gotoAndPlay(361, true);
// mv.addEventListener(egret.Event.ENTER_FRAME, () => {
// // if (mv.currentFrame == 360) //待机
// // mv.gotoAndPlay(1, true);
// if (mv.currentFrame == 508) { //向上吹
// mv.gotoAndPlay(361, true);
// }
// if (mv.currentFrame == 361 + 100) {
// const tex: egret.Texture = RES.getRes("ele20_png");
// const pic = new egret.Bitmap(tex);
// pic.anchorOffsetX = tex.textureWidth / 2;
// pic.anchorOffsetY = tex.textureHeight;
// pic.x = p[0];
// pic.y = p[1];
// this.stage.addChild(pic);
// egret.Tween.get(pic).set({ scaleX: 0, scaleY: 0 }).to({ scaleX: 1, scaleY: 1 }, 300);
// }
// }, this);
setInterval(()=>{
this.toAction();
},5000);
}
toStandByAction() {
if (!this._mv) return;
const mv = this._mv;
const cb = () => {
if (mv.currentFrame == 360) { //向上吹
mv.gotoAndPlay(1, true);
}
};
this._mv.addEventListener(egret.Event.ENTER_FRAME, cb, this);
mv.gotoAndPlay(1, true);
}
toAction() {
if (!this._mv) return;
var p = Tool.getPositionByIndex(this.index);
const mv = this._mv;
const cb = () => {
if (mv.currentFrame == 508) { //向上吹
this.toStandByAction();
}
if (mv.currentFrame == 391) {
const tex: egret.Texture = RES.getRes("ele20_png");
const pic = new egret.Bitmap(tex);
pic.anchorOffsetX = tex.textureWidth / 2;
pic.anchorOffsetY = tex.textureHeight;
pic.x = p[0];
pic.y = p[1];
this.stage.addChild(pic);
egret.Tween.get(pic).set({ scaleX: 0, scaleY: 0 }).to({ scaleX: 1.1, scaleY: 1.1 }, 300).wait(1000).call(()=>{
pic.parent.removeChild(pic);
});
}
};
this._mv.addEventListener(egret.Event.ENTER_FRAME, cb, this);
mv.gotoAndPlay(361, true);
}
private _candy: Candy; private _candy: Candy;
resetToCandyView(baseElement: CandyBaseElementType) { resetToCandyView(baseElement: CandyBaseElementType) {
const res = transElementRes(baseElement); const res = transElementRes(baseElement);
...@@ -68,8 +140,8 @@ export class Element extends eui.Component { ...@@ -68,8 +140,8 @@ export class Element extends eui.Component {
const cb = () => { const cb = () => {
r(); r();
}; };
this.showImage.alpha=0; this.showImage.alpha = 0;
this.candy.visible=false; this.candy.visible = false;
var p = Tool.getPositionByIndex(this.index); var p = Tool.getPositionByIndex(this.index);
if (this.type == ElementType.RABBIT) if (this.type == ElementType.RABBIT)
createCandyDis0Ani(p[0], p[1], this.stage, cb); createCandyDis0Ani(p[0], p[1], this.stage, cb);
...@@ -253,6 +325,7 @@ export class Element extends eui.Component { ...@@ -253,6 +325,7 @@ export class Element extends eui.Component {
changeSource(source: string) { changeSource(source: string) {
// this.showImage.source = source; // this.showImage.source = source;
var texture: egret.Texture = RES.getRes(source); var texture: egret.Texture = RES.getRes(source);
if (!texture) return;
this.showImage.texture = texture this.showImage.texture = texture
this.showImage.x = -texture.textureWidth / 2; this.showImage.x = -texture.textureWidth / 2;
......
...@@ -35,6 +35,9 @@ export enum ElementType { ...@@ -35,6 +35,9 @@ export enum ElementType {
CANDY_CATTLE,//牛 CANDY_CATTLE,//牛
CANDY_LION,//狮子 CANDY_LION,//狮子
CANDY_PIG,//猪 CANDY_PIG,//猪
MONSTER_JELLY,
JELLY_MONSTER,
} }
export enum CandyBaseElementType { export enum CandyBaseElementType {
......
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