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
bc52922b
Commit
bc52922b
authored
Apr 03, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
猩猩消除暂存
parent
570f1d68
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
151 additions
and
6 deletions
+151
-6
MainBase.ts
egret/libs/new_wx/MainBase.ts
+1
-0
kuang.png
egret/resource/assets/mainScene/kuang.png
+0
-0
default.res.json
egret/resource/default.res.json
+6
-1
MainScene.ts
egret/src/mainScene/MainScene.ts
+141
-2
Chapter23.ts
egret/src/something/chapters/Chapter23.ts
+1
-1
Element.ts
egret/src/something/class/Element.ts
+2
-1
PongoLockState.ts
egret/src/something/states/PongoLockState.ts
+0
-1
No files found.
egret/libs/new_wx/MainBase.ts
View file @
bc52922b
...
...
@@ -312,6 +312,7 @@ export default class MainBase extends eui.UILayer {
RES
.
getResAsync
(
"ele38_png"
);
RES
.
getResAsync
(
"ele39_png"
);
RES
.
getResAsync
(
"ele40_png"
);
RES
.
getResAsync
(
"kuang_png"
);
for
(
var
i
=
1
;
i
<=
27
;
i
++
)
{
RES
.
getResAsync
(
"bonusFra"
+
i
+
"_png"
)
}
...
...
egret/resource/assets/mainScene/kuang.png
0 → 100644
View file @
bc52922b
20.2 KB
egret/resource/default.res.json
View file @
bc52922b
...
...
@@ -242,7 +242,7 @@
},
{
"name"
:
"preload"
,
"keys"
:
"ele40_png"
"keys"
:
"ele40_png
,kuang_png
"
}
],
"resources"
:
[
...
...
@@ -5376,6 +5376,11 @@
"name"
:
"ele40_png"
,
"type"
:
"image"
,
"url"
:
"assets/mainScene/ele40.png"
},
{
"name"
:
"kuang_png"
,
"type"
:
"image"
,
"url"
:
"assets/mainScene/kuang.png"
}
]
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
bc52922b
...
...
@@ -2441,6 +2441,9 @@ export default class MainScene extends Scene {
* 掉落完后的操作
*/
async
fallCallback
()
{
//掉落后先走猩猩的消除
//掉落后有消除,执行消除
if
(
this
.
threeMatch
())
{
this
.
eliminate
();
...
...
@@ -3952,13 +3955,14 @@ export default class MainScene extends Scene {
var
pglockstat
=
StateType
.
PongoLockState
;
//本次参与的消除的猩猩
//有几只猩猩自由了
var
freepongoArr
:
Array
<
number
>
=
new
Array
();
for
(
var
p
=
0
;
p
<
alockPongo
.
length
;
p
++
){
var
tlpongoidx
=
alockPongo
[
p
];
var
trpongoidx
=
tlpongoidx
+
1
;
var
blpongoidx
=
tlpongoidx
+
Tool
.
colNum
;
var
brpongoidx
=
blpongoidx
+
1
;
var
tlpartstat
=
this
.
lattices
[
tlpongoidx
].
element
.
hasState
(
pglockstat
);
var
trpartstat
=
this
.
lattices
[
trpongoidx
].
element
.
hasState
(
pglockstat
);
var
blpartstat
=
this
.
lattices
[
blpongoidx
].
element
.
hasState
(
pglockstat
);
...
...
@@ -3966,7 +3970,142 @@ export default class MainScene extends Scene {
//猩猩自由了
if
(
!
tlpartstat
&&!
trpartstat
&&!
blpartstat
&&!
brpartstat
){
console
.
log
(
tlpongoidx
,
"猩猩自由了"
);
console
.
log
(
tlpongoidx
,
"这个猩猩自由了"
);
freepongoArr
.
push
(
tlpongoidx
);
}
}
}
kuangimgarr
:
Array
<
eui
.
Image
>
=
[];
/**
* 猩猩拍框,
* @param tlidx 拍框猩猩的左上
*/
pongoPaiKuang
(
tlidx
:
number
){
for
(
var
c1
=
this
.
kuangimgarr
.
length
-
1
;
c1
>=
0
;
c1
++
){
var
c1img
=
this
.
kuangimgarr
[
c1
];
if
(
c1img
&&
c1img
.
parent
){
c1img
.
parent
.
removeChild
(
c1img
);
}
this
.
kuangimgarr
.
splice
(
c1
,
1
);
}
console
.
log
(
"猩猩拍框"
);
//随机发框
var
kuangarr
:
Array
<
number
>
=
new
Array
();
var
canusearr
:
Array
<
number
>
=
new
Array
();
//可以作为左上角的
var
allusearr
:
Array
<
number
>
=
new
Array
();
//所有的位置
var
tridx
=
tlidx
+
1
;
var
blidx
=
tlidx
+
Tool
.
colNum
;
var
bridx
=
blidx
+
1
;
var
pongoarr1
=
[
tlidx
,
tridx
,
blidx
,
bridx
];
for
(
var
k1row
=
0
;
k1row
<
Tool
.
rowNum
;
k1row
++
){
for
(
var
k1col
=
0
;
k1col
<
Tool
.
colNum
;
k1col
++
){
var
k1index
=
Tool
.
rcToIndex
(
k1row
,
k1col
);
var
isinpongo
=
pongoarr1
.
indexOf
(
k1index
);
if
(
isinpongo
==-
1
){
//粗略的去除拍的猩猩
if
(
k1row
<=
7
&&
k1col
<=
6
){
//全部可用左上
//需要去除会占到该猩猩的
canusearr
.
push
(
k1index
);
}
allusearr
.
push
(
k1index
);
}
}
}
// console.log("所有可作为左上角的",canusearr,"\n所有位置",allusearr);
//原来9*9
while
(
kuangarr
.
length
<
4
){
var
randkidx
=
Math
.
floor
(
Math
.
random
()
*
canusearr
.
length
);
var
randk
=
canusearr
[
randkidx
];
var
randkrc
=
Tool
.
indexToRc
(
randk
);
var
klatrow
=
randkrc
[
0
];
var
klatcol
=
randkrc
[
1
];
//把框占位的都加进去
var
k1idx
=
randk
;
var
k2idx
=
randk
+
1
;
var
k3idx
=
randk
+
2
;
var
k4idx
=
randk
+
Tool
.
colNum
;
var
k5idx
=
randk
+
Tool
.
colNum
+
1
;
var
k6idx
=
randk
+
Tool
.
colNum
+
2
;
var
kuangidxarr
=
[
k1idx
,
k2idx
,
k3idx
,
k4idx
,
k5idx
,
k6idx
];
var
allhave
:
boolean
=
true
;
var
haveele
:
boolean
=
false
;
for
(
var
k2
=
0
;
k2
<
kuangidxarr
.
length
;
k2
++
){
var
k2kuangidx
=
kuangidxarr
[
k2
];
var
lat
=
this
.
lattices
[
k2kuangidx
];
if
(
lat
){
haveele
=
true
;
}
var
k2kuanginuse
=
allusearr
.
indexOf
(
k2kuangidx
);
if
(
k2kuanginuse
==-
1
){
allhave
=
false
;
break
;
}
var
incanuseidx
=
canusearr
.
indexOf
(
k2kuangidx
);
if
(
incanuseidx
==-
1
){
}
}
if
(
allhave
&&
haveele
){
//所占框都可用
for
(
var
k3
=
0
;
k3
<
kuangidxarr
.
length
;
k3
++
){
var
k3kuangidx
=
kuangidxarr
[
k3
];
var
k3allinuse
=
allusearr
.
indexOf
(
k3kuangidx
);
if
(
k3allinuse
==-
1
){
console
.
error
(
"出现了问题,检查"
);
}
else
{
allusearr
.
splice
(
k3allinuse
,
1
);
}
var
k3caninuse
=
canusearr
.
indexOf
(
k3kuangidx
);
if
(
k3caninuse
!=-
1
){
}
else
{
canusearr
.
splice
(
k3caninuse
,
1
);
}
}
kuangarr
.
push
(
k1idx
);
}
}
console
.
log
(
"四个框"
,
kuangarr
);
for
(
var
i
=
0
;
i
<
kuangarr
.
length
;
i
++
){
var
ikuang
=
kuangarr
[
i
];
var
pos
=
Tool
.
getPositionByIndex
(
ikuang
);
var
kuangpos
=
this
.
elementContainer
.
localToGlobal
(
pos
[
0
],
pos
[
1
]);
var
ikuangimg
=
new
eui
.
Image
(
"kuang_png"
);
this
.
addChild
(
ikuangimg
);
ikuangimg
.
x
=
kuangpos
.
x
-
40
;
ikuangimg
.
y
=
kuangpos
.
y
-
40
;
this
.
kuangimgarr
.
push
(
ikuangimg
);
}
}
/**
* 多猩猩清场
*/
pongoClearScene
(){
for
(
var
i
=
0
;
i
<
this
.
lattices
.
length
;
i
++
)
{
var
lat
=
this
.
lattices
[
i
];
if
(
Tool
.
judgeEliminate
(
lat
))
{
//本来没必要判断特效组合时是否有重复的消除元素,但是recoverEle里会有判断石头或果冻的加入,造成重复
if
(
this
.
eliminatedElements
.
indexOf
(
i
)
==
-
1
)
this
.
eliminatedElements
.
push
(
i
);
if
(
this
.
lattices
[
i
].
element
.
type
==
ElementType
.
FISH
)
{
this
.
lattices
[
i
].
element
.
nextFishState
();
}
//两个魔力鸟分数MM
if
(
Tool
.
judgeHasScore
(
lat
.
element
))
{
this
.
pushScoreAni
(
baseScore
*
this
.
effectContinuityTimes
*
effectBaseTimes
.
MM
,
Tool
.
getPositionByIndex
(
i
))
}
}
}
}
...
...
egret/src/something/chapters/Chapter23.ts
View file @
bc52922b
...
...
@@ -5,7 +5,7 @@ import { ElementType } from "../enum/ElementType";
export
const
Chapters23
:
ChapterData
[]
=
[
//测试576
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
25
,
passTarget
:
{
...
...
egret/src/something/class/Element.ts
View file @
bc52922b
...
...
@@ -218,13 +218,14 @@ export class Element extends eui.Component {
}
//猩猩的哪个部分
inPongoPart
:
string
;
//暂给猩猩两种状态,normal正常,readyelm准备消除
/**
* 设置为猩猩的一部分
* @param part
*/
setPongoPart
(
part
:
string
){
this
.
inPongoPart
=
part
;
console
.
log
(
"我是猩猩的"
+
part
);
//
console.log("我是猩猩的"+part);
if
(
part
==
"tl"
){
var
source
=
"ele40_png"
;
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
...
...
egret/src/something/states/PongoLockState.ts
View file @
bc52922b
...
...
@@ -15,7 +15,6 @@ export class PongoLockState extends State{
* @param inPongoPart
*/
reset
(
inPongoPart
:
string
)
{
console
.
log
(
"设置状态--猩猩的部位"
,
inPongoPart
);
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"lockVine_png"
);
if
(
this
.
showImage
&&
this
.
showImage
.
parent
){
...
...
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