Commit 46fb343c authored by 邱旭's avatar 邱旭

1

parents 26b0cb54 24f518f2
......@@ -209,5 +209,13 @@
"value": "http://yun.duiba.com.cn/db_games/fishlogo.png"
}
]
},
"16db4bf413f": {
"bindingDataTestObj": [
{
"key": "data.img",
"value": "http://yun.duiba.com.cn/db_games/fishlogo.png"
}
]
}
}
\ No newline at end of file
......@@ -169,9 +169,8 @@ export default class MainBase extends eui.UILayer {
}
for (var i = 0; i < 5; i++) {
RES.getResAsync("ele" + i + "_png")
for (var j = 0; j < 3; j++) {
RES.getResAsync("ele" + i + j + "_png")
}
RES.getResAsync("ele" + i + "Line" + "_png")
RES.getResAsync("ele" + i + "Exp" + "_png")
}
for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png")
......@@ -179,10 +178,10 @@ export default class MainBase extends eui.UILayer {
for (var i = 1; i <= 19; i++) {
RES.getResAsync("eleDis" + i + "_png")
}
for (var i = 1; i <= 6; i++) {
for (var i = 2; i <= 6; i++) {
RES.getResAsync("ice" + i + "_png")
}
for (var i = 1; i <= 6; i++) {
for (var i = 2; i <= 6; i++) {
RES.getResAsync("rock" + i + "_png")
}
for (var i = 0; i <= 9; i++) {
......@@ -237,6 +236,7 @@ export default class MainBase extends eui.UILayer {
"ele5",
"ele6",
"ele7",
"ele8",
"leftArrow",
"chooseRect",
"lightedStar",
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"main2","version":5,"files":["..\\assets\\mainScene\\yezi1.png","..\\assets\\mainScene\\unlightedStar.png","..\\assets\\mainScene\\targetBoard.png","..\\assets\\mainScene\\stepsBoard.png","..\\assets\\mainScene\\stepNumber9.png","..\\assets\\mainScene\\stepNumber8.png","..\\assets\\mainScene\\stepNumber7.png","..\\assets\\mainScene\\stepNumber6.png","..\\assets\\mainScene\\stepNumber5.png","..\\assets\\mainScene\\stepNumber4.png","..\\assets\\mainScene\\stepNumber3.png","..\\assets\\mainScene\\stepNumber2.png","..\\assets\\mainScene\\stepNumber1.png","..\\assets\\mainScene\\stepNumber0.png","..\\assets\\mainScene\\stepBtn.png","..\\assets\\mainScene\\starProgress.png","..\\assets\\mainScene\\setting.png","..\\assets\\mainScene\\scoreNumber9.png","..\\assets\\mainScene\\scoreNumber8.png","..\\assets\\mainScene\\scoreNumber7.png","..\\assets\\mainScene\\scoreNumber6.png","..\\assets\\mainScene\\scoreNumber5.png","..\\assets\\mainScene\\scoreNumber4.png","..\\assets\\mainScene\\scoreNumber3.png","..\\assets\\mainScene\\scoreNumber2.png","..\\assets\\mainScene\\scoreNumber1.png","..\\assets\\mainScene\\scoreNumber0.png","..\\assets\\mainScene\\rock6.png","..\\assets\\mainScene\\rock5.png","..\\assets\\mainScene\\rock4.png","..\\assets\\mainScene\\rock3.png","..\\assets\\mainScene\\rock2.png","..\\assets\\mainScene\\rock1.png","..\\assets\\mainScene\\rightMark.png","..\\assets\\mainScene\\rightArrow.png","..\\assets\\mainScene\\rectLat.png","..\\assets\\mainScene\\progressDown.png","..\\assets\\mainScene\\playSceneBg.png","..\\assets\\mainScene\\magicLionBg.png","..\\assets\\mainScene\\magicLion.png","..\\assets\\mainScene\\lockUp.png","..\\assets\\mainScene\\lockDown.png","..\\assets\\mainScene\\lineLight.png","..\\assets\\mainScene\\lightedStar.png","..\\assets\\mainScene\\leftArrow.png","..\\assets\\mainScene\\ice6.png","..\\assets\\mainScene\\ice5.png","..\\assets\\mainScene\\ice4.png","..\\assets\\mainScene\\ice3.png","..\\assets\\mainScene\\ice2.png","..\\assets\\mainScene\\ice1.png","..\\assets\\mainScene\\hammerBtn.png","..\\assets\\mainScene\\eleDis9.png","..\\assets\\mainScene\\eleDis8.png","..\\assets\\mainScene\\eleDis7.png","..\\assets\\mainScene\\eleDis6.png","..\\assets\\mainScene\\eleDis5.png","..\\assets\\mainScene\\eleDis4.png","..\\assets\\mainScene\\eleDis3.png","..\\assets\\mainScene\\eleDis2.png","..\\assets\\mainScene\\eleDis12.png","..\\assets\\mainScene\\eleDis11.png","..\\assets\\mainScene\\eleDis10.png","..\\assets\\mainScene\\eleDis1.png","..\\assets\\mainScene\\ele5.png","..\\assets\\mainScene\\ele42.png","..\\assets\\mainScene\\ele41.png","..\\assets\\mainScene\\ele40.png","..\\assets\\mainScene\\ele4.png","..\\assets\\mainScene\\ele32.png","..\\assets\\mainScene\\ele31.png","..\\assets\\mainScene\\ele30.png","..\\assets\\mainScene\\ele3.png","..\\assets\\mainScene\\ele22.png","..\\assets\\mainScene\\ele21.png","..\\assets\\mainScene\\ele20.png","..\\assets\\mainScene\\ele2.png","..\\assets\\mainScene\\ele12.png","..\\assets\\mainScene\\ele11.png","..\\assets\\mainScene\\ele10.png","..\\assets\\mainScene\\ele1.png","..\\assets\\mainScene\\ele02.png","..\\assets\\mainScene\\ele01.png","..\\assets\\mainScene\\ele00.png","..\\assets\\mainScene\\ele0.png","..\\assets\\mainScene\\dangqianfenshu.png","..\\assets\\mainScene\\chooseRect.png","..\\assets\\mainScene\\boomBtn.png","..\\assets\\mainScene\\boom9.png","..\\assets\\mainScene\\boom8.png","..\\assets\\mainScene\\boom7.png","..\\assets\\mainScene\\boom6.png","..\\assets\\mainScene\\boom5.png","..\\assets\\mainScene\\boom4.png","..\\assets\\mainScene\\boom3.png","..\\assets\\mainScene\\boom2.png","..\\assets\\mainScene\\boom18.png","..\\assets\\mainScene\\boom17.png","..\\assets\\mainScene\\boom16.png","..\\assets\\mainScene\\boom15.png","..\\assets\\mainScene\\boom14.png","..\\assets\\mainScene\\boom13.png","..\\assets\\mainScene\\boom12.png","..\\assets\\mainScene\\boom11.png","..\\assets\\mainScene\\boom10.png","..\\assets\\mainScene\\boom1.png","..\\assets\\mainScene\\mainSoundBtnOn.png","..\\assets\\mainScene\\mainSettingBg.png","..\\assets\\mainScene\\mainQuestionBtn.png","..\\assets\\mainScene\\mainMusicBtnOn.png","..\\assets\\mainScene\\mainQuitBtn.png","..\\assets\\mainScene\\mainSoundBtnOff.png","..\\assets\\mainScene\\mainMusicBtnOff.png","..\\assets\\mainScene\\targetNumber9.png","..\\assets\\mainScene\\targetNumber8.png","..\\assets\\mainScene\\targetNumber7.png","..\\assets\\mainScene\\targetNumber6.png","..\\assets\\mainScene\\targetNumber5.png","..\\assets\\mainScene\\targetNumber4.png","..\\assets\\mainScene\\targetNumber3.png","..\\assets\\mainScene\\targetNumber2.png","..\\assets\\mainScene\\targetNumber1.png","..\\assets\\mainScene\\targetNumber0.png","..\\assets\\mainScene\\ele7.png","..\\assets\\mainScene\\ele6.png","..\\assets\\mainScene\\bonusFra9.png","..\\assets\\mainScene\\bonusFra8.png","..\\assets\\mainScene\\bonusFra7.png","..\\assets\\mainScene\\bonusFra6.png","..\\assets\\mainScene\\bonusFra5.png","..\\assets\\mainScene\\bonusFra4.png","..\\assets\\mainScene\\bonusFra3.png","..\\assets\\mainScene\\bonusFra27.png","..\\assets\\mainScene\\bonusFra26.png","..\\assets\\mainScene\\bonusFra25.png","..\\assets\\mainScene\\bonusFra24.png","..\\assets\\mainScene\\bonusFra23.png","..\\assets\\mainScene\\bonusFra22.png","..\\assets\\mainScene\\bonusFra21.png","..\\assets\\mainScene\\bonusFra20.png","..\\assets\\mainScene\\bonusFra2.png","..\\assets\\mainScene\\bonusFra19.png","..\\assets\\mainScene\\bonusFra18.png","..\\assets\\mainScene\\bonusFra17.png","..\\assets\\mainScene\\bonusFra16.png","..\\assets\\mainScene\\bonusFra15.png","..\\assets\\mainScene\\bonusFra14.png","..\\assets\\mainScene\\bonusFra13.png","..\\assets\\mainScene\\bonusFra12.png","..\\assets\\mainScene\\bonusFra11.png","..\\assets\\mainScene\\bonusFra10.png","..\\assets\\mainScene\\bonusFra1.png","..\\assets\\mainScene\\bonusShoot.png","..\\assets\\mainScene\\guideTxt5.png","..\\assets\\mainScene\\guideTxt4.png","..\\assets\\mainScene\\guideTxt3.png","..\\assets\\mainScene\\guideTxt2.png","..\\assets\\mainScene\\guideTxt1.png","..\\assets\\mainScene\\guideKnowBtn.png","..\\assets\\mainScene\\guideBg.png","..\\assets\\mainScene\\propNum9.png","..\\assets\\mainScene\\propNum8.png","..\\assets\\mainScene\\propNum7.png","..\\assets\\mainScene\\propNum6.png","..\\assets\\mainScene\\propNum5.png","..\\assets\\mainScene\\propNum4.png","..\\assets\\mainScene\\propNum3.png","..\\assets\\mainScene\\propNum2.png","..\\assets\\mainScene\\propNum1.png","..\\assets\\mainScene\\propNum0.png","..\\assets\\mainScene\\propNumBg.png","..\\assets\\mainScene\\bonusTime.png","..\\assets\\mainScene\\eleDis19.png","..\\assets\\mainScene\\eleDis18.png","..\\assets\\mainScene\\eleDis17.png","..\\assets\\mainScene\\eleDis16.png","..\\assets\\mainScene\\eleDis15.png","..\\assets\\mainScene\\eleDis14.png","..\\assets\\mainScene\\eleDis13.png","..\\assets\\mainScene\\main_mapbottom.png","..\\assets\\mainScene\\guidePropShoe.png","..\\assets\\mainScene\\guidePropMsgPanel.png","..\\assets\\mainScene\\guidePropHand.png","..\\assets\\mainScene\\guidePropHammer.png","..\\assets\\mainScene\\guidePropCow.png","..\\assets\\mainScene\\guidePropBoom.png","..\\assets\\mainScene\\stepAni9.png","..\\assets\\mainScene\\stepAni8.png","..\\assets\\mainScene\\stepAni7.png","..\\assets\\mainScene\\stepAni6.png","..\\assets\\mainScene\\stepAni5.png","..\\assets\\mainScene\\stepAni4.png","..\\assets\\mainScene\\stepAni3.png","..\\assets\\mainScene\\stepAni2.png","..\\assets\\mainScene\\stepAni11.png","..\\assets\\mainScene\\stepAni10.png","..\\assets\\mainScene\\stepAni1.png","..\\assets\\mainScene\\lockVine.png","..\\assets\\mainScene\\exLighting1.png","..\\assets\\mainScene\\exLighting11.png","..\\assets\\mainScene\\exLighting14.png","..\\assets\\mainScene\\exLighting16.png","..\\assets\\mainScene\\exLighting18.png","..\\assets\\mainScene\\exLighting19.png","..\\assets\\mainScene\\exLighting21.png","..\\assets\\mainScene\\exLighting23.png","..\\assets\\mainScene\\exLighting25.png","..\\assets\\mainScene\\exLighting27.png","..\\assets\\mainScene\\exLighting29.png","..\\assets\\mainScene\\exLighting3.png","..\\assets\\mainScene\\exLighting32.png","..\\assets\\mainScene\\exLighting34.png","..\\assets\\mainScene\\exLighting5.png","..\\assets\\mainScene\\exLighting7.png","..\\assets\\mainScene\\exLighting9.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"main2","version":5,"files":["..\\assets\\mainScene\\yezi1.png","..\\assets\\mainScene\\unlightedStar.png","..\\assets\\mainScene\\targetBoard.png","..\\assets\\mainScene\\stepsBoard.png","..\\assets\\mainScene\\stepNumber9.png","..\\assets\\mainScene\\stepNumber8.png","..\\assets\\mainScene\\stepNumber7.png","..\\assets\\mainScene\\stepNumber6.png","..\\assets\\mainScene\\stepNumber5.png","..\\assets\\mainScene\\stepNumber4.png","..\\assets\\mainScene\\stepNumber3.png","..\\assets\\mainScene\\stepNumber2.png","..\\assets\\mainScene\\stepNumber1.png","..\\assets\\mainScene\\stepNumber0.png","..\\assets\\mainScene\\stepBtn.png","..\\assets\\mainScene\\starProgress.png","..\\assets\\mainScene\\setting.png","..\\assets\\mainScene\\scoreNumber9.png","..\\assets\\mainScene\\scoreNumber8.png","..\\assets\\mainScene\\scoreNumber7.png","..\\assets\\mainScene\\scoreNumber6.png","..\\assets\\mainScene\\scoreNumber5.png","..\\assets\\mainScene\\scoreNumber4.png","..\\assets\\mainScene\\scoreNumber3.png","..\\assets\\mainScene\\scoreNumber2.png","..\\assets\\mainScene\\scoreNumber1.png","..\\assets\\mainScene\\scoreNumber0.png","..\\assets\\mainScene\\rock6.png","..\\assets\\mainScene\\rock5.png","..\\assets\\mainScene\\rock4.png","..\\assets\\mainScene\\rock3.png","..\\assets\\mainScene\\rock2.png","..\\assets\\mainScene\\rock1.png","..\\assets\\mainScene\\rightMark.png","..\\assets\\mainScene\\rightArrow.png","..\\assets\\mainScene\\rectLat.png","..\\assets\\mainScene\\progressDown.png","..\\assets\\mainScene\\magicLionBg.png","..\\assets\\mainScene\\magicLion.png","..\\assets\\mainScene\\lockUp.png","..\\assets\\mainScene\\lockDown.png","..\\assets\\mainScene\\lineLight.png","..\\assets\\mainScene\\lightedStar.png","..\\assets\\mainScene\\leftArrow.png","..\\assets\\mainScene\\ice6.png","..\\assets\\mainScene\\ice5.png","..\\assets\\mainScene\\ice4.png","..\\assets\\mainScene\\ice3.png","..\\assets\\mainScene\\ice2.png","..\\assets\\mainScene\\ice1.png","..\\assets\\mainScene\\hammerBtn.png","..\\assets\\mainScene\\eleDis9.png","..\\assets\\mainScene\\eleDis8.png","..\\assets\\mainScene\\eleDis7.png","..\\assets\\mainScene\\eleDis6.png","..\\assets\\mainScene\\eleDis5.png","..\\assets\\mainScene\\eleDis4.png","..\\assets\\mainScene\\eleDis3.png","..\\assets\\mainScene\\eleDis2.png","..\\assets\\mainScene\\eleDis12.png","..\\assets\\mainScene\\eleDis11.png","..\\assets\\mainScene\\eleDis10.png","..\\assets\\mainScene\\eleDis1.png","..\\assets\\mainScene\\ele5.png","..\\assets\\mainScene\\ele42.png","..\\assets\\mainScene\\ele41.png","..\\assets\\mainScene\\ele40.png","..\\assets\\mainScene\\ele4.png","..\\assets\\mainScene\\ele32.png","..\\assets\\mainScene\\ele31.png","..\\assets\\mainScene\\ele30.png","..\\assets\\mainScene\\ele3.png","..\\assets\\mainScene\\ele22.png","..\\assets\\mainScene\\ele21.png","..\\assets\\mainScene\\ele20.png","..\\assets\\mainScene\\ele2.png","..\\assets\\mainScene\\ele12.png","..\\assets\\mainScene\\ele11.png","..\\assets\\mainScene\\ele10.png","..\\assets\\mainScene\\ele1.png","..\\assets\\mainScene\\ele02.png","..\\assets\\mainScene\\ele01.png","..\\assets\\mainScene\\ele00.png","..\\assets\\mainScene\\ele0.png","..\\assets\\mainScene\\dangqianfenshu.png","..\\assets\\mainScene\\chooseRect.png","..\\assets\\mainScene\\boomBtn.png","..\\assets\\mainScene\\boom9.png","..\\assets\\mainScene\\boom8.png","..\\assets\\mainScene\\boom7.png","..\\assets\\mainScene\\boom6.png","..\\assets\\mainScene\\boom5.png","..\\assets\\mainScene\\boom4.png","..\\assets\\mainScene\\boom3.png","..\\assets\\mainScene\\boom2.png","..\\assets\\mainScene\\boom18.png","..\\assets\\mainScene\\boom17.png","..\\assets\\mainScene\\boom16.png","..\\assets\\mainScene\\boom15.png","..\\assets\\mainScene\\boom14.png","..\\assets\\mainScene\\boom13.png","..\\assets\\mainScene\\boom12.png","..\\assets\\mainScene\\boom11.png","..\\assets\\mainScene\\boom10.png","..\\assets\\mainScene\\boom1.png","..\\assets\\mainScene\\mainSoundBtnOn.png","..\\assets\\mainScene\\mainSettingBg.png","..\\assets\\mainScene\\mainQuestionBtn.png","..\\assets\\mainScene\\mainMusicBtnOn.png","..\\assets\\mainScene\\mainQuitBtn.png","..\\assets\\mainScene\\mainSoundBtnOff.png","..\\assets\\mainScene\\mainMusicBtnOff.png","..\\assets\\mainScene\\targetNumber9.png","..\\assets\\mainScene\\targetNumber8.png","..\\assets\\mainScene\\targetNumber7.png","..\\assets\\mainScene\\targetNumber6.png","..\\assets\\mainScene\\targetNumber5.png","..\\assets\\mainScene\\targetNumber4.png","..\\assets\\mainScene\\targetNumber3.png","..\\assets\\mainScene\\targetNumber2.png","..\\assets\\mainScene\\targetNumber1.png","..\\assets\\mainScene\\targetNumber0.png","..\\assets\\mainScene\\ele7.png","..\\assets\\mainScene\\ele6.png","..\\assets\\mainScene\\bonusFra9.png","..\\assets\\mainScene\\bonusFra8.png","..\\assets\\mainScene\\bonusFra7.png","..\\assets\\mainScene\\bonusFra6.png","..\\assets\\mainScene\\bonusFra5.png","..\\assets\\mainScene\\bonusFra4.png","..\\assets\\mainScene\\bonusFra3.png","..\\assets\\mainScene\\bonusFra27.png","..\\assets\\mainScene\\bonusFra26.png","..\\assets\\mainScene\\bonusFra25.png","..\\assets\\mainScene\\bonusFra24.png","..\\assets\\mainScene\\bonusFra23.png","..\\assets\\mainScene\\bonusFra22.png","..\\assets\\mainScene\\bonusFra21.png","..\\assets\\mainScene\\bonusFra20.png","..\\assets\\mainScene\\bonusFra2.png","..\\assets\\mainScene\\bonusFra19.png","..\\assets\\mainScene\\bonusFra18.png","..\\assets\\mainScene\\bonusFra17.png","..\\assets\\mainScene\\bonusFra16.png","..\\assets\\mainScene\\bonusFra15.png","..\\assets\\mainScene\\bonusFra14.png","..\\assets\\mainScene\\bonusFra13.png","..\\assets\\mainScene\\bonusFra12.png","..\\assets\\mainScene\\bonusFra11.png","..\\assets\\mainScene\\bonusFra10.png","..\\assets\\mainScene\\bonusFra1.png","..\\assets\\mainScene\\bonusShoot.png","..\\assets\\mainScene\\guideTxt5.png","..\\assets\\mainScene\\guideTxt4.png","..\\assets\\mainScene\\guideTxt3.png","..\\assets\\mainScene\\guideTxt2.png","..\\assets\\mainScene\\guideTxt1.png","..\\assets\\mainScene\\guideKnowBtn.png","..\\assets\\mainScene\\guideBg.png","..\\assets\\mainScene\\propNum9.png","..\\assets\\mainScene\\propNum8.png","..\\assets\\mainScene\\propNum7.png","..\\assets\\mainScene\\propNum6.png","..\\assets\\mainScene\\propNum5.png","..\\assets\\mainScene\\propNum4.png","..\\assets\\mainScene\\propNum3.png","..\\assets\\mainScene\\propNum2.png","..\\assets\\mainScene\\propNum1.png","..\\assets\\mainScene\\propNum0.png","..\\assets\\mainScene\\propNumBg.png","..\\assets\\mainScene\\bonusTime.png","..\\assets\\mainScene\\eleDis19.png","..\\assets\\mainScene\\eleDis18.png","..\\assets\\mainScene\\eleDis17.png","..\\assets\\mainScene\\eleDis16.png","..\\assets\\mainScene\\eleDis15.png","..\\assets\\mainScene\\eleDis14.png","..\\assets\\mainScene\\eleDis13.png","..\\assets\\mainScene\\main_mapbottom.png","..\\assets\\mainScene\\guidePropShoe.png","..\\assets\\mainScene\\guidePropMsgPanel.png","..\\assets\\mainScene\\guidePropHand.png","..\\assets\\mainScene\\guidePropHammer.png","..\\assets\\mainScene\\guidePropCow.png","..\\assets\\mainScene\\guidePropBoom.png","..\\assets\\mainScene\\stepAni9.png","..\\assets\\mainScene\\stepAni8.png","..\\assets\\mainScene\\stepAni7.png","..\\assets\\mainScene\\stepAni6.png","..\\assets\\mainScene\\stepAni5.png","..\\assets\\mainScene\\stepAni4.png","..\\assets\\mainScene\\stepAni3.png","..\\assets\\mainScene\\stepAni2.png","..\\assets\\mainScene\\stepAni11.png","..\\assets\\mainScene\\stepAni10.png","..\\assets\\mainScene\\stepAni1.png","..\\assets\\mainScene\\lockVine.png","..\\assets\\mainScene\\exLighting1.png","..\\assets\\mainScene\\exLighting11.png","..\\assets\\mainScene\\exLighting14.png","..\\assets\\mainScene\\exLighting16.png","..\\assets\\mainScene\\exLighting18.png","..\\assets\\mainScene\\exLighting19.png","..\\assets\\mainScene\\exLighting21.png","..\\assets\\mainScene\\exLighting23.png","..\\assets\\mainScene\\exLighting25.png","..\\assets\\mainScene\\exLighting27.png","..\\assets\\mainScene\\exLighting29.png","..\\assets\\mainScene\\exLighting3.png","..\\assets\\mainScene\\exLighting32.png","..\\assets\\mainScene\\exLighting34.png","..\\assets\\mainScene\\exLighting5.png","..\\assets\\mainScene\\exLighting7.png","..\\assets\\mainScene\\exLighting9.png"]}
\ No newline at end of file
......@@ -89,17 +89,8 @@
"name": "signprize"
},
{
<<<<<<< HEAD
"keys": "namebg_png,avatar_png,invite_txtbg_png,invite_icon_png,taskicon_png,friend_avatar_png,ad_icon_png,testavatar_png",
"name": "preload"
},
{
"keys": "invite_bg_png,invite_help_png,invite_invite_png,invite_rule_bg_png,invite_btn_png,invite_prize_ad_png,invite_prize_bg_png,invite_prize_btn_png",
"name": "invite"
=======
"name": "preload",
"keys": "namebg_png,avatar_png,invite_txtbg_png,invite_icon_png,taskicon_png,friend_avatar_png,ad_icon_png,testavatar_png,friend按钮-炫耀_png,friend_icon1_png,friend_icon2_png,friend_icon3_png,friend_itembg_png,friendbg_png,ad_closebtn_png,startpanel_icon1_png,startpanel_icon2_png,startpanel_icon3_png,startpanel_icon_png,startpanel_avatar_png,startpanel_bg2_png"
>>>>>>> e4972da2d589501b0f375aac75d85b8acfb74408
}
],
"resources": [
......
......@@ -2,6 +2,7 @@
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/ADSmallSkin.exml",
"resource/skins/AvatarSkin.exml",
"resource/skins/AlertSkin.exml",
"resource/skins/Blood2Skin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ADSmallSkin" width="582" height="203" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16db4bf413f"/>
<e:Image source="common_adbg_png"/>
<e:Image y="57" horizontalCenter="0" width="493" height="111" source="{data.img}" anchorOffsetY="0"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="BackSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui">
<e:Component y="710.52" skinName="ADSmallSkin" horizontalCenter="0"/>
<e:Image source="闯关失败_png" y="27" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="609" y="197">
<e:skinName>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="Box2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16ccc954c14"/>
<e:Component y="739.52" skinName="ADSmallSkin" horizontalCenter="0"/>
<e:Image y="33.76" horizontalCenter="0" source="box2_bg_png"/>
<e:Button id="closeBtn" label="" x="601.94" y="195.3">
<e:skinName>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="BoxSkin" width="750" height="1205" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16cc233ca3b"/>
<e:Component y="739.52" skinName="ADSmallSkin" horizontalCenter="0"/>
<e:Image source="boxbg_png" y="33.76" horizontalCenter="0"/>
<e:Image id="img" y="355" touchEnabled="true" source="{data.img}" width="512" height="240" scaleX="0.9" scaleY="0.9" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="604.96" y="190.84">
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="FailSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="闯关失败_png" y="27" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="609" y="197">
<e:Component y="674.52" skinName="ADSmallSkin" horizontalCenter="0"/>
<e:Image source="闯关失败_png" y="-8" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="609" y="162">
<e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
......@@ -9,7 +10,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="againBtn" label="" y="556" horizontalCenter="0">
<e:Button id="againBtn" label="" y="521" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="按钮 副本 9_png" source.down="按钮 副本 9_png" source.disabled="按钮 副本 9_png"/>
......
......@@ -51,7 +51,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="recordBtn" label="" x="620.14" y="389.91">
<e:Button id="recordBtn" label="" x="620.14" y="255.91">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="recordbtn_png" source.down="recordbtn_png" source.disabled="recordbtn_png"/>
......@@ -59,7 +59,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="signBtn" label="" x="608.69" y="520.57" scaleX="0.9" scaleY="0.9">
<e:Button id="signBtn" label="" x="608.69" y="383.57" scaleX="0.9" scaleY="0.9">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="map_signicon_png" source.down="map_signicon_png" source.disabled="recordbtn_png"/>
......@@ -67,6 +67,16 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Group id="friendBtn" x="13.56" y="126.88" width="171" height="120">
<e:Image source="avatar_png" y="0" horizontalCenter="0"/>
<e:Group x="38.5" y="10">
<e:Image id="avatar" y="0" source="testavatar_png" width="96" height="96" x="0"/>
<e:Rect id="avatarMask" width="96" height="96" x="0" y="0" ellipseWidth="96" ellipseHeight="96"/>
</e:Group>
<e:Image source="namebg_png" horizontalCenter="-4" bottom="-4"/>
<e:Label id="nameTxt" text="La121233bel" y="91.5" size="20" horizontalCenter="1"/>
</e:Group>
<e:Image id="adBtn" y="519.02" source="ad_icon_png" right="12"/>
<e:Button id="taskBtn" label="" x="572.62" y="248.51" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
......@@ -148,15 +158,5 @@
</e:Group>
<e:Label text="点击开宝箱" y="791" size="37" horizontalCenter="0" bold="true"/>
</e:Group>
<e:Group id="friendBtn" x="13.56" y="126.88" width="171" height="120">
<e:Image source="avatar_png" y="0" horizontalCenter="0"/>
<e:Group x="38.5" y="10">
<e:Image id="avatar" y="0" source="testavatar_png" width="96" height="96" x="0"/>
<e:Rect id="avatarMask" width="96" height="96" x="0" y="0" ellipseWidth="96" ellipseHeight="96"/>
</e:Group>
<e:Image source="namebg_png" horizontalCenter="-4" bottom="-4"/>
<e:Label id="nameTxt" text="La121233bel" y="91.5" size="20" horizontalCenter="1"/>
</e:Group>
<e:Image id="adBtn" y="648.02" source="ad_icon_png" right="12"/>
<w:Config id="16c89f4ae1a"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="NoPrizeSkin" width="750" height="1000" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Component y="735.52" skinName="ADSmallSkin" horizontalCenter="0"/>
<e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/>
<e:Image y="109.55" source="擦肩而过弹窗 _png" horizontalCenter="0.5"/>
<e:Button id="closeBtn" label="" x="617" y="279">
......
......@@ -54,6 +54,7 @@ import { StepAni } from '../something/anis/StepAni';
import { updateMainTimerAfterGetData } from '../../libs/new_wx/MainBase';
import wait from '../../libs/new_tc/wait';
import { GameGuide } from './GameGuide';
import { AiControl } from '../something/logic/AiControl';
// tslint:disable: no-var-keyword
// tslint:disable: prefer-const
// tslint:disable: cyclomatic-complexity
......@@ -153,7 +154,8 @@ export default class MainScene extends Scene {
scoreAnis: ScoreAni[] = [];
//每一步生成的总分数
oneStepScore: number;
//果冻有消除的标记;
jellyBrokeMark: boolean
//皮肤上的
public starProgress: eui.Image;
public scoreTxt: eui.Label;
......@@ -213,7 +215,7 @@ export default class MainScene extends Scene {
super.start();
//第几关
this.chapter = (data && data.chapter) ? data.chapter : 1;
// this.chapter = 24;
// this.chapter = 81;
this.chapterTxt.text = "第" + this.chapter + "关";
//关卡数据,1期定制,70,后面35关地图一致,步数减少
var mapDataIndex = this.chapter;
......@@ -276,35 +278,9 @@ export default class MainScene extends Scene {
this.drawLollipopHole();
}
//AiControl初始化,用于判断格子中是否有果冻,是否有鸡蛋,必须在初始化元素后执行
AiControl.ins.init(this.lattices);
//引导提示
var guideImageNum: number;
// 15678是操作引导
/*const chapterToGuideNum = {
1: 1,
5: 2,
6: 3,
7: 4,
8: 5,
10: 8,
19: 6,
24: 7,
}
guideImageNum = chapterToGuideNum[this.chapter];
if (guideImageNum && !readCache(getCacheKey() + guideImageNum)) {
Loading2.instace.show()
let g = new GuideMsg();
g.init(
guideImageNum,
() => {
Loading2.instace.hide()
this.addChild(g);
},
() => {
Loading2.instace.hide()
})
}*/
//游戏引导
const gameGuideChapterNum = [1, 5, 6, 7, 8, 9, 10, 19, 24]
if (gameGuideChapterNum.indexOf(this.chapter >> 0) > -1) {
......@@ -473,123 +449,6 @@ export default class MainScene extends Scene {
this.bonusTime.x = 375;
this.bonusTime.y = 600;
}
//初始化格子
initLattices1() {
var latticesD = this.chapterData.map.lattices;
var generateLats = this.chapterData.map.generateLats;
this.lattices = [];
for (var i = 0; i < latticesD.length; i++) {
if (!latticesD[i]) continue;
//记录最下一层的行数
var rc = Tool.indexToRc(i);
this.endRowNum = rc[0] > this.endRowNum ? rc[0] : this.endRowNum;
this.lattices[i] = Pool.takeOut(RecoverName.LATTICE);
if (!this.lattices[i]) {
this.lattices[i] = new Lattice(i);
} else {
this.lattices[i].reset(i);
}
//如果是生成口
if (generateLats.indexOf(i) >= 0) {
this.lattices[i].isGenerate = true;
}
var p = Tool.getPositionByIndex(i);
switch (latticesD[i]) {
//基础元素,浅冰块,深冰块,枷锁
case 1:
case 2:
case 3:
case 6:
var type = Tool.returnType(i, this.lattices, this.chapterData.baseElementTypes);
let ele: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!ele) {
ele = new Element(type)
} else {
ele.reset(type)
}
ele.x = p[0];
ele.y = p[1];
this.elementContainer.addChild(ele);
this.lattices[i].element = ele;
//加特效
if (Math.random() < this.chapterData.effectInitProbability) {
ele.effectType = Tool.randomT([0, 1, 2, 3])
if (ele.effectType == EffectType.MAGICLION) {
this.elementContainer.addChildAt(ele, 0);
}
}
//冰块
if (latticesD[i] == 2 || latticesD[i] == 3) {
let ice = Pool.takeOut(RecoverName.ICE);
if (!ice) {
ice = new Ice(latticesD[i] - 1);
} else {
ice.reset(latticesD[i] - 1);
}
this.map.addChild(ice);
this.lattices[i].ice = ice;
ice.x = p[0] - 80 / 2;
ice.y = p[1] - 81 / 2;
}
//枷锁
else if (latticesD[i] == 6) {
ele.isLock = true;
}
break;
//棒棒糖
case 4:
this.lollipopCount++;
let lol: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!lol) {
lol = new Element(ElementType.LOLLIPOP)
} else {
lol.reset(ElementType.LOLLIPOP)
}
lol.x = p[0];
lol.y = p[1];
this.elementContainer.addChild(lol);
this.lattices[i].element = lol;
break;
//石头
case 5:
let rock: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!rock) {
rock = new Element(ElementType.ROCK)
} else {
rock.reset(ElementType.ROCK)
}
rock.x = p[0];
rock.y = p[1];
this.elementContainer.addChild(rock);
this.lattices[i].element = rock;
break;
}
}
//联通口
var connectedLats = this.chapterData.map.connectedLats || [];
for (var i = 0; i < connectedLats.length; i++) {
var connectedLat = connectedLats[i];
this.lattices[connectedLat[0]].down = connectedLat[1];
this.lattices[connectedLat[1]].up = connectedLat[0];
}
//第35和56,要枷锁元素,定制,2期去掉
if (this.chapter == 35 || this.chapter == 56) {
var locks = [4, 13, 22, 31, 40, 49, 57, 58, 59, 66, 67, 68, 75, 76, 77, 63, 64, 72, 73, 70, 71, 79, 80];
for (var aaa = 0; aaa < locks.length; aaa++) {
this.lattices[locks[aaa]].element.isLock = true;
}
}
//初始化完先检测死图
this.warningCop = Tool.dieMapCheck(this.lattices);
if (!this.warningCop) {
//替换顺序
this.upsetElement();
}
else {
this.enableMouseEvt(true);
}
}
endRowNumHash;
initLattices() {
this.endRowNumHash = {};
......@@ -705,6 +564,14 @@ export default class MainScene extends Scene {
this.elementContainer.addChild(rock);
this.lattices[i].element = rock;
break;
//果冻
case 5:
let jelly: Element = Tool.getElement(ElementType.JELLY)
jelly.x = p[0];
jelly.y = p[1];
this.elementContainer.addChild(jelly);
this.lattices[i].element = jelly;
break;
default:
//其他标识按空元素记
this.emptys.push(i);
......@@ -1024,7 +891,7 @@ export default class MainScene extends Scene {
this.isShowWarning = false;
this.noActionCount = 0;
this.resetWarning();
if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
if (!Tool.judgeChosen(e.target.parent)) return
// console.log(e.target.parent)
if (self.SELECTED && Tool.checkNeb(e.target.parent, self.SELECTED)) {
self.exchangeElementAni(self.SELECTED, e.target.parent, self.callbackEx);
......@@ -1043,7 +910,8 @@ export default class MainScene extends Scene {
}
mouseMoveE(e) {
if (this.SELECTED && e.target.parent instanceof Element) {
if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
if (!Tool.judgeChosen(e.target.parent)) return
// if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
if (Tool.checkNeb(e.target.parent, this.SELECTED)) {
this.exchangeElementAni(this.SELECTED, e.target.parent, this.callbackEx);
this.SELECTED.removeChild(this.choosed);
......@@ -1143,9 +1011,9 @@ export default class MainScene extends Scene {
})
}
} else {
this.fallVerAni(anis, () => {
this.fallAni(anis, () => {
this.fall(callback)
})
}, true)
}
} else {
var anis = this.fallVertical();
......@@ -1357,83 +1225,18 @@ export default class MainScene extends Scene {
return anis
}
private fallSkew() {
//记录一个对象和位置信息[obj,index]的数组,如果obj是null则生成,index位置上方
var anis = [];
var emptys = this.emptys;
//排序从小到大
emptys.sort(function (a, b) { return a > b ? 1 : -1 })
for (var i = emptys.length - 1; i >= 0; i--) {
var indexMy = emptys[i];
var lat = this.lattices[indexMy];
//判断是否是生成口
if (lat.isGenerate) {
//是生成口,就不用管落下乐
anis.push([null, indexMy])
//去掉
emptys.splice(i, 1);
//优先判断生成的,不用管掉落了,跳下一个
continue
}
let latFall;
let indexFall;
//找正上方是否有能掉落的。
var latUp = this.lattices[indexMy - Tool.colNum];
//上方格子为null,或格子上元素为null
if (Tool.judgeFall(latUp)) {
latFall = latUp;
indexFall = indexMy - Tool.colNum;
}
//找联通的up,一期没有复杂的联通,所以动画不用特殊处理
else if (lat.up) {
var latUnUp = this.lattices[lat.up];
if (Tool.judgeFall(latUnUp)) {
latFall = latUnUp;
indexFall = lat.up;
}
}
//找左上
if (!latFall && Tool.indexToRc(indexMy)[1] != 0) {
var latLeftUp = this.lattices[indexMy - Tool.colNum - 1];
if (Tool.judgeFall(latLeftUp)) {
latFall = latLeftUp;
indexFall = indexMy - Tool.colNum - 1;
}
}
//找右上
if (!latFall && Tool.indexToRc(indexMy)[1] != Tool.colNum - 1) {
var latRightUp = this.lattices[indexMy - Tool.colNum + 1];
if (Tool.judgeFall(latRightUp)) {
latFall = latRightUp;
indexFall = indexMy - Tool.colNum + 1;
}
}
//如果latFall存在
if (latFall) {
//能掉落,记录元素动画
anis.push([latFall.element, indexMy]);
//去掉
emptys.splice(i, 1);
//在剩下emptys的加上一个,正上方的那个
// Tool.insert(indexFall, emptys)
emptys.push(indexFall)
//掉落的格子上的元素致null
latFall.element = null;
//长度加了,多加+
i++;
}
}
return anis
}
/**
* 执行掉落动画
* @param anis 数组,0是元素,1是目标位置索引,2是掉落层数
* @param emptys
* @param callback
*/
fallAni(anis: any[], callback: Function) {
// playSound(SoundType.fall);
fallAni(anis: any[], callback: Function, isVertical: boolean = false) {
var deltaTime = 100;
if (isVertical) {
playSound(SoundType.fall);
deltaTime = 150
}
let count = 0;
let countAll = anis.length;
for (let i = 0; i < anis.length; i++) {
......@@ -1468,7 +1271,7 @@ export default class MainScene extends Scene {
obj.fallAni()
//执行Tween
egret.Tween.get(obj)
.to({ x: position[0], y: position[1] }, 100/*, egret.Ease.cubicOut*/)
.to({ x: position[0], y: position[1] }, deltaTime * rowCount/*, egret.Ease.cubicOut*/)
.call(() => {
obj.x = position[0];
obj.y = position[1];
......@@ -1491,46 +1294,7 @@ export default class MainScene extends Scene {
}
}
fallVerAni(anis: any[], callback: Function) {
playSound(SoundType.fall);
var maxCount = anis["maxCount"] || 1;
// console.log(maxCount)
let count = 0;
let countAll = anis.length;
for (let i = 0; i < anis.length; i++) {
let obj: Element = anis[i][0];
let index = anis[i][1];
let rowCount = anis[i][2] || 1;
let position = Tool.getPositionByIndex(index);
//现在得位置的赋值
var lat = this.lattices[index];
lat.element = obj;
obj.fallAni()
//执行Tween
egret.Tween.get(obj)
.to({ x: position[0], y: position[1] }, 150 * rowCount/*, egret.Ease.cubicOut*/)
.call(() => {
obj.x = position[0];
obj.y = position[1];
//查看每个掉落的obj是否有冰淇淋,并且index是底部的索引,如果是,掉落完后,该格置空,加入emptys,并且需要掉落冰淇淋判断
if (obj.type == ElementType.LOLLIPOP && Tool.indexToRc(index)[0] == this.endRowNum) {
this.recoverEle(index);
this.lollipopCount--;
//通关目标还有棒棒糖,并且,图中不足,下次需要生成
if (this.passElements &&
this.passElements[ElementType.LOLLIPOP] &&
this.lollipopCount < this.passElements[ElementType.LOLLIPOP]) {
this.lollipopMark = true
}
}
count++;
if (count == countAll) {
callback()
}
})
}
}
/**
* 只关心交换后元素的可消除
* 或者冰淇淋的掉落
......@@ -1766,24 +1530,36 @@ export default class MainScene extends Scene {
playSound(SoundType.fail);
PanelCtrl.instance.show("failed", { level: this.chapter });
} else {
//检查死图
this.warningCop = Tool.dieMapCheck(this.lattices);
if (!this.warningCop) {
//死图。替换顺序,出toast
showToast("没有可以消除的元素")
// PanelCtrl.instance.show(ModuleTypes.TOAST_PANEL, { msg: "没有可以消除的元素", isHideMask: true })
setTimeout(() => {
this.upsetElement()
}, 1000)
} else {
//如果还有游戏引导
if (this.gameGuide) {
this.addChild(this.gameGuide)
this.gameGuide.show()
};
//允许移动
this.enableMouseEvt(true)
}
//额外加一步ai的操作,然后再执行检查死图
AiControl.ins.aiMotion(this, () => {
//检查死图
this.warningCop = Tool.dieMapCheck(this.lattices);
if (!this.warningCop) {
//检查一边是否已死
if (Tool.alreadyDie(this.lattices)) {
showToast("元素已无法消除")
setTimeout(() => {
playSound(SoundType.fail);
PanelCtrl.instance.show("failed", { level: this.chapter });
}, 1000)
} else {
//死图。替换顺序,出toast
showToast("没有可以消除的元素")
// PanelCtrl.instance.show(ModuleTypes.TOAST_PANEL, { msg: "没有可以消除的元素", isHideMask: true })
setTimeout(() => {
this.upsetElement()
}, 1000)
}
} else {
//如果还有游戏引导
if (this.gameGuide) {
this.addChild(this.gameGuide)
this.gameGuide.show()
};
//允许移动
this.enableMouseEvt(true)
}
})
}
}
});
......@@ -1817,9 +1593,10 @@ export default class MainScene extends Scene {
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat)) {
this.eliminatedElements.push(i);
//本来没必要判断特效组合时是否有重复的消除元素,但是recoverEle里会有判断石头或果冻的加入,造成重复
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
//两个魔力鸟分数MM
if (!lat.element.isLock/*&&lat.element.effectType==null*/) {
if (!lat.element.isLock && lat.element.type <= 4/*&&lat.element.effectType==null*/) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.MM, Tool.getPositionByIndex(i))
}
}
......@@ -1854,7 +1631,8 @@ export default class MainScene extends Scene {
var lat = this.lattices[i];
if (Tool.judgeMatch(lat) &&
lat.element.type == other.type) {
this.eliminatedElements.push(i);
//一个魔力鸟时其实不用加,因为石头或果冻的不会进入判断
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
//如果other带特效,符合的元素都加上特效,没动效,直接加吧先,
if (other.effectType != null) {
if (other.effectType == EffectType.EXPLOSIVE) {
......@@ -1889,8 +1667,8 @@ export default class MainScene extends Scene {
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) && (lat.row == lat1.row || lat.column == lat1.column)) {
this.eliminatedElements.push(i);
if (!lat.element.isLock) {
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
if (!lat.element.isLock && lat.element.type <= 4) {
//线与线
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.LL, Tool.getPositionByIndex(i))
}
......@@ -1913,8 +1691,8 @@ export default class MainScene extends Scene {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) &&
(Math.abs(lat.row - lat1.row) < 2 || Math.abs(lat.column - lat1.column) < 2)) {
this.eliminatedElements.push(i);
if (!lat.element.isLock) {
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
if (!lat.element.isLock && lat.element.type <= 4) {
//线和炸弹
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.EL, Tool.getPositionByIndex(i))
}
......@@ -1938,8 +1716,8 @@ export default class MainScene extends Scene {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) &&
(Math.abs(lat.row - lat1.row) < 3 && Math.abs(lat.column - lat1.column) < 3)) {
this.eliminatedElements.push(i);
if (!lat.element.isLock) {
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
if (!lat.element.isLock && lat.element.type <= 4) {
//两个炸弹
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.EE, Tool.getPositionByIndex(i))
}
......@@ -1970,6 +1748,7 @@ export default class MainScene extends Scene {
}
/**
* 普通元素消除,先消除无特效的,有特效的存下,然后触发,找下一步消除的元素
* 加入石头,果冻,鸡蛋
*/
commonEliminate(): number[] {
playSound(SoundType.eliminate)
......@@ -1981,7 +1760,10 @@ export default class MainScene extends Scene {
//不用判断是否存在元素了吧
var ele = lat.element;
var p = Tool.getPositionByIndex(index);
if (ele.isLock) {
if (!ele) {
//以防万一还是判断一次
}
else if (ele.isLock) {
//被禁锢的解开
ele.isLock = false;
}
......@@ -1999,10 +1781,29 @@ export default class MainScene extends Scene {
this.iceBroke(this.lattices[index]);
//如果格子附近有石头
this.rokeBroke(this.lattices[index]);
//如果格子附近有果冻
this.jellyBroke(this.lattices[index]);
//如果附近有鸡蛋
this.eggBroke(this.lattices[index])
} else {
//单纯元素消失特效
this.playAni(RecoverName.ELEDIS_ANI, p)
this.recoverEle(index)
if (ele.type <= 4) {
this.playAni(RecoverName.ELEDIS_ANI, p)
this.recoverEle(index)
}
//石头
else if (ele.type == ElementType.ROCK) {
this.removeRoke(index);
}
//果冻
else if (ele.type == ElementType.JELLY) {
this.removeJelly(index);
}
//鸡蛋
else if (ele.type == ElementType.CHICKEN_EGG) {
//额外逻辑,鸡蛋动效,或者累计小鸡数量
}
}
}
//从消除列表移除
......@@ -2072,7 +1873,7 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
this.eliminatedElements.push(i);
//
if (!this.lattices[i].element.isLock) {
if (!this.lattices[i].element.isLock && this.lattices[i].element.type <= 4) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["2"], Tool.getPositionByIndex(i))
}
}
......@@ -2091,7 +1892,7 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein);
//
if (!this.lattices[ein].element.isLock) {
if (!this.lattices[ein].element.isLock && this.lattices[ein].element.type <= 4) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["0"], Tool.getPositionByIndex(ein))
}
}
......@@ -2110,7 +1911,7 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein);
//
if (!this.lattices[ein].element.isLock) {
if (!this.lattices[ein].element.isLock && this.lattices[ein].element.type <= 4) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["1"], Tool.getPositionByIndex(ein))
}
}
......@@ -2270,8 +2071,7 @@ export default class MainScene extends Scene {
var lat = this.lattices[i];
if (lat &&
lat.element &&
lat.element.type != ElementType.ROCK &&
lat.element.type != ElementType.LOLLIPOP &&
lat.element.type <= 4 &&
!lat.element.isLock) {
lats.push(lat)
}
......@@ -2319,7 +2119,7 @@ export default class MainScene extends Scene {
}
/**
* 该方法基本用于消除的时候,有时异步的时候不用
* 该方法基本用于消除的时候,有时异步的时候不用,只用于基本元素和特效和棒棒糖
* 添加进emptys
* 置空格子的element,
* 从容器移除
......@@ -2342,6 +2142,10 @@ export default class MainScene extends Scene {
this.iceBroke(this.lattices[index]);
//如果附近有石头
this.rokeBroke(this.lattices[index]);
//如果附近有果冻
this.jellyBroke(this.lattices[index]);
//如果附近有鸡蛋
this.eggBroke(this.lattices[index])
}
//计算元素消除个数
this.goElementTarget(ele);
......@@ -2525,22 +2329,106 @@ export default class MainScene extends Scene {
if (lat &&
lat.element &&
lat.element.type == ElementType.ROCK) {
//回收
let ele = lat.element;
//添加进emptys
this.emptys.push(index)
//从容器移除
this.elementContainer.removeChild(ele);
//回收元素
Pool.recover(RecoverName.ELEMENT, ele);
//置空格子的element,
lat.element = null;
//播放动效
this.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index))
// this.removeRoke(index)
//添加进消除队列,注意重复
if (this.eliminatedElements.indexOf(index) == -1) this.eliminatedElements.push(index)
}
}
}
/**
* 附近是否有果冻
* @param lat 格子
*/
jellyBroke(lat: Lattice) {
var indexMy = lat.index;
//判断上下左右是否有果冻
var indexs = [
indexMy - Tool.colNum,
indexMy + Tool.colNum,
]
if (lat.column > 0) {
indexs.push(indexMy - 1)
}
if (lat.column < Tool.colNum - 1) {
indexs.push(indexMy + 1)
}
for (let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
if (lat &&
lat.element &&
lat.element.type == ElementType.JELLY) {
// this.removeJelly(index)
//添加进消除队列,注意重复
if (this.eliminatedElements.indexOf(index) == -1) this.eliminatedElements.push(index)
}
}
}
/**
* 附近是否有鸡蛋
* @param lat
*/
eggBroke(lat: Lattice) {
var indexMy = lat.index;
//判断上下左右是否有果冻
var indexs = [
indexMy - Tool.colNum,
indexMy + Tool.colNum,
]
if (lat.column > 0) {
indexs.push(indexMy - 1)
}
if (lat.column < Tool.colNum - 1) {
indexs.push(indexMy + 1)
}
for (let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
if (lat &&
lat.element &&
lat.element.type == ElementType.CHICKEN_EGG) {
//添加进消除队列,注意重复
if (this.eliminatedElements.indexOf(index) == -1) this.eliminatedElements.push(index)
}
}
}
/**
* 石头的移除,包括动效
* @param index
*/
removeRoke(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.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index))
}
/**
* 果冻的移除,包括动效
* @param index
*/
removeJelly(index: number) {
this.jellyBrokeMark = true;
//回收
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.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index))
}
/**
* 禁用与开启事件
* 暂时只禁止道具及元素的
......
import ComponentBase from "../../libs/new_wx/components/ComponentBase";
export default class AdSmallComp extends ComponentBase {
start(data?) {
this.touchEnabled=this.touchChildren=false;
super.start(data);
}
get skinKey(): string { return 'ADSmall' }
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ export default class MapScene extends Scene {
this['avatar'].mask = this['avatarMask'];
setTimeout(() => {
PanelCtrl.instance.show('StartPanel',1);
// PanelCtrl.instance.show('StartPanel',1);
}, 1000);
if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
......
......@@ -2941,7 +2941,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0.3,
stepCount: 14+6+5,
stepCount: 14 + 6 + 5,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -2986,7 +2986,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0.03,
stepCount: 20+6,
stepCount: 20 + 6,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -3031,7 +3031,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.02,
stepCount: 15+5,
stepCount: 15 + 5,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -3076,7 +3076,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 20+4,
stepCount: 20 + 4,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -3121,7 +3121,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.03,
stepCount: 20+5,
stepCount: 20 + 5,
passTarget: {
type: PassType.SCORE_TARGET,
score: 15000
......@@ -3161,7 +3161,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.03,
stepCount: 20+4,
stepCount: 20 + 4,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -3206,7 +3206,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.03,
stepCount: 15+5,
stepCount: 15 + 5,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -3251,7 +3251,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.03,
stepCount: 20+4,
stepCount: 20 + 4,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -3296,7 +3296,7 @@ export const Chapters: ChapterData[] = [
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.02,
stepCount: 25+3,
stepCount: 25 + 3,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
......@@ -3312,4 +3312,50 @@ export const Chapters: ChapterData[] = [
15000
]
},
//第八十一关
{
map: {
lattices: [
0, 3, 0, 3, 0, 3, 0, 3, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3,
0, 3, 3, 3, 3, 3, 3, 3, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3,
0, 3, 3, 3, 3, 3, 3, 3, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3,
0, 3, 3, 3, 3, 3, 3, 3, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3,
0, 3, 0, 3, 0, 3, 0, 3, 0,
],
generateLats: [0, 1, 0, 1, 0, 1, 0, 1, 0],
elements: [
0, 1, 0, 1, 0, 1, 0, 1, 0,
5, 1, 1, 1, 1, 1, 1, 1, 5,
0, 1, 1, 1, 1, 1, 1, 1, 0,
2, 1, 1, 1, 1, 1, 1, 1, 2,
0, 1, 1, 1, 1, 1, 1, 1, 0,
2, 1, 1, 1, 1, 1, 1, 1, 2,
0, 1, 1, 1, 1, 1, 1, 1, 0,
5, 1, 1, 1, 1, 1, 1, 1, 5,
0, 5, 0, 5, 0, 5, 0, 5, 0,
],
},
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0.02,
stepCount: 250 + 3,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 65
}
],
},
starScores: [
4000,
8000,
15000
]
},
]
\ No newline at end of file
......@@ -207,8 +207,11 @@ export class Tool {
if (!lat || !lat.element) {
return false
}
//上方元素为石头,或元素为锁定
else if (lat.element.type == ElementType.ROCK || lat.element.isLock) {
//上方元素为石头,或元素为锁定,或者是果冻,或者鸡蛋
else if (lat.element.type == ElementType.ROCK ||
lat.element.isLock ||
lat.element.type == ElementType.JELLY ||
lat.element.type == ElementType.CHICKEN_EGG) {
return false
}
//剩下情况
......@@ -228,10 +231,12 @@ export class Tool {
if (!lat || !lat.element) {
return false
}
//上方元素为石头,或为冰淇淋,或为魔力鸟
//上方元素为石头,或为冰淇淋,或为魔力鸟,或为果冻,或为鸡蛋
else if (lat.element.type == ElementType.ROCK ||
lat.element.type == ElementType.LOLLIPOP ||
lat.element.effectType == EffectType.MAGICLION) {
lat.element.effectType == EffectType.MAGICLION ||
lat.element.type == ElementType.JELLY ||
lat.element.type == ElementType.CHICKEN_EGG) {
return false
}
//剩下情况
......@@ -241,7 +246,7 @@ export class Tool {
}
/**
* 判断能执行消除的元素,
* 包括所有特效和基本元素
* 包括所有特效和基本元素,石头,果冻,鸡蛋
* @param lat
*/
public static judgeEliminate(lat: Lattice) {
......@@ -249,8 +254,8 @@ export class Tool {
if (!lat || !lat.element) {
return false
}
//上方元素为石头,或为冰淇淋
else if (lat.element.type == ElementType.ROCK || lat.element.type == ElementType.LOLLIPOP) {
//上方元素为冰淇淋
else if (lat.element.type == ElementType.LOLLIPOP) {
return false
}
//剩下情况
......@@ -259,6 +264,24 @@ export class Tool {
}
}
/**
* 判断元素是否可被手势选中和交换
* 主要点击元素判断使用
* @param ele 元素
* @return 返回true为可选,false不可选
*/
public static judgeChosen(ele: Element) {
if (!ele ||
ele.type == ElementType.ROCK ||
ele.isLock ||
ele.type == ElementType.JELLY ||
ele.type == ElementType.CHICKEN_EGG
) {
return false;
}
return true
}
/**
* 检测死图,需要提示
* 需要返回一组提示 两个能互相交换元素,数组
......@@ -501,6 +524,86 @@ export class Tool {
return null
}
/**
* 判断已死
* @param lattices
*/
public static alreadyDie(lattices: Lattice[]) {
//记录基本元素的个数
var arr = {};
//记录是否有特效,两个任意特效,或一个魔力鸟特效,都未锁定
var hasEffect = false;
var effectCount = 0;
//记录是否有两个格子挨着,且未锁定
var hasTwo = false;
//记录是否有三个格子挨着,且未锁定,这个逻辑略烦,暂定至少都未锁定,有bug再改
var hasThree = false;
for (var i = 0; i < lattices.length; i++) {
if (lattices[i] &&
lattices[i].element &&
lattices[i].element.type <= 4 &&
!lattices[i].element.isLock) {
var type = lattices[i].element.type;
if (!arr[type]) arr[type] = 0;
arr[type]++;
var ele = lattices[i].element;
if (ele.effectType == EffectType.MAGICLION) {
hasEffect = true;
}
if (ele.effectType != null) {
effectCount++;
if (effectCount >= 2) {
hasEffect = true;
}
}
var rc = Tool.indexToRc(i);
//右1
if (rc[1] < Tool.colNum - 1) {
var latRight1 = lattices[i + 1];
if (Tool.judgeFall(latRight1) && latRight1.element.type != ElementType.LOLLIPOP) {
hasTwo = true;
}
//右2
if (rc[1] < Tool.colNum - 2) {
var latRight2 = lattices[i + 2];
if (Tool.judgeFall(latRight1) &&
latRight1.element.type != ElementType.LOLLIPOP &&
Tool.judgeFall(latRight2) &&
latRight2.element.type != ElementType.LOLLIPOP) {
hasThree = true;
}
}
}
//下1
var latDown1 = lattices[i + Tool.colNum];
if (Tool.judgeFall(latDown1) && latDown1.element.type != ElementType.LOLLIPOP) {
hasTwo = true;
}
//提前判断下
if (hasTwo && hasEffect) return false;
//下2
var latDown2 = lattices[i + Tool.colNum * 2];
if (Tool.judgeFall(latDown1) &&
latDown1.element.type != ElementType.LOLLIPOP &&
Tool.judgeFall(latDown2) &&
latDown2.element.type != ElementType.LOLLIPOP) {
hasThree = true;
}
if (hasThree) {
for (var a in arr) {
if (arr[a] >= 3) {
return false
}
}
}
}
}
return true
}
/**
* 将有相邻相同的组合,不是基础元素的,都会是单独的
* @param arr
......@@ -699,8 +802,8 @@ export class Tool {
* 获得元素
* @param type
*/
public static getElement(type: ElementType) {
let obj = Pool.takeOut(RecoverName.ELEMENT);
public static getElement(type: ElementType):Element {
let obj:Element = Pool.takeOut(RecoverName.ELEMENT);
if (!obj) {
obj = new Element(type)
} else {
......
......@@ -10,7 +10,7 @@ export class IceAni extends Ani {
constructor() {
super();
this.aniName = "IceAni";
this.showImage = new ImageAni(["ice1_png", "ice2_png", "ice3_png", "ice4_png", "ice5_png", "ice6_png"]);
this.showImage = new ImageAni(["ele7_png", "ice2_png", "ice3_png", "ice4_png", "ice5_png", "ice6_png"]);
this.addChild(this.showImage)
}
......
import { ImageAni } from "../class/ImageAni";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { playSound, SoundType } from "../../soundCtrl";
/**
* 需要回调的
*
*/
export class JellySpreadAni extends egret.DisplayObjectContainer {
//目标位置的图片,到时根据方向定
targetImage: egret.Bitmap;
imageAni: ImageAni
constructor() {
super()
var texture = RES.getRes("bonusShoot_png")
this.targetImage = new egret.Bitmap(texture);
this.targetImage.anchorOffsetX = 78;
this.targetImage.anchorOffsetY = 37 / 2;
this.addChild(this.targetImage);
var arr = []
for (var i = 1; i <= 27; i++) {
arr.push("bonusFra" + i + "_png");
}
this.imageAni = new ImageAni(arr);
this.addChild(this.imageAni);
}
play(startP: number[], endP: number[], callback: Function) {
this.x = startP[0];
this.y = startP[1];
//判断方向
this.imageAni.play(() => {
callback();
if (this.$parent) {
this.$parent.removeChild(this)
};
Pool.recover(RecoverName.JELLYSPREAD_ANI, this)
})
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ export class RockAni extends Ani {
constructor() {
super();
this.aniName = "RockAni";
this.showImage = new ImageAni(["rock1_png", "rock2_png", "rock3_png", "rock4_png", "rock5_png", "rock6_png"]);
this.showImage = new ImageAni(["ele5_png", "rock2_png", "rock3_png", "rock4_png", "rock5_png", "rock6_png"]);
this.addChild(this.showImage)
}
......
/**
* 鸡蛋的状态
*
*/
export class ChickenEgg extends eui.Image {
/**
* 小鸡数量
*/
private chickenNum: number = 0;
/**
* 鸡蛋状态变化 3 2 1 0 再往后,直接加孵鸡次数
*/
private _statusNum: number;
get statusNum() {
return this._statusNum
}
set statusNum(value: number) {
if (value >= 0) {
this._statusNum = value;
} else {
this._statusNum = 0;
this.chickenNum++;
}
}
constructor(n: number = 3) {
super()
this.source = "ele7_png";
//图片需要居中
this.chickenNum = 0;
this._statusNum = n;
}
reset(n: number = 3) {
//图片修改
this.chickenNum = 0;
this._statusNum = n;
}
/**
* 孵蛋动作
*/
hatch(callback: Function) {
if (!this.chickenNum) {
callback();
return
}
}
}
\ No newline at end of file
......@@ -50,7 +50,7 @@ export class Element extends eui.Component {
this.addChildAt(this.magicLionBgAni, 0);
break;
case EffectType.HORIZONTAL:
this.changeSource("ele" + this.type + value + "_png");
this.changeSource("ele" + this.type + "Line" + "_png");
//添加HorizontalBgAni
this.horizontalBgAni = Pool.takeOut(RecoverName.HORIZONTALBG_ANI)
if (!this.horizontalBgAni) {
......@@ -61,7 +61,7 @@ export class Element extends eui.Component {
this.addChildAt(this.horizontalBgAni, 1)
break;
case EffectType.VERTICAL:
this.changeSource("ele" + this.type + value + "_png");
this.changeSource("ele" + this.type + "Line" + "_png");
//添加VerticalBgAni
this.verticalBgAni = Pool.takeOut(RecoverName.VERTICALBG_ANI)
if (!this.verticalBgAni) {
......@@ -72,7 +72,7 @@ export class Element extends eui.Component {
this.addChildAt(this.verticalBgAni, 1)
break;
case EffectType.EXPLOSIVE:
this.changeSource("ele" + this.type + value + "_png");
this.changeSource("ele" + this.type + "Exp" + "_png");
this.explosiveBgAni = Pool.takeOut(RecoverName.EXPLOSIVEBG_ANI)
if (!this.explosiveBgAni) {
this.explosiveBgAni = new ExplosiveBgAni();
......
/**
* 元素类型
* 元素类型 <=4就是基础元素
*/
export enum ElementType {
RABBIT = 0,//兔子0
......@@ -7,9 +7,14 @@ export enum ElementType {
CATTLE,//牛2
LION,//狮子3
PIG,//猪4
ROCK,//石头5
LOLLIPOP,//棒棒糖6
ICE,//冰块7
ICE,//冰块7 有时间重构的话,不适合放这里
JELLY,//果冻8
CHICKEN_EGG,//鸡蛋9
}
export const codeMsgs = {
"E1002090011": "用户关卡记录异常",
......
......@@ -13,6 +13,9 @@ export enum RecoverName {
SCORE_ANI = "ScoreAni",
BONUSSHOOT_ANI = "BonusShootAni",
JELLYSPREAD_ANI = "JellySpreadAni",
//元素身上
LOCK_ANI = "LockAni",
MAGICLIONBG_ANI = "MagicLionBgAni",
......
......@@ -31,6 +31,7 @@ export interface MapData {
* 2石头
* 3棒棒糖
* 4元素枷锁
* 5果冻
*/
elements?:number[]
/**
......
import MainScene from "../../mainScene/MainScene";
import { JellySpreadAni } from "../anis/JellySpreadAni";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { Tool } from "../Tool";
import { ElementType } from "../enum/ElementType";
import { Lattice } from "../class/Lattice";
export class AiControl {
private static _ins: AiControl
static get ins() {
return AiControl._ins || (AiControl._ins = new AiControl())
}
/**
* 判断是否还有果冻,暂时不考虑果冻无中生有,否则逻辑修改
*/
private hasJelly: boolean;
private hasEgg: boolean;
init(lattices: Lattice[]) {
this.hasJelly = judgeJellyExist(lattices);
this.hasEgg = judgeEggExist(lattices);
}
aiMotion(thisObj: MainScene, callback: Function) {
//果冻的
this.jellyMotion(thisObj, () => {
//鸡蛋的
this.eggMotion(thisObj, callback)
})
// if (noAction) {
// callback()
// }
}
private jellyMotion(thisObj: MainScene, callback: Function) {
if (!this.hasJelly || thisObj.jellyBrokeMark) {
thisObj.jellyBrokeMark = false;
//没有果冻,或上一步有果冻被消除,直接回调
callback();
return
}
//标识记为false
thisObj.jellyBrokeMark = false;
//果冻蔓延
var spread = getJellySpreadAni(thisObj.lattices);
if (spread) {
//执行动画
let jellySpreadAni: JellySpreadAni = Pool.takeOut(RecoverName.JELLYSPREAD_ANI)
if (!jellySpreadAni) {
jellySpreadAni = new JellySpreadAni()
}
thisObj.addChild(jellySpreadAni);
jellySpreadAni.play(Tool.getPositionByIndex(spread[0]), Tool.getPositionByIndex(spread[1]), () => {
//播放完后,将终点元素变成果冻
thisObj.lattices[spread[1]].element.reset(ElementType.JELLY);
//执行回调
callback()
})
} else {
callback()
if (spread === 0) {
//如果无果冻了
this.hasJelly = false;
}
}
}
/**
* 鸡蛋得孵化逻辑
* 与果冻不同,需要执行一次threeMatch,如无再执行callback,否则执行eleminate
* @param thisObj
* @param callback
*/
private eggMotion(thisObj: MainScene, callback: Function) {
if (!this.hasEgg) {
callback();
return
}
//逻辑再写,暂时没有
callback();
}
}
/**
* 判断果冻是否存在
* @param lattices
* @return false表示不存在,true表示存在
*/
function judgeJellyExist(lattices: Lattice[]) {
for (var i = 0; i < lattices.length; i++) {
var lattice = lattices[i]
//没有格子或没有元素或不是果冻 跳过
if (!lattice || !lattice.element || lattice.element.type != ElementType.JELLY) continue
return true
}
return false;
}
/**
* 判断鸡蛋是否存在
* @param lattices
* @return false表示不存在,true表示存在
*/
function judgeEggExist(lattices: Lattice[]) {
for (var i = 0; i < lattices.length; i++) {
var lattice = lattices[i]
//没有格子或没有元素或不是果冻 跳过
if (!lattice || !lattice.element || lattice.element.type != ElementType.CHICKEN_EGG) continue
return true
}
return false;
}
/**
* 获取能蔓延的
* @param lattices
*/
function getJellySpreadAni(lattices: Lattice[]) {
var indexs: number[] = [];
for (var i = 0; i < lattices.length; i++) {
var lattice = lattices[i]
//没有格子或没有元素或不是果冻 跳过
if (!lattice || !lattice.element || lattice.element.type != ElementType.JELLY) continue
indexs.push(i);
}
if (!indexs.length) return 0
while (indexs.length) {
var rand = Math.floor(Math.random() * indexs.length);
var randIndex = indexs.splice(rand, 1)[0];
var index = judgeSpread(randIndex, lattices);
if (index != null) {
//能蔓延,返回自身索引和蔓延的索引
return [randIndex, index];
}
}
return null;
}
/**
* 判断可蔓延的方向,并返回蔓延的格子索引
* @param index
* @return 没有返回null,注意判断时可能有0
*/
function judgeSpread(index: number, lattices: Lattice[]): number {
//四个方向尽量随机
var arr = [index - Tool.colNum, index + Tool.colNum];
var rc = Tool.indexToRc(index);
var col = rc[1];
//列数大于0才可能有左边格子
if (col > 0) arr.push(index - 1);
//列数不为最右边
if (col < Tool.colNum - 1) arr.push(index + 1);
while (arr.length) {
var rand = Math.floor(Math.random() * arr.length);
var i = arr.splice(rand, 1)[0];
if (lattices[i] &&
lattices[i].element &&
lattices[i].element.type <= 4) {
return i
}
}
return null
}
//
......@@ -384,7 +384,7 @@
],
"remainEnargy": 99,
"askForEnergy": false,
"canReceiveTreasureBoxNum": 0,
"canReceiveTreasureBoxNum": 10,
"nextRangeStarsNum": 150
}
}
\ No newline at end of file
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