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
5810d6a4
Commit
5810d6a4
authored
Mar 12, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
37af37d1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
87 additions
and
32 deletions
+87
-32
MainScene.ts
egret/src/mainScene/MainScene.ts
+9
-1
doConveyorAI.ts
egret/src/mainScene/doConveyorAI.ts
+12
-10
Chapter20 copy.ts
egret/src/something/chapters/Chapter20 copy.ts
+10
-3
Chapter20.ts
egret/src/something/chapters/Chapter20.ts
+6
-3
Element.ts
egret/src/something/class/Element.ts
+5
-4
Fish.ts
egret/src/something/class/Fish.ts
+14
-5
Monster.ts
egret/src/something/class/Monster.ts
+16
-2
cloneElement.ts
egret/src/something/cloneElement.ts
+15
-4
No files found.
egret/src/mainScene/MainScene.ts
View file @
5810d6a4
...
...
@@ -163,6 +163,7 @@ for (let i = 1; i < 999; i++) { /// TODO 测试
const
festivalIndex
:
number
=
40
;
export
default
class
MainScene
extends
Scene
{
private
_converyorTag
;
get
skinKey
()
{
return
'Main2'
}
...
...
@@ -1259,6 +1260,7 @@ export default class MainScene extends Scene {
}
}
setTimeout
(()
=>
{
this
.
_converyorTag
=
true
;
this
.
eliminate
();
},
200
)
break
;
...
...
@@ -1270,6 +1272,7 @@ export default class MainScene extends Scene {
Tool
.
getPositionByIndex
(
index
)
)
}
this
.
_converyorTag
=
true
;
this
.
eliminate
();
break
;
case
PropType
.
CHANCE_NUM
:
...
...
@@ -1296,6 +1299,7 @@ export default class MainScene extends Scene {
mouseDownE
(
e
:
egret
.
TextEvent
)
{
// if (!this.enableTouch) return
this
.
_converyorTag
=
true
;
var
self
=
this
;
if
(
e
.
target
.
parent
instanceof
Element
)
{
//去掉提示动画
...
...
@@ -1321,6 +1325,7 @@ export default class MainScene extends Scene {
}
mouseMoveE
(
e
)
{
this
.
_converyorTag
=
true
;
if
(
this
.
SELECTED
&&
e
.
target
.
parent
instanceof
Element
)
{
if
(
!
Tool
.
judgeChosen
(
e
.
target
.
parent
))
return
if
(
Tool
.
checkNeb
(
e
.
target
.
parent
,
this
.
SELECTED
))
{
...
...
@@ -2069,7 +2074,10 @@ export default class MainScene extends Scene {
this
.
eliminate
();
return
}
await
doConveyorAI
(
this
);
if
(
this
.
_converyorTag
)
{
await
doConveyorAI
(
this
);
this
.
_converyorTag
=
false
;
}
await
doSandAI
(
this
);
const
doHoneyPotAIResult
=
await
doHoneyPotAI
(
this
);
if
(
doHoneyPotAIResult
.
length
>
0
)
{
//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
...
...
egret/src/mainScene/doConveyorAI.ts
View file @
5810d6a4
...
...
@@ -77,16 +77,12 @@ const getTargetConveyor = (thisObj: MainScene, targetIndex: number) => {
};
export
default
async
(
thisObj
:
MainScene
)
=>
{
//移动的动画,如果是两头的需要一个带遮罩的动画,会涉及元素的复制
//复制的元素为了保险,只做动画用。
//检查与其他元素的兼容性,比如带有svga的独眼怪、果冻怪等等
//糖果兼容
const
{
elementContainer
}
=
thisObj
;
const
conveyorList
=
thisObj
.
chapterData
.
map
.
conveyor
;
if
(
!
conveyorList
)
return
;
const
elementsList
=
[];
//所有轨道元素组的列表
const
targetLatticesList
:
Lattice
[][]
=
[];
//所有轨道目标地图组的列表
const
latticesList
=
[];
//所有轨道当前地图组的列表
const
latticesList
:
Lattice
[][]
=
[];
//所有轨道当前地图组的列表
const
targetIndexsList
=
[];
let
listItems
=
[];
...
...
@@ -108,8 +104,10 @@ export default async (thisObj: MainScene) => {
targetIndexs
[
0
]
=
foundTarget
;
}
console
.
log
(
list
,
targetIndexs
);
const
elements
=
list
.
map
(
index
=>
thisObj
.
lattices
[
index
].
element
);
//当前传送带元素
// console.log(list, targetIndexs);
const
elements
=
list
.
map
(
index
=>
thisObj
.
lattices
[
index
].
element
);
//当前传送带元素
const
lattices
=
list
.
map
(
index
=>
thisObj
.
lattices
[
index
]);
//当前的lattices
const
targetLattices
=
targetIndexs
.
map
(
index
=>
thisObj
.
lattices
[
index
]);
...
...
@@ -123,8 +121,6 @@ export default async (thisObj: MainScene) => {
lattices
.
forEach
(
lat
=>
lat
.
element
=
null
);
});
const
promiseList
:
Promise
<
any
>
[]
=
[];
elementsList
.
forEach
((
elements
,
i
)
=>
{
const
conveyor
=
conveyorList
[
i
];
...
...
@@ -134,7 +130,13 @@ export default async (thisObj: MainScene) => {
const
lastListIndex
=
getLastListIndex
(
conveyor
);
elements
.
forEach
((
ele
,
eleIndex
)
=>
{
targetLattices
[
eleIndex
].
element
=
ele
;
if
(
!
ele
)
return
;
if
(
!
ele
)
{
const
currentEleIndex
=
lattices
[
eleIndex
].
index
;
const
targetEleIndex
=
targetLattices
[
eleIndex
].
index
;
const
emptyIndex
=
thisObj
.
emptys
.
indexOf
(
currentEleIndex
);
thisObj
.
emptys
[
emptyIndex
]
=
targetEleIndex
;
return
;
}
const
targetP
=
Tool
.
getPositionByIndex
(
targetIndexs
[
eleIndex
]);
const
promise
=
new
Promise
((
r
)
=>
{
//这里判断哪个是尾部的元素.
...
...
egret/src/something/chapters/Chapter20 copy.ts
View file @
5810d6a4
import
{
ChapterData
}
from
"../interface/ChapterData"
;
import
{
PassType
}
from
"../enum/PassType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//501-525
export
const
Chapters20
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
25
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
2
,
count
:
88
}]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
],
connectedLats
:
[[
31
,
49
]],
conveyor
:
[[
24
,
60
],
[
59
,
56
],
[
47
,
20
]],
conveyorConnectedLats
:
[[
60
,
59
],
[
56
,
47
],
[
20
,
24
]],
elements
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
12
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
1
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
13
,
type
:
null
}]
}
}
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
bubbleProbability
:
0
,
stepCount
:
27
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
3
,
count
:
98
}]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
1
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
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
,
0
,
0
,
1
,
0
,
1
,
0
,
0
,
1
],
connectedLats
:
[],
conveyor
:
[[
2
,
65
]],
conveyorConnectedLats
:
[[
65
,
2
]],
elements
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
12
,
1
,
12
,
1
,
12
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
,
1
,
4
,
1
,
2
,
1
,
2
,
1
,
4
,
1
,
1
,
4
,
12
,
2
,
12
,
2
,
12
,
4
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
10
,
type
:
null
},
{
index
:
12
,
type
:
null
},
{
index
:
14
,
type
:
null
},
{
index
:
16
,
type
:
null
}]
}
}
]
\ No newline at end of file
egret/src/something/chapters/Chapter20.ts
View file @
5810d6a4
...
...
@@ -3,9 +3,12 @@ import { ChapterData } from "../interface/ChapterData";
export
const
Chapters20
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
bubbleProbability
:
0
,
stepCount
:
27
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
3
,
count
:
98
}]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
1
,
0
,
2
,
0
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
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
,
0
,
0
,
1
,
0
,
1
,
0
,
0
,
1
],
connectedLats
:
[],
conveyor
:
[[
2
,
65
],
[
6
,
69
],
[
67
,
4
]],
conveyorConnectedLats
:
[[
65
,
2
],
[
69
,
6
],
[
4
,
67
]],
elements
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
12
,
1
,
12
,
1
,
12
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
,
1
,
4
,
1
,
2
,
1
,
2
,
1
,
4
,
1
,
1
,
4
,
12
,
2
,
12
,
2
,
12
,
4
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
10
,
type
:
null
},
{
index
:
12
,
type
:
null
},
{
index
:
14
,
type
:
null
},
{
index
:
16
,
type
:
null
}]
lattices
:
[
1
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
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
,
0
,
0
,
1
,
0
,
1
,
0
,
0
,
1
],
connectedLats
:
[],
conveyor
:
[[
2
,
65
]],
conveyorConnectedLats
:
[[
65
,
2
]],
elements
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
12
,
1
,
12
,
1
,
12
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
,
1
,
4
,
1
,
2
,
1
,
2
,
1
,
4
,
1
,
1
,
4
,
12
,
2
,
12
,
2
,
12
,
4
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
2
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
10
,
type
:
null
},
{
index
:
12
,
type
:
null
},
{
index
:
14
,
type
:
null
},
{
index
:
16
,
type
:
null
}]
}
}
]
\ No newline at end of file
egret/src/something/class/Element.ts
View file @
5810d6a4
...
...
@@ -155,16 +155,17 @@ export class Element extends eui.Component {
});
}
resetToMonsterView
(
res
:
ElementType
)
{
resetToMonsterView
(
res
:
ElementType
,
statusNum
=
0
)
{
this
.
changeSource
(
"ele"
+
res
+
"_png"
);
this
.
monster
=
new
Monster
(
res
,
this
.
type
);
this
.
monster
=
new
Monster
(
res
,
this
.
type
,
statusNum
);
this
.
addChild
(
this
.
monster
);
this
.
showImage
.
alpha
=
0
;
}
resetToFishView
()
{
resetToFishView
(
s
=
'toStandBy'
)
{
this
.
_fishState
=
0
;
this
.
_isNeb
=
false
;
this
[
'fish'
]
=
new
Fish
();
this
[
'fish'
]
=
new
Fish
(
s
);
this
.
addChild
(
this
[
'fish'
]);
this
.
changeSource
(
"ele33_0_png"
);
this
.
showImage
.
alpha
=
0
;
...
...
egret/src/something/class/Fish.ts
View file @
5810d6a4
...
...
@@ -10,31 +10,40 @@ const frames = [
];
export
class
Fish
extends
eui
.
Component
{
_mv
;
constructor
()
{
state
;
constructor
(
s
=
'toStandBy'
)
{
super
();
this
.
initSvga
();
this
.
initSvga
(
s
);
}
async
initSvga
()
{
async
initSvga
(
s
)
{
const
mv
:
any
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/fish.svga'
);
this
.
_mv
=
mv
;
this
.
addChild
(
mv
);
mv
.
anchorOffsetX
=
80
/
2
;
mv
.
anchorOffsetY
=
80
/
2
;
this
.
addEvents
();
this
.
toStandBy
();
if
(
s
==
'toStandBy'
)
this
.
toStandBy
();
if
(
s
==
'toActive'
)
this
.
toActive
();
if
(
s
==
'toExplose'
)
this
.
toExplose
();
}
toStandBy
()
{
this
.
state
=
'toStandBy'
;
this
.
_mv
.
gotoAndPlay
(
1
);
this
.
_start
=
1
this
.
_end
=
180
}
toActive
()
{
this
.
state
=
'toActive'
;
this
.
_mv
.
gotoAndPlay
(
181
);
this
.
_start
=
-
1
this
.
_end
=
-
1
}
toExplose
()
{
this
.
state
=
'toExplose'
;
this
.
_mv
.
stop
();
// this._mv.gotoAndPlay(361);
// this._start = -1
...
...
@@ -52,7 +61,7 @@ export class Fish extends eui.Component {
this
.
_start
=
241
;
this
.
_end
=
360
;
}
if
(
this
.
_mv
.
currentFrame
==
(
361
+
1
))
{
if
(
this
.
_mv
.
currentFrame
==
(
361
+
1
))
{
this
.
_start
=
-
1
;
this
.
_end
=
-
1
;
this
.
_mv
.
stop
();
...
...
egret/src/something/class/Monster.ts
View file @
5810d6a4
...
...
@@ -6,9 +6,22 @@ const frames = [
[
1
,
120
],
[
121
,
360
],
[
361
,
600
],
[
601
,
960
],
[
601
,
841
],
];
export
class
Monster
extends
eui
.
Component
{
resetStatusNum
(
statusNum
)
{
this
.
_statusNum
=
statusNum
;
if
(
this
.
_statusNum
>
4
)
{
this
.
_statusNum
=
4
;
this
.
removeEvents
();
}
//播放动画,动画时间要短200ms以内
if
(
this
.
_statusNum
<=
3
)
{
this
.
changeSource
();
}
}
async
nextStatus
()
{
this
.
_statusNum
++
;
if
(
this
.
_statusNum
>
4
)
{
...
...
@@ -43,6 +56,7 @@ export class Monster extends eui.Component {
* 状态变化 0,1,2,3
*/
private
_statusNum
:
number
;
get
statusNum
(){
return
this
.
_statusNum
}
res
:
ElementType
;
_mv
;
...
...
@@ -82,7 +96,7 @@ export class Monster extends eui.Component {
}
changeSource
()
{
if
(
this
.
_mv
)
if
(
this
.
_mv
&&
frames
[
this
.
_statusNum
]
)
this
.
_mv
.
gotoAndPlay
(
frames
[
this
.
_statusNum
][
0
]);
}
}
\ No newline at end of file
egret/src/something/cloneElement.ts
View file @
5810d6a4
import
{
Tool
}
from
"./Tool"
;
import
{
Element
}
from
"./class/Element"
;
import
{
ElementType
}
from
"./enum/ElementType"
;
export
default
(
fromElement
:
Element
)
=>
{
export
default
(
fromElement
:
Element
)
=>
{
let
ele
=
Tool
.
getElement
(
fromElement
.
type
);
//特效加上
ele
.
effectType
=
fromElement
.
effectType
;
...
...
@@ -15,13 +16,23 @@ export default (fromElement:Element) => {
ele
.
x
=
fromElement
.
x
;
ele
.
y
=
fromElement
.
y
;
if
(
fromElement
.
isMonsterJelly
)
{
ele
.
isMonsterJelly
=
true
;
if
(
fromElement
.
isMonsterJelly
)
{
ele
.
isMonsterJelly
=
true
;
}
if
(
fromElement
.
candy
)
{
if
(
fromElement
.
candy
)
{
ele
.
resetToCandyView
(
fromElement
.
candy
.
baseElement
);
ele
.
candy
.
resetStep
(
fromElement
.
candy
.
step
);
}
if
(
fromElement
.
type
==
ElementType
.
JELLY_MONSTER
)
{
ele
.
resetMonster
();
}
if
(
fromElement
.
monster
)
{
ele
.
resetToMonsterView
(
fromElement
.
monster
.
res
,
fromElement
.
monster
.
statusNum
);
// ele.monster.resetStatusNum(fromElement.monster.statusNum);
}
if
(
fromElement
.
type
==
ElementType
.
FISH
)
{
ele
.
resetToFishView
(
fromElement
[
'fish'
].
state
);
}
return
ele
;
}
\ 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