Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
87904b64
Commit
87904b64
authored
Jun 01, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
樱花暂存
parent
29f71450
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
259 additions
and
11 deletions
+259
-11
MainBase.ts
egret/libs/new_wx/MainBase.ts
+3
-0
ele46_sz.png
egret/resource/assets/mainScene/ele46_sz.png
+0
-0
default.res.json
egret/resource/default.res.json
+7
-2
MainScene.ts
egret/src/mainScene/MainScene.ts
+189
-0
Tool.ts
egret/src/something/Tool.ts
+10
-4
Chapter32.ts
egret/src/something/chapters/Chapter32.ts
+4
-4
getChapter.ts
egret/src/something/chapters/getChapter.ts
+1
-1
Element.ts
egret/src/something/class/Element.ts
+17
-0
shuzhi.ts
egret/src/something/class/shuzhi.ts
+28
-0
No files found.
egret/libs/new_wx/MainBase.ts
View file @
87904b64
...
...
@@ -326,6 +326,9 @@ export default class MainBase extends eui.UILayer {
RES
.
getResAsync
(
"ele43fn_png"
);
RES
.
getResAsync
(
"ele44fn_png"
);
RES
.
getResAsync
(
"ele45fn_png"
);
RES
.
getResAsync
(
"ele46_png"
);
RES
.
getResAsync
(
"ele46_sz_png"
);
for
(
var
i
=
1
;
i
<=
27
;
i
++
)
{
RES
.
getResAsync
(
"bonusFra"
+
i
+
"_png"
)
...
...
egret/resource/assets/mainScene/ele46_sz.png
0 → 100644
View file @
87904b64
4.17 KB
egret/resource/default.res.json
View file @
87904b64
...
...
@@ -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,gameGuide_png,ele41_png,ele42_png,ele43_png,ele44_png,ele45_png,ele42fn_png,ele43fn_png,ele44fn_png,ele45fn_png,ele46_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,ele41_png,ele42_png,ele43_png,ele44_png,ele45_png,ele42fn_png,ele43fn_png,ele44fn_png,ele45fn_png,ele46_png
,ele46_sz_png
"
,
"name"
:
"main2"
},
{
...
...
@@ -241,7 +241,7 @@
"name"
:
"helpGroup"
},
{
"keys"
:
"virprizebg_png,lightdi_png,wormhole_png,startscenebg_jpg,adsmask_png,nsad2_png,nsad1_png,hbchuanguan2_png,redAlert_btn1_png,loadingbgfes_png,titimg1_png,titimg2_png,titimg3_png,titimg4_png,ele42fn_png,ele43fn_png,ele44fn_png,ele45fn_png,addhbimg_png,ele46_png"
,
"keys"
:
"virprizebg_png,lightdi_png,wormhole_png,startscenebg_jpg,adsmask_png,nsad2_png,nsad1_png,hbchuanguan2_png,redAlert_btn1_png,loadingbgfes_png,titimg1_png,titimg2_png,titimg3_png,titimg4_png,ele42fn_png,ele43fn_png,ele44fn_png,ele45fn_png,addhbimg_png,ele46_png
,ele46_sz_png
"
,
"name"
:
"preload"
}
],
...
...
@@ -5506,6 +5506,11 @@
"url"
:
"assets/mainScene/ele46.png"
,
"type"
:
"image"
,
"name"
:
"ele46_png"
},
{
"url"
:
"assets/mainScene/ele46_sz.png"
,
"type"
:
"image"
,
"name"
:
"ele46_sz_png"
}
]
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
87904b64
...
...
@@ -123,6 +123,7 @@ import doWormHoleAI from './doWormHoleAI';
import
{
Grass
}
from
'../something/class/Grass'
;
import
Food
from
'../something/class/Food'
;
import
foodAni
from
'../something/anis/foodAni'
;
import
shuzhi
from
'../something/class/shuzhi'
;
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
...
...
@@ -441,6 +442,9 @@ export default class MainScene extends Scene {
}
>
=
[];
inaniFood
:
boolean
=
false
;
//樱花
//当前关卡的所有樱花
cherryData
:
Array
<
Array
<
number
>>
=
[];
constructor
(){
super
();
window
[
'gm'
]
=
this
.
gm
;
...
...
@@ -581,6 +585,7 @@ export default class MainScene extends Scene {
if
(
!
this
.
chapterTxt
.
parent
){
this
[
'chaptergro'
].
addChild
(
this
.
chapterTxt
);
}
console
.
log
(
"移除地图元素"
);
}
async
start
(
data
)
{
super
.
start
();
...
...
@@ -618,6 +623,11 @@ export default class MainScene extends Scene {
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
this
.
initRecycle
();
this
.
initConnectedLats
();
//初始化樱花
this
.
initCherry
();
console
.
log
(
"樱花数据"
,
this
.
cherryData
);
//初始化元素
this
.
initElement
();
//重置基础元素类型及特效
...
...
@@ -1340,7 +1350,63 @@ export default class MainScene extends Scene {
this
.
connectState
=
1
;
}
//否则默认的2
}
//初始化樱花
initCherry
(){
var
cherydata
=
this
.
chapterData
.
map
.
cherrydata
;
if
(
cherydata
){
this
.
cherryData
=
JSON
.
parse
(
JSON
.
stringify
(
cherydata
));
}
else
{
this
.
cherryData
=
new
Array
();
}
for
(
var
i
=
0
;
i
<
this
.
cherryData
.
length
;
i
++
){
var
icherydata
=
this
.
cherryData
[
i
];
for
(
var
j
=
0
;
j
<
icherydata
.
length
;
j
++
){
let
idx
=
icherydata
[
j
];
let
p
=
Tool
.
getPositionByIndex
(
idx
);
//添加树枝
if
(
j
>
0
){
let
lastidx
=
icherydata
[
j
-
1
];
let
lastp
=
Tool
.
getPositionByIndex
(
lastidx
);
let
chanum
=
Math
.
abs
(
idx
-
lastidx
);
let
szp
;
let
roatype
:
string
;
if
(
chanum
==
9
){
szp
=
[
p
[
0
],(
lastp
[
1
]
-
p
[
1
])
/
2
+
p
[
1
]];
roatype
=
"vir"
;
}
else
if
(
chanum
==
1
){
szp
=
[(
lastp
[
0
]
-
p
[
0
])
/
2
+
p
[
0
],
p
[
1
]];
roatype
=
"hor"
;
}
else
{
console
.
error
(
"检查樱花分布"
,
idx
,
lastidx
,
i
,
j
);
}
if
(
szp
){
console
.
log
(
"树枝位置"
,
szp
[
0
],
szp
[
1
]);
let
onesz
=
new
shuzhi
();
onesz
.
name
=
"sz_"
+
idx
+
"_"
+
lastidx
;
onesz
.
x
=
szp
[
0
];
onesz
.
y
=
szp
[
1
];
onesz
.
setroa
(
roatype
);
this
.
mapupContainer
.
addChild
(
onesz
);
}
}
//添加元素
let
ele
:
Element
=
Pool
.
takeOut
(
RecoverName
.
ELEMENT
);
if
(
!
ele
){
ele
=
new
Element
(
ElementType
.
cherry
);
}
else
{
ele
.
reset
(
ElementType
.
cherry
);
}
console
.
log
(
"樱花位置"
,
p
[
0
],
p
[
1
]);
ele
.
x
=
p
[
0
];
ele
.
y
=
p
[
1
];
this
.
elementContainer
.
addChild
(
ele
);
this
.
lattices
[
idx
].
element
=
ele
;
}
}
}
//初始化地图元素
initElement
()
{
this
.
cannonums
=
0
;
...
...
@@ -1353,6 +1419,12 @@ export default class MainScene extends Scene {
//如果对应格子为空,直接跳过,
if
(
!
this
.
lattices
[
i
])
continue
;
var
p
=
Tool
.
getPositionByIndex
(
i
);
//初始元素忽略樱花
var
ischery
=
this
.
checkisCherry
(
i
);
if
(
ischery
){
continue
;
}
switch
(
elements
[
i
])
{
//如果为0记录空格
case
ElementConfigType
.
EMPTY
:
...
...
@@ -3096,6 +3168,7 @@ export default class MainScene extends Scene {
}
}
}
//樱花绽放,放在fallAllPormise里
//没有可消除元素,执行掉落,
// setTimeout(() => {
...
...
@@ -5693,6 +5766,7 @@ export default class MainScene extends Scene {
this
.
checkFireworksNebEle
(
latttice
,
ele
);
this
.
checkFishNebEle
(
latttice
);
this
.
checkPongoNebEle
(
latttice
,
ele
);
this
.
checkCherryNebEle
(
latttice
);
//如果附近有石头
this
.
checkNebEle
(
latttice
,
(
lat
)
=>
{
return
lat
&&
lat
.
element
&&
lat
.
element
.
type
==
ElementType
.
ROCK
...
...
@@ -5724,6 +5798,8 @@ export default class MainScene extends Scene {
this
.
checkNebEle
(
latttice
,
(
lat
)
=>
{
return
lat
&&
lat
.
element
&&
lat
.
element
.
type
==
ElementType
.
FESTIVALELE_SMALL
&&
(
!
lat
.
block
||
!
lat
.
block
.
isLock
());
});
//樱花元素
}
/**
...
...
@@ -7339,4 +7415,117 @@ export default class MainScene extends Scene {
return
[
cutx
,
cuty
];
}
//新元素樱花
//判断当前位置是否樱花
checkisCherry
(
idx
:
number
){
for
(
var
i
=
0
;
i
<
this
.
cherryData
.
length
;
i
++
){
var
icherydata
=
this
.
cherryData
[
i
];
if
(
icherydata
.
indexOf
(
idx
)
!=-
1
){
return
true
;
}
}
return
false
;
}
//相邻消除激活樱花
checkCherryNebEle
(
lat0
:
Lattice
){
if
(
!
lat0
){
return
;
}
var
indexs
=
this
.
getNextIndexs
(
lat0
);
for
(
let
i
=
0
;
i
<
indexs
.
length
;
i
++
){
let
index
=
indexs
[
i
];
let
lat
=
this
.
lattices
[
index
];
if
(
lat
&&
lat
.
element
){
let
ele
=
lat
.
element
;
if
(
ele
.
type
==
ElementType
.
cherry
&&
ele
.
activeStatus
==
0
){
this
.
activeCherry
(
index
);
}
}
}
}
//特效激活樱花
solveCherryEle
(
cherryArr
:
Array
<
number
>
){
}
//激活樱花
activeCherry
(
idx
:
number
){
console
.
log
(
"1消除樱花----------------------"
,
idx
);
var
lat
=
this
.
lattices
[
idx
];
var
ele
=
this
.
lattices
[
idx
].
element
;
let
pro1
=
ele
.
activeCherry
();
this
.
fallAllPormise
.
push
(
pro1
);
var
nearidxs
:
Array
<
{
forback
:
string
,
idx
:
number
}
>
=
this
.
getNearCherry
(
idx
);
//消除自身时,把连接自身的棍消除
this
.
removeCherryGun
(
idx
,
nearidxs
);
console
.
log
(
"2消除樱花----------------------"
,
JSON
.
stringify
(
nearidxs
));
// var pro2 = new Promise(res=>{
// setTimeout(() => {
// res();
// }, 200);
// })
// this.fallAllPormise.push(pro2);
for
(
let
i
=
0
;
i
<
nearidxs
.
length
;
i
++
){
let
nidx
=
nearidxs
[
i
].
idx
;
let
nlat
=
this
.
lattices
[
nidx
];
let
nele
=
nlat
.
element
;
if
(
nele
&&
nele
.
type
==
ElementType
.
cherry
&&
nele
.
activeStatus
==
0
){
this
.
activeCherry
(
nidx
);
}
}
}
//获取相邻樱花
getNearCherry
(
idx
:
number
){
var
nearidxs
=
new
Array
();
for
(
var
i
=
0
;
i
<
this
.
cherryData
.
length
;
i
++
){
var
icherydata
=
this
.
cherryData
[
i
];
for
(
var
j
=
0
;
j
<
icherydata
.
length
;
j
++
){
var
latidx
=
icherydata
[
j
];
if
(
latidx
==
idx
){
if
(
j
>
0
){
nearidxs
.
push
(
{
forback
:
"for"
,
idx
:
icherydata
[
j
-
1
]
}
);
}
if
(
j
<
icherydata
.
length
-
1
){
nearidxs
.
push
({
forback
:
"back"
,
idx
:
icherydata
[
j
+
1
]
});
}
break
;
}
}
}
return
nearidxs
;
}
//消除樱花棍
removeCherryGun
(
idx
:
number
,
nearidxs
:
Array
<
{
forback
:
string
,
idx
:
number
}
>
){
for
(
var
i
=
0
;
i
<
nearidxs
.
length
;
i
++
){
var
ineardata
=
nearidxs
[
i
];
var
iforback
=
ineardata
.
forback
;
var
iidx
=
ineardata
.
idx
;
var
iguname
=
""
;
if
(
iforback
==
"for"
){
iguname
=
"sz_"
+
idx
+
"_"
+
iidx
;
}
else
if
(
iforback
==
"back"
){
iguname
=
"sz_"
+
iidx
+
"_"
+
idx
;
}
var
isz
=
this
.
mapupContainer
.
getChildByName
(
iguname
);
isz
&&
this
.
mapupContainer
.
removeChild
(
isz
);
}
}
}
\ No newline at end of file
egret/src/something/Tool.ts
View file @
87904b64
...
...
@@ -305,7 +305,9 @@ export class Tool {
// lat.element.type == ElementType.FESTIVALELE_SMALL
lat
.
element
.
type
==
ElementType
.
CANNO
||
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
||
lat
.
element
.
type
==
ElementType
.
Pongo
lat
.
element
.
type
==
ElementType
.
Pongo
||
lat
.
element
.
type
==
ElementType
.
cherry
)
{
return
false
}
...
...
@@ -370,7 +372,8 @@ export class Tool {
lat
.
element
.
type
==
ElementType
.
FIREWORKS_SHOOTER
||
lat
.
element
.
type
==
ElementType
.
CANNO
||
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
||
lat
.
element
.
type
==
ElementType
.
Pongo
lat
.
element
.
type
==
ElementType
.
Pongo
||
lat
.
element
.
type
==
ElementType
.
cherry
)
{
return
false
}
...
...
@@ -472,7 +475,9 @@ export class Tool {
ele
.
type
==
ElementType
.
FESTIVALELE_SMALL
||
ele
.
type
==
ElementType
.
CANNO
||
ele
.
type
==
ElementType
.
CANNO_BLOCK
||
ele
.
type
==
ElementType
.
Pongo
ele
.
type
==
ElementType
.
Pongo
||
ele
.
type
==
ElementType
.
cherry
)
{
return
false
;
}
...
...
@@ -501,7 +506,8 @@ export class Tool {
ele
.
hasState
(
StateType
.
HAIRBALLBROWN
)
||
ele
.
type
==
ElementType
.
CANNO
||
ele
.
type
==
ElementType
.
CANNO_BLOCK
||
ele
.
type
==
ElementType
.
Pongo
ele
.
type
==
ElementType
.
Pongo
||
ele
.
type
==
ElementType
.
cherry
)
{
return
false
;
}
...
...
egret/src/something/chapters/Chapter32.ts
View file @
87904b64
...
...
@@ -2,14 +2,14 @@ import { ChapterData } from "../interface/ChapterData";
//801-825
export
const
Chapters32
:
ChapterData
[]
=
[
//
75
1
//
80
1
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
bubbleProbability
:
0
,
stepCount
:
26
,
passTarget
:
{
type
:
1
,
elements
:
[
{
type
:
9
,
count
:
71
},
{
type
:
0
,
count
:
102
}
]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
3
,
3
,
0
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
0
,
3
,
3
,
1
,
1
,
0
,
3
,
3
,
3
,
0
,
3
,
3
,
1
,
1
,
0
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
3
,
61
,
3
,
3
,
3
,
61
,
3
,
3
,
...
...
egret/src/something/chapters/getChapter.ts
View file @
87904b64
...
...
@@ -89,7 +89,7 @@ chapters.forEach((chapter,index) => {
*/
export
function
getChapterData
(
index
:
number
):
ChapterData
{
//没有数据就返回第一关数据
// return chapters[75
1];
return
chapters
[
80
1
];
return
chapters
[
index
]
||
chapters
[
1
];
}
...
...
egret/src/something/class/Element.ts
View file @
87904b64
...
...
@@ -1313,4 +1313,21 @@ export class Element extends eui.Component {
onElimiate
(){}
get
isActive
()
{
return
false
}
canElimite
:
boolean
;
//激活樱花
activeStatus
:
number
=
0
;
//0未激活,1绽放中,2,结束
activeCherry
(){
this
.
activeStatus
=
1
;
return
new
Promise
(
res
=>
{
egret
.
Tween
.
get
(
this
.
showImage
)
.
to
({
alpha
:
0
},
300
)
.
call
(
function
(){
this
.
activeStatus
=
2
;
res
();
},
null
);
})
}
}
\ No newline at end of file
egret/src/something/class/shuzhi.ts
0 → 100644
View file @
87904b64
export
default
class
shuzhi
extends
egret
.
Bitmap
{
constructor
(){
super
();
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"ele46_sz_png"
);
if
(
!
texture
){
console
.
error
(
"检查树枝纹理"
);
return
;
};
this
.
texture
=
texture
;
this
.
anchorOffsetX
=
texture
.
textureWidth
/
2
;
this
.
anchorOffsetY
=
texture
.
textureHeight
/
2
;
this
.
touchEnabled
=
false
;
}
//树枝旋转,hor横向树枝,vir竖向树枝
setroa
(
type
:
string
){
var
roa
:
number
=
0
;
if
(
type
==
"hor"
){
roa
=
0
;
}
else
if
(
type
==
"vir"
){
roa
=
90
;
}
this
.
rotation
=
roa
;
console
.
log
(
"树枝啦啦啦啦"
,
this
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment