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
36366b73
Commit
36366b73
authored
May 09, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
草坪暂存
parent
baf9d383
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
55 deletions
+68
-55
MainScene.ts
egret/src/mainScene/MainScene.ts
+62
-49
Chapter28.ts
egret/src/something/chapters/Chapter28.ts
+5
-5
getChapter.ts
egret/src/something/chapters/getChapter.ts
+1
-1
No files found.
egret/src/mainScene/MainScene.ts
View file @
36366b73
...
...
@@ -497,6 +497,10 @@ export default class MainScene extends Scene {
this
.
lollipopCount
=
0
;
this
.
hasPassed
=
false
;
this
.
isCountingTime
=
false
;
this
.
freepongoArr
=
new
Array
();
this
.
gopongoArr
=
new
Array
();
this
.
actpongoArr
=
new
Array
();
this
.
initTurf
();
...
...
@@ -1993,14 +1997,14 @@ export default class MainScene extends Scene {
}
}
}
this
.
initOneElmtTag
();
this
.
addNewTurf
(
mainidxs
,
allidxs
);
//特效消除猩猩
this
.
checkPongoHVEle
(
rc
[
0
],
rc
[
1
],
"hor"
);
this
.
checkPongoHVEle
(
rc
[
0
],
rc
[
1
],
"vir"
);
setTimeout
(()
=>
{
this
.
initOneElmtTag
();
this
.
addNewTurf
(
mainidxs
,
allidxs
);
this
.
eliminate
(
pcannostatArr
);
},
200
)
break
;
...
...
@@ -3957,6 +3961,7 @@ export default class MainScene extends Scene {
npdata
.
addnum
=
1
;
}
}
////TODO
//特效消除猩猩
var
pongor
=
[
{
...
...
@@ -3990,6 +3995,34 @@ export default class MainScene extends Scene {
var
allidxs
:
Array
<
number
>
=
new
Array
();
mainidxs
=
[
one
,
two
];
//回收
this
.
recoverEle
(
one
)
this
.
recoverEle
(
two
)
//添加消除元素two,同行或同列,需要优化
for
(
var
i
=
0
;
i
<
this
.
lattices
.
length
;
i
++
)
{
var
lat
=
this
.
lattices
[
i
];
if
(
lat
&&
(
Math
.
abs
(
lat
.
row
-
lat1
.
row
)
<
2
||
Math
.
abs
(
lat
.
column
-
lat1
.
column
)
<
2
)){
allidxs
.
push
(
i
);
}
if
(
Tool
.
judgeEliminate
(
lat
)
&&
(
Math
.
abs
(
lat
.
row
-
lat1
.
row
)
<
2
||
Math
.
abs
(
lat
.
column
-
lat1
.
column
)
<
2
))
{
// if(canturgrass&&Tool.judgeTurfto(lat)){
// grassArr.push(i);
// }
if
(
this
.
eliminatedElements
.
indexOf
(
i
)
==
-
1
)
this
.
eliminatedElements
.
push
(
i
);
if
(
this
.
lattices
[
i
].
element
.
type
==
ElementType
.
FISH
)
{
this
.
lattices
[
i
].
element
.
nextFishState
();
}
if
(
Tool
.
judgeHasScore
(
lat
.
element
))
{
//线和炸弹
this
.
pushScoreAni
(
baseScore
*
this
.
effectContinuityTimes
*
effectBaseTimes
.
EL
,
Tool
.
getPositionByIndex
(
i
))
}
}
}
this
.
addNewTurf
(
mainidxs
,
allidxs
);
for
(
var
pr1
=
0
;
pr1
<
pongor
.
length
;
pr1
++
){
var
prcdata
=
pongor
[
pr1
];
var
prcrow
=
prcdata
.
row
;
...
...
@@ -3998,7 +4031,6 @@ export default class MainScene extends Scene {
// if(canturgrass){
// this.turfEliHorPassCp(prcrow,prccol,turfCp);
// }
// this.turfEliHorPassCp(prcrow,prccol,allidxs);
this
.
checkPongoHVEle
(
prcrow
,
prccol
,
"hor"
);
for
(
var
np
=
0
;
np
<
pcannostatArr
.
length
;
np
++
){
...
...
@@ -4018,7 +4050,6 @@ export default class MainScene extends Scene {
// if(canturgrass){
// this.turfEliVerPassCp(prcrow,prccol,turfCp);
// }
// this.turfEliVerPassCp(prcrow,prccol,allidxs);
this
.
checkPongoHVEle
(
prcrow
,
prccol
,
"vir"
);
for
(
var
np
=
0
;
np
<
pcannostatArr
.
length
;
np
++
){
...
...
@@ -4030,34 +4061,6 @@ export default class MainScene extends Scene {
}
}
}
//回收
this
.
recoverEle
(
one
)
this
.
recoverEle
(
two
)
//添加消除元素two,同行或同列,需要优化
for
(
var
i
=
0
;
i
<
this
.
lattices
.
length
;
i
++
)
{
var
lat
=
this
.
lattices
[
i
];
if
(
lat
&&
(
Math
.
abs
(
lat
.
row
-
lat1
.
row
)
<
2
||
Math
.
abs
(
lat
.
column
-
lat1
.
column
)
<
2
)){
allidxs
.
push
(
i
);
}
if
(
Tool
.
judgeEliminate
(
lat
)
&&
(
Math
.
abs
(
lat
.
row
-
lat1
.
row
)
<
2
||
Math
.
abs
(
lat
.
column
-
lat1
.
column
)
<
2
))
{
// if(canturgrass&&Tool.judgeTurfto(lat)){
// grassArr.push(i);
// }
if
(
this
.
eliminatedElements
.
indexOf
(
i
)
==
-
1
)
this
.
eliminatedElements
.
push
(
i
);
if
(
this
.
lattices
[
i
].
element
.
type
==
ElementType
.
FISH
)
{
this
.
lattices
[
i
].
element
.
nextFishState
();
}
if
(
Tool
.
judgeHasScore
(
lat
.
element
))
{
//线和炸弹
this
.
pushScoreAni
(
baseScore
*
this
.
effectContinuityTimes
*
effectBaseTimes
.
EL
,
Tool
.
getPositionByIndex
(
i
))
}
}
}
this
.
addNewTurf
(
mainidxs
,
allidxs
);
}
//如果两个爆炸
else
if
(
ele1
.
effectType
==
EffectType
.
EXPLOSIVE
&&
ele2
.
effectType
==
EffectType
.
EXPLOSIVE
)
{
...
...
@@ -5104,6 +5107,8 @@ export default class MainScene extends Scene {
freepongoArr
:
Array
<
number
>
=
[];
//准备离开的猩猩
gopongoArr
:
Array
<
number
>
=
[];
//猩猩行为
actpongoArr
:
Array
<
number
>
=
[];
//相邻消除解救猩猩
checkPongoNebEle
(
lat0
:
Lattice
,
ele
?:
Element
)
{
if
(
!
lat0
||
!
ele
)
return
;
...
...
@@ -5286,6 +5291,7 @@ export default class MainScene extends Scene {
* @param tlidx 拍框猩猩的左上
*/
pongoPaiKuang
(
tlidx
:
number
){
console
.
log
(
"猩猩拍框"
);
//随机发框
var
kuangarr
:
Array
<
number
>
=
new
Array
();
var
canusearr
:
Array
<
number
>
=
new
Array
();
//可以作为左上角的
...
...
@@ -5456,6 +5462,7 @@ export default class MainScene extends Scene {
* 多猩猩清场,猩猩下有草坪,清场铺草坪
*/
pongoClearScene
(){
// console.log("猩猩清场");
//判断清场猩猩中是否包含草坪
// var canturgrass = false;
// var grassArr = new Array();
...
...
@@ -6026,19 +6033,17 @@ export default class MainScene extends Scene {
* 猩猩的相关消除
*/
clearPongoEle
(
pongoidx
:
number
){
if
(
this
.
freepongoArr
.
length
==
1
){
this
.
pongoPaiKuang
(
this
.
freepongoArr
[
0
]);
}
else
if
(
this
.
freepongoArr
.
length
>
1
){
this
.
pongoClearScene
();
if
(
this
.
actpongoArr
.
indexOf
(
pongoidx
)
==-
1
){
this
.
actpongoArr
.
push
(
pongoidx
);
}
// if(this.gopongoArr.indexOf(pongoidx)==-1
){
// this.gopongoArr.push(pongoidx);
// }
// if(this.gopongoArr.length==this.freepongoArr.length
){
// console.log("猩猩开始消除",JSON.stringify(this.gopongoArr),JSON.stringify(this.freepongoArr))
// this.gopongoArr = new Array();
// this.freepongoArr = new Array();
// }
if
(
this
.
actpongoArr
.
length
==
this
.
freepongoArr
.
length
){
if
(
this
.
freepongoArr
.
length
==
1
){
this
.
pongoPaiKuang
(
this
.
freepongoArr
[
0
]);
}
else
if
(
this
.
freepongoArr
.
length
>
1
){
this
.
pongoClearScene
();
}
}
}
checkEliminatePongo
(
pongoidx
:
number
){
if
(
this
.
gopongoArr
.
indexOf
(
pongoidx
)
==-
1
){
...
...
@@ -6048,6 +6053,7 @@ export default class MainScene extends Scene {
// console.log("猩猩开始消除",JSON.stringify(this.gopongoArr),JSON.stringify(this.freepongoArr))
this
.
gopongoArr
=
new
Array
();
this
.
freepongoArr
=
new
Array
();
this
.
actpongoArr
=
new
Array
();
this
.
eliminate
();
}
}
...
...
@@ -6126,10 +6132,12 @@ export default class MainScene extends Scene {
return
canturt
;
}
checkTurfing
(
grassArr
:
Array
<
Array
<
number
>>
){
console
.
log
(
"组检测啦啦啦啦啦啦"
,
JSON
.
stringify
(
grassArr
),
JSON
.
parse
(
JSON
.
stringify
(
grassArr
)));
for
(
var
i
=
0
;
i
<
grassArr
.
length
;
i
++
){
var
igrassarr
=
grassArr
[
i
];
var
mainidxs
=
igrassarr
;
var
allidxs
=
igrassarr
;
var
mainidxs
=
new
Array
()
;
var
allidxs
=
new
Array
()
;
for
(
var
i1
=
0
;
i1
<
igrassarr
.
length
;
i1
++
){
if
(
this
.
lattices
[
igrassarr
[
i1
]]){
mainidxs
.
push
(
igrassarr
[
i1
]);
...
...
@@ -6398,6 +6406,7 @@ export default class MainScene extends Scene {
var
maindata
=
new
Array
();
var
alldata
=
new
Array
();
var
i1cantff
:
boolean
=
false
;
for
(
var
i1
=
0
;
i1
<
mainidxs
.
length
;
i1
++
){
var
i1idx
=
mainidxs
[
i1
];
var
i1canturff
=
this
.
judgeTurfing
(
i1idx
);
...
...
@@ -6409,13 +6418,17 @@ export default class MainScene extends Scene {
canturft
:
i1canturft
}
maindata
.
push
(
i1data
);
if
(
i1canturff
){
i1cantff
=
true
;
}
}
for
(
var
i2
=
0
;
i2
<
allidxs
.
length
;
i2
++
){
var
i2idx
=
allidxs
[
i2
];
var
i2canturff
=
this
.
judgeTurfing
(
i2idx
);
var
i2canturft
=
this
.
judgeTurfto
(
i2idx
);
//炮台,猩猩只会被特效铺上草
var
isCannoPn
=
Tool
.
checkIsCannoPn
(
this
.
lattices
[
i2idx
]);
if
(
isCannoPn
){
if
(
isCannoPn
&&
i1cantff
){
this
.
turfing
(
i2idx
);
i2canturff
=
true
;
i2canturft
=
false
;
...
...
egret/src/something/chapters/Chapter28.ts
View file @
36366b73
...
...
@@ -8,7 +8,7 @@ export const Chapters28: ChapterData[] = [
lattices
:
[
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
91
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
8
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
...
...
@@ -22,11 +22,11 @@ export const Chapters28: ChapterData[] = [
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
19
,
19
,
1
,
1
,
1
,
1
,
1
,
4
,
2
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
1
,
1
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
5
,
4
,
5
,
12
,
5
,
4
,
5
,
1
,
1
,
1
,
4
,
4
,
4
,
4
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
4
,
1
,
1
,
1
,
1
,
1
,
9
,
4
,
9
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
...
...
egret/src/something/chapters/getChapter.ts
View file @
36366b73
...
...
@@ -80,7 +80,7 @@ chapters.forEach((chapter,index) => {
*/
export
function
getChapterData
(
index
:
number
):
ChapterData
{
//没有数据就返回第一关数据
// return chapters[70
2
];
// return chapters[70
1
];
return
chapters
[
index
]
||
chapters
[
1
];
}
...
...
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