Commit 6ac1af1a authored by 邱旭's avatar 邱旭

1

parent b03a492e
......@@ -450,7 +450,8 @@ export default class MainBase extends eui.UILayer {
"ele33_1",
"ele33_0",
"arrowbg",
]
"gameGuide",
];
for (var i = 0; i < arr.length; i++) {
RES.getResAsync(arr[i] + "_png")
}
......
......@@ -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,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,ele23_png,ele25_png,ele27_png,ele26_png,ele24_png,ele22_png,chocolateMark3_png,chocolateMark1_png,chocolateFour_png,chocolateMark0_png,chocolateMark2_png,redbombParticle_png,monster_shoot_png,ele33_1_png,ele33_0_png,ele34_png,honey_png,ele36_png,lef_png,propBg_png,check0_png,check1_png,check2_png,check3_png,check4_png,check7_png,check8_png,check9_png,check关_png,check第_png,check6_png,check5_png,ele38_png,ele39_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,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,ele23_png,ele25_png,ele27_png,ele26_png,ele24_png,ele22_png,chocolateMark3_png,chocolateMark1_png,chocolateFour_png,chocolateMark0_png,chocolateMark2_png,redbombParticle_png,monster_shoot_png,ele33_1_png,ele33_0_png,ele34_png,honey_png,ele36_png,lef_png,propBg_png,check0_png,check1_png,check2_png,check3_png,check4_png,check7_png,check8_png,check9_png,check关_png,check第_png,check6_png,check5_png,ele38_png,ele39_png,gameGuide_png",
"name": "main2"
},
{
......@@ -5361,6 +5361,11 @@
"url": "assets/common/turnnoprize继续闯关.png",
"type": "image",
"name": "turnnoprize继续闯关2_png"
},
{
"url": "assets/mainScene/gameGuide.png",
"type": "image",
"name": "gameGuide_png"
}
]
}
\ No newline at end of file
......@@ -7,69 +7,110 @@ import { generateMapBg, drawPoly } from "../logic/aaa";
* 引导前,initElements需要编排特定元素
* 游戏引导,。8种
* 蒙层都一致,但是需要特定镂空,手势,和提示文案
*
*
*/
export class GameGuide extends egret.DisplayObjectContainer {
/**
* 背景黑色蒙层
*/
bg: egret.Shape;
boxGroup: eui.Group;
hand: egret.Bitmap;
msg: eui.Label;
stepCount: number;
stepAll: number;
thisObj: MainScene;
/**
* 直接把this传入得了
* @param thisObj
* @param thisObj
*/
constructor(thisObj: MainScene) {
super();
// this.touchEnabled = true;
this.bg = new egret.Shape()
this.bg.touchEnabled = true
this.bg = new egret.Shape();
this.bg.touchEnabled = true;
this.addChild(this.bg);
this.hand = new egret.Bitmap(RES.getRes("guidePropHand_png"));
this.hand.touchEnabled = false;
this.addChild(this.hand);
let box = new eui.Image(RES.getRes("gameGuide_png"));
this.boxGroup = new eui.Group();
this.boxGroup.width = box.width;
this.boxGroup.height = box.height;
this.boxGroup.addChild(box);
this.msg = new eui.Label();
this.msg.size = 22;
this.msg.y = 850;
this.msg.textColor = 0xffffff;
this.msg.x = 25;
this.msg.y = 75;
this.msg.width = 270;
this.msg.height = 90;
window['mmm'] = this.msg;
this.msg.textColor = 0xc17343;
this.msg.lineSpacing = 10;
this.msg.textAlign = egret.HorizontalAlign.CENTER;
this.addChild(this.msg);
this.msg.textAlign = egret.HorizontalAlign.LEFT;
this.msg.verticalCenter = egret.VerticalAlign.MIDDLE;
this.boxGroup.addChild(this.msg);
this.thisObj = thisObj
this.addChild(this.boxGroup);
this.thisObj = thisObj;
this.stepCount = chapterFuns[thisObj.chapter] ? chapterFuns[thisObj.chapter].stepCount : 0;
this.stepAll = this.stepCount;
}
show() {
var step = this.stepAll - this.stepCount;
this.drawBg(step);
//修改元素的层级,置顶,否则可能点击其他元素,handIndexs
var handIndexs = chapterFuns[this.thisObj.chapter].handIndexs[step];
for (var i = 0; i < handIndexs.length; i++) {
for(var i = 0; i < handIndexs.length; i++) {
var index = handIndexs[i];
var lat = this.thisObj.lattices[index]
if (lat && lat.element) this.thisObj.elementContainer.addChild(lat.element);
var lat = this.thisObj.lattices[index];
if(lat && lat.element) this.thisObj.elementContainer.addChild(lat.element);
}
this.handAni(handIndexs);
this.msg.text = chapterFuns[this.thisObj.chapter].msg[step] || "";
this.msg.x = (750 - this.msg.textWidth) / 2;
// this.msg.x = (750 - this.msg.textWidth) / 2;
this.boxGroup.x = (750 - this.msg.width) / 2 - 100;
var p1 = Tool.getPositionByIndex(handIndexs[0]);
var p2 = Tool.getPositionByIndex(handIndexs[1]);
this.msg.y = Math.max(p1[1], p2[1]) + 135;
// this.msg.y = Math.max(p1[1], p2[1]) + 165;
this.boxGroup.y = Math.max(p1[1], p2[1]) + 150;
//定制修改,101关毛球引导,
if (this.thisObj.chapter == 101 && step == 0) {
this.msg.y += 80;
if(this.thisObj.chapter == 101 && step == 0) {
// this.msg.y += 80;
this.boxGroup.y += 80;
}
if(this.thisObj.chapter == 406) {
// this.msg.y += 80;
this.boxGroup.y += 80;
}
if(this.thisObj.chapter == 9) {
this.boxGroup.y -= 580;
}
if (this.thisObj.chapter == 406 ) {
this.msg.y += 80;
if(this.thisObj.chapter == 10 && step == 1) {
this.boxGroup.y -= 100;
}
if(this.thisObj.chapter == 10) {
this.boxGroup.y -= 30;
}
if(this.thisObj.chapter == 301) {
this.boxGroup.y -= 110;
}
if(this.thisObj.chapter == 331) {
this.boxGroup.y -= 110;
}
if(this.thisObj.chapter == 426) {
this.boxGroup.y -= 60;
}
if(this.thisObj.chapter == 453) {
this.boxGroup.y -= 50;
}
this.stepCount--;
......@@ -77,8 +118,8 @@ export class GameGuide extends egret.DisplayObjectContainer {
hideSelf() {
if (this.parent) this.parent.removeChild(this);
if (!this.stepCount) {
if(this.parent) this.parent.removeChild(this);
if(!this.stepCount) {
//计入缓存
writeCache(getCacheKey() + this.thisObj.chapter);
//置空gameGuide
......@@ -87,20 +128,19 @@ export class GameGuide extends egret.DisplayObjectContainer {
}
private handAni(handIndexs: number[]) {
egret.Tween.removeTweens(this.hand)
egret.Tween.removeTweens(this.hand);
var p1 = Tool.getPositionByIndex(handIndexs[0]);
var p2 = Tool.getPositionByIndex(handIndexs[1]);
this.hand.x = p1[0];
this.hand.y = p1[1];
egret.Tween.get(this.hand, { loop: true })
egret.Tween.get(this.hand, {loop: true})
// .set({ x: p1[0], y: p1[1] })
.to({ x: p2[0], y: p2[1] }, 1000)
.to({ x: p1[0], y: p1[1] }, 100)
.to({x: p2[0], y: p2[1]}, 1000)
.to({x: p1[0], y: p1[1]}, 100)
}
/**
*
* @param chapter
*
* @param step 0第一步,1第二步
*/
private drawBg(step: number = 0) {
......@@ -108,7 +148,7 @@ export class GameGuide extends egret.DisplayObjectContainer {
this.bg.graphics.beginFill(0x000000, 0.7);
this.drawRect();
//画特定的洞
var data = chapterFuns[this.thisObj.chapter]
var data = chapterFuns[this.thisObj.chapter];
drawHole(this.bg, data.showIndexs[step], data.hideIndexs[step]);
}
......@@ -142,7 +182,7 @@ const chapterFuns = {
],
//提示文案,尽量通用点的位置。x肯定都居中
msg: [
"3个同色动物头像成一排即可消除~"
"3个同色动物头像成一排即\n可消除~"
]
},
//冰块消除
......@@ -158,7 +198,7 @@ const chapterFuns = {
[21, 20]
],
msg: [
"消除冰块上的元素即可打破冰块"
"消除冰块上的元素即可打破\n冰块"
]
},
//石头消除
......@@ -174,7 +214,7 @@ const chapterFuns = {
[12, 13]
],
msg: [
"当石头附近的元素产生消除时,即可粉碎石头"
"当石头附近的元素产生消除\n时,即可粉碎石头"
]
},
//直线特效
......@@ -193,8 +233,8 @@ const chapterFuns = {
[49, 50]
],
msg: [
"4个同色元素形成直线就能合成直线特效",
"消除直线特效会产生直线消除"
"4个同色元素形成直线就能\n合成直线特效",
"消除直线特效会产生直线\n消除"
]
},
//爆炸特效
......@@ -213,8 +253,8 @@ const chapterFuns = {
[30, 29]
],
msg: [
"5个同色动物头像成L形或T形就能合成爆炸特效",
"消除爆炸特效会产生3*3的范围消除",
"5个同色动物头像成L形或\nT形就能合成爆炸特效",
"消除爆炸特效会产生3*3\n的范围消除",
]
},
//特效组合
......@@ -230,7 +270,7 @@ const chapterFuns = {
[63, 72],
],
msg: [
"将两个特效互相拖动即可直接触发组合特效,\n组合特效的效果视组合的两个特效类型而定"
"将两个特效互相拖动即可直\n接触发组合特效,组合特效的效\n果视组合的两个特效类型而定"
// "五个相同动物形成一字型即可合成魔力花特效",
// "拖动魔力花特效即可直接触发"
]
......@@ -251,7 +291,7 @@ const chapterFuns = {
[73, 64]
],
msg: [
"五个相同动物形成一字型即可合成魔力花特效",
"五个相同动物形成一字型即\n可合成魔力花特效",
"拖动魔力花特效即可直接触发"
]
},
......@@ -287,7 +327,7 @@ const chapterFuns = {
[68, 67],
],
msg: [
"当棒棒糖移至底层时,即可移除棒棒糖",
"当棒棒糖移至底层时,即可\n移除棒棒糖",
"消除棒棒糖下方的动物\n就可以收集棒棒糖啦"
]
},
......@@ -320,7 +360,7 @@ const chapterFuns = {
[40, 49]
],
msg: [
"小心!会蔓延的果冻!\n消除果冻旁边的动物\n就能消除果冻~"
"小心!会蔓延的果冻!\n消除果冻旁边的动物就能\n消除果冻~"
]
},
//鸡蛋
......@@ -336,7 +376,7 @@ const chapterFuns = {
[66, 57]
],
msg: [
"鸡蛋边上不断有动物消除时,会孵出小鸡"
"鸡蛋边上不断有动物消除\n时,会孵出小鸡"
]
},
//灰毛球
......@@ -371,133 +411,133 @@ const chapterFuns = {
"需用特效将褐色毛球分裂成\n两个灰色毛球,才能将它消除"
]
},
226:{
226: {
stepCount: 1,
showIndexs: [
[29,30,31,32],
[29, 30, 31, 32],
],
hideIndexs: [
[ 29,30],
[29, 30],
],
handIndexs: [
[31,32],
[31, 32],
],
msg: [
"每走三步都会翻转的石门!\n在石门开启的时候赶快消除吧~"
"每走三步都会翻转的石门!\n在石门开启的时候赶快消除吧~"
]
},
301:{
301: {
stepCount: 1,
showIndexs: [
[64,65,66,75],
[64, 65, 66, 75],
],
hideIndexs: [
[ 64,65],
[64, 65],
],
handIndexs: [
[66,75],
[66, 75],
],
msg: [
"每操作一步,怪兽都会吐毒液\n消除毒液的回合不会再产生毒液"
"每操作一步,怪兽都会吐毒液消除毒液的回合不会再产生毒液"
]
},
331:{
331: {
stepCount: 1,
showIndexs: [
[64,65,66,75],
[64, 65, 66, 75],
],
hideIndexs: [
[ 64,65],
[64, 65],
],
handIndexs: [
[66,75],
[66, 75],
],
msg: [
"在烟花附近消除,就会释放美丽的烟花哦~"
"在烟花附近消除,就会释放美丽的烟花哦~"
]
},
377:{
377: {
stepCount: 1,
showIndexs: [
[29,38,39,40],
[29, 38, 39, 40],
],
hideIndexs: [
[ 39,40],
[39, 40],
],
handIndexs: [
[29,38],
[29, 38],
],
msg: [
"独眼仔被相同颜色的元素消除4次\n就能激活哦~"
"独眼仔被相同颜色的元素消除4次就能激活哦~"
]
},
406:{
406: {
stepCount: 1,
showIndexs: [
[23,24,32,41],
[23, 24, 32, 41],
],
hideIndexs: [
[ 32,41],
[32, 41],
],
handIndexs: [
[23,24],
[23, 24],
],
msg: [
"使用特效击中气鼓鱼,膨胀起来在周围消除一次即可引爆气鼓鱼"
"使用特效击中气鼓鱼,膨胀起来在周围消除一次即可引爆气鼓鱼"
],
},
426:{
426: {
stepCount: 1,
showIndexs: [
[59,68,67,66],
[59, 68, 67, 66],
],
hideIndexs: [
[ 67,66],
[67, 66],
],
handIndexs: [
[59,68],
[59, 68],
],
msg: [
"在蜜罐旁消除三次即可打开并释放蜂蜜\n然后消除被蜂蜜黏住的小动物吧~"
"在蜜罐旁消除三次即可打开并释放蜂蜜\n然后消除被蜂蜜黏住的小动物吧~"
],
},
453:{
453: {
stepCount: 1,
showIndexs: [
[59,68,67,66],
[59, 68, 67, 66],
],
hideIndexs: [
[ 67,66],
[67, 66],
],
handIndexs: [
[59,68],
[59, 68],
],
msg: [
"流沙每回合都会向四方随机移动,消除流沙上的小动物可以收集流沙"
"流沙每回合都会向四方随机移动,消除流沙上的小动物可以收集流沙"
],
},
501:{
501: {
stepCount: 1,
showIndexs: [
[42,51,52,53],
[42, 51, 52, 53],
],
hideIndexs: [
[ 52,53],
[52, 53],
],
handIndexs: [
[42,51],
[42, 51],
],
msg: [
"每回合,传送带会带着它上面的动物向指定方向移动一格"
"每回合,传送带会带着它上面的动物向指定方向移动一格"
]
}
}
};
/**
* 根据显示index和隐藏的绘制图形
* @param shape
* @param showIndexs
* @param hideIndexs
* @param shape
* @param showIndexs
* @param hideIndexs
*/
function drawHole(shape: egret.Shape, showIndexs: number[], hideIndexs: number[]) {
......@@ -505,16 +545,16 @@ function drawHole(shape: egret.Shape, showIndexs: number[], hideIndexs: number[]
var paths = generateMapBg(lattices);
//顺时针
//画洞
for (var j = 0; j < paths.length; j++) {
for(var j = 0; j < paths.length; j++) {
var path = paths[j];
drawPoly(shape, path)
}
shape.graphics.endFill();
//根据hideIndexs画遮,为了不能点击
if (!hideIndexs || !hideIndexs.length) return
if(!hideIndexs || !hideIndexs.length) return;
shape.graphics.beginFill(0x000000, 0);
for (var i = 0; i < hideIndexs.length; i++) {
for(var i = 0; i < hideIndexs.length; i++) {
var center = Tool.getPositionByIndex(hideIndexs[i]);
shape.graphics.drawRect(center[0] - Tool.width / 2, center[1] - Tool.height / 2, Tool.width, Tool.height);
}
......@@ -524,8 +564,8 @@ function drawHole(shape: egret.Shape, showIndexs: number[], hideIndexs: number[]
//根据显示的格子求Tool.colNum * Tool.rowNum格子,显示的标为1;
function createLattices9(indexs: number[]): number[] {
var arr: number[] = [];
for (var i = 0; i < Tool.colNum * Tool.rowNum; i++) {
if (indexs.indexOf(i) > -1) {
for(var i = 0; i < Tool.colNum * Tool.rowNum; i++) {
if(indexs.indexOf(i) > -1) {
arr[i] = 1
} else {
arr[i] = 0
......@@ -535,8 +575,9 @@ function createLattices9(indexs: number[]): number[] {
}
var arr = ["apple", "orange", "apple", "orange", "pear", "orange"];
function getWordCnt(arr: any[]) {
return arr.reduce(function (prev, next) {
return arr.reduce(function(prev, next) {
prev[next] = (prev[next] + 1) || 1;
return prev;
}, {});
......
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