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
7b360eab
Commit
7b360eab
authored
Mar 27, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动效暂存
parent
e5f98ab7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
137 additions
and
119 deletions
+137
-119
MainScene.ts
egret/src/mainScene/MainScene.ts
+15
-5
Chapter22.ts
egret/src/something/chapters/Chapter22.ts
+40
-73
Element.ts
egret/src/something/class/Element.ts
+82
-41
No files found.
egret/src/mainScene/MainScene.ts
View file @
7b360eab
...
@@ -2424,12 +2424,22 @@ export default class MainScene extends Scene {
...
@@ -2424,12 +2424,22 @@ export default class MainScene extends Scene {
}
}
}
}
}
}
setTimeout
(()
=>
{
canno
.
fireCanno
();
this
.
eliminate
();
// setTimeout(()=>{
// this.eliminate();
this
.
readyCannoArr
.
shift
();
// this.readyCannoArr.shift();
canno
.
resetCannoStat
();
// canno.resetCannoStat();
},
200
);
// },200);
}
/**
* 炮台发射完毕,开始炮台消除
*/
callBackFireCanno
(
canno
:
Element
){
this
.
eliminate
();
this
.
readyCannoArr
.
shift
();
canno
.
resetCannoStat
();
}
}
checkAllBlock
()
{
checkAllBlock
()
{
// this.lattices.filter(item => item.block).forEach((item) => {
// this.lattices.filter(item => item.block).forEach((item) => {
...
...
egret/src/something/chapters/Chapter22.ts
View file @
7b360eab
...
@@ -6,92 +6,59 @@ import { ElementType } from "../enum/ElementType";
...
@@ -6,92 +6,59 @@ import { ElementType } from "../enum/ElementType";
export
const
Chapters22
:
ChapterData
[]
=
[
export
const
Chapters22
:
ChapterData
[]
=
[
//551
//551
{
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
baseElementTypes
:
[
0
,
1
,
2
,
3
],
bubbleProbability
:
0
,
bubbleProbability
:
0
,
stepCount
:
3
5
,
stepCount
:
2
5
,
passTarget
:
{
passTarget
:
{
type
:
1
,
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[{
elements
:
[
type
:
1
,
{
count
:
155
type
:
ElementType
.
CHICKEN
,
},
{
count
:
45
,
type
:
34
,
},
count
:
15
],
}]
},
},
starScores
:
[
1
5000
,
20000
,
25
000
],
starScores
:
[
1
000
,
5000
,
10
000
],
map
:
{
map
:
{
lattices
:
[
lattices
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
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
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
0
,
1
,
0
,
1
,
4
,
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
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
1
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
],
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
connectedLats
:
[],
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
conveyor
:
[
[
9
,
63
],
[
17
,
71
]
],
],
conveyorConnected
Lats
:
[
generate
Lats
:
[
[
63
,
9
]
,
{
index
:
11
,
type
:
[
0
],
cus
:
[]
}
,
[
71
,
17
]
{
index
:
15
,
type
:
[
0
],
cus
:
[]
},
],
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements
:
[
elements
:
[
1
,
19
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
20
,
1
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
6
,
1
,
1
,
1
,
1
,
1
,
6
,
1
,
1
,
1
,
19
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
6
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
22
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
5
,
6
,
1
,
1
,
2
,
1
,
1
,
6
,
5
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
],
baseElements
:
[
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
,
20
,
0
,
0
,
0
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
0
,
20
,
10
,
2
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
10
,
20
,
10
,
20
,
10
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
20
,
10
,
20
,
20
,
10
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
10
,
20
,
10
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
10
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
20
,
10
,
20
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
0
,
0
,
0
,
0
,
20
,
0
,
0
,
0
,
0
,
],
],
recycles
:
[],
// recycles: [70, 71, 72, 73]
generateLats
:
[{
},
index
:
0
,
type
:
null
},
{
index
:
1
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
}]
}
}
}
]
]
egret/src/something/class/Element.ts
View file @
7b360eab
...
@@ -45,6 +45,7 @@ export class Element extends eui.Component {
...
@@ -45,6 +45,7 @@ export class Element extends eui.Component {
fishCanEliFlag
:
boolean
;
fishCanEliFlag
:
boolean
;
cannoMoveClip
:
any
;
cannoMoveClip
:
any
;
cannoCnClip
:
any
;
cannoStat
:
number
[]
=
[
1
,
61
,
121
,
181
,
241
,
361
];
cannoStat
:
number
[]
=
[
1
,
61
,
121
,
181
,
241
,
361
];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
...
@@ -219,14 +220,44 @@ export class Element extends eui.Component {
...
@@ -219,14 +220,44 @@ export class Element extends eui.Component {
}
}
changeShowCannoStat
(){
changeShowCannoStat
(){
this
.
cannolab
.
text
=
this
.
_cannoStat
+
""
;
this
.
cannolab
.
text
=
this
.
_cannoStat
+
""
;
this
.
cannoMoveClip
&&
this
.
cannoMoveClip
.
gotoAndPlay
(
this
.
cannoStat
[
this
.
_cannoStat
]);
this
.
changeMvPlay
(
this
.
_cannoStat
);
}
changeMvPlay
(
_stat
:
number
){
if
(
this
.
cannoMoveClip
){
var
endframe
:
number
;
var
curframe
:
number
=
this
.
cannoMoveClip
.
currentFrame
;
this
.
cannoMoveClip
.
gotoAndPlay
(
curframe
,
true
);
if
(
_stat
==
0
){
endframe
=
1
;
}
else
if
(
_stat
==
1
){
endframe
=
121
;
}
else
if
(
_stat
==
2
){
endframe
=
181
;
}
else
if
(
_stat
==
3
){
endframe
=
241
;
}
else
if
(
_stat
==
4
){
endframe
=
361
;
}
// this.changeShowCanno(curframe,endframe);
this
.
stopFrame
=
endframe
;
}
}
}
/**
* 炮台能否发射
*/
checkCannoStat
(){
checkCannoStat
(){
if
(
this
.
_cannoStat
==
3
){
if
(
this
.
_cannoStat
==
3
){
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
/**
* 炮台发射
*/
fireCanno
(){
this
.
changeMvPlay
(
4
);
}
resetCannoStat
(){
resetCannoStat
(){
this
.
_cannoStat
=
0
;
this
.
_cannoStat
=
0
;
this
.
changeShowCannoStat
();
this
.
changeShowCannoStat
();
...
@@ -235,6 +266,8 @@ export class Element extends eui.Component {
...
@@ -235,6 +266,8 @@ export class Element extends eui.Component {
this
.
_cannoStat
+=
1
;
this
.
_cannoStat
+=
1
;
if
(
this
.
_cannoStat
>
3
){
if
(
this
.
_cannoStat
>
3
){
this
.
_cannoStat
=
3
;
this
.
_cannoStat
=
3
;
}
else
{
//充能动画
this
.
cannoCnClip
.
gotoAndPlay
(
1
,
true
);
}
}
this
.
changeShowCannoStat
();
this
.
changeShowCannoStat
();
}
}
...
@@ -442,8 +475,9 @@ export class Element extends eui.Component {
...
@@ -442,8 +475,9 @@ export class Element extends eui.Component {
this
.
addChild
(
this
.
cannolab
);
this
.
addChild
(
this
.
cannolab
);
this
.
cannobox
.
visible
=
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
cannobox
.
visible
=
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
touchEnabled
=
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
cannolab
.
visible
=
false
;
// this.cannolab.visible = false;
//鸡蛋
//鸡蛋
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
this
.
chickenEgg
=
Pool
.
takeOut
(
RecoverName
.
CHICKEN_EGG
)
this
.
chickenEgg
=
Pool
.
takeOut
(
RecoverName
.
CHICKEN_EGG
)
...
@@ -477,51 +511,58 @@ export class Element extends eui.Component {
...
@@ -477,51 +511,58 @@ export class Element extends eui.Component {
return
;
return
;
}
}
if
(
!
svgaParser
)
svgaParser
=
new
window
[
"SVGA"
].
Parser
();
if
(
!
svgaParser
)
svgaParser
=
new
window
[
"SVGA"
].
Parser
();
svgaParser
.
load
(
resPath
+
'resource/assets/svgas/canno.svga'
,
(
videoItem
)
=>
{
var
svgas
=
[
"canno"
,
"cannofire"
,
"cannoparticle"
,
"cannolight"
];
this
.
cannoMoveClip
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
for
(
let
i
=
0
;
i
<
svgas
.
length
;
i
++
){
this
.
cannoMoveClip
.
lockStep
=
true
;
let
mvname
=
svgas
[
i
];
var
mvwidth
=
102
;
svgaParser
.
load
(
resPath
+
'resource/assets/svgas/'
+
mvname
+
'.svga'
,(
videoItem
)
=>
{
var
mvheight
=
116
;
if
(
mvname
==
"canno"
){
this
.
cannoMoveClip
.
x
=
(
this
.
cannoboxwid
-
mvwidth
)
/
2
;
this
.
cannoMoveClip
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
this
.
cannoMoveClip
.
y
=
0
;
this
.
cannoMoveClip
.
lockStep
=
true
;
this
.
cannobox
.
addChild
(
this
.
cannoMoveClip
);
var
mvwidth
=
102
;
var
mvheight
=
116
;
console
.
log
(
"paotai"
,
this
.
cannoMoveClip
);
this
.
cannoMoveClip
.
x
=
(
this
.
cannoboxwid
-
mvwidth
)
/
2
;
this
.
cannoMoveClip
.
y
=
0
;
//1空,121,181,241,361
this
.
cannobox
.
addChild
(
this
.
cannoMoveClip
);
// this.cannoMoveClip.gotoAndStop(1);
this
.
cannoMoveClip
.
gotoAndStop
(
1
);
// this.cannoMoveClip.gotoAndStop(120);
this
.
cannoMoveClip
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
toFrameAni
,
this
);
// this.cannoMoveClip.gotoAndStop(120);
}
else
if
(
mvname
==
"cannolight"
){
// this.cannoMoveClip.gotoAndStop(180);
this
.
cannoCnClip
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
this
.
cannoMoveClip
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
listenCn
,
this
);
this
.
cannoCnClip
.
lockStep
=
true
;
this
.
cannoMoveClip
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
playComplete
,
this
);
var
mvwidth
=
400
;
});
var
mvheight
=
400
;
this
.
cannoCnClip
.
x
=
(
this
.
cannoboxwid
-
mvwidth
)
/
2
;
this
.
cannoCnClip
.
y
=
(
this
.
cannoboxhei
-
mvheight
)
/
2
;
this
.
cannobox
.
addChild
(
this
.
cannoCnClip
);
this
.
cannoCnClip
.
gotoAndStop
(
1
);
this
.
cannoCnClip
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
addOnePower
,
this
);
console
.
log
(
"光圈cannocnClip"
,
this
.
cannoCnClip
);
}
else
if
(
mvname
==
"cannoparticle"
){
}
});
}
}
}
}
}
// curframeidx:number = 1;
stopFrame
:
number
;
// testChangeMoveClip(num:number){
// this.curframeidx += num;
// this.cannoMoveClip.gotoAndStop(this.curframeidx);
// }
/**
/**
* 炮台充能
* 炮台动画停止
* @param source
*/
*/
listenCn
(){
toFrameAni
(){
var
statend
=
this
.
cannoStat
[
this
.
_cannoStat
+
1
];
var
curframe
=
this
.
cannoMoveClip
.
currentFrame
;
if
(
this
.
cannoMoveClip
.
currentFrame
>=
statend
){
if
(
curframe
>=
this
.
stopFrame
){
// console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame);
this
.
cannoMoveClip
.
gotoAndStop
(
this
.
stopFrame
);
this
.
cannoMoveClip
.
stop
();
if
(
this
.
stopFrame
==
361
){
console
.
log
(
"炮台发射完毕"
);
}
}
}
}
}
/**
/**
*
炮台动画播放一次完毕
*
光圈充能动画
*/
*/
playComplete
(){
addOnePower
(){
this
.
cannoMoveClip
.
stop
();
console
.
log
(
"一次光圈充能"
);
this
.
cannoCnClip
.
gotoAndStop
(
1
);
}
}
/**
/**
* 替换资源时,同时修改
* 替换资源时,同时修改
* @param source
* @param source
...
@@ -560,9 +601,9 @@ export class Element extends eui.Component {
...
@@ -560,9 +601,9 @@ export class Element extends eui.Component {
egret
.
Tween
.
removeTweens
(
this
.
showImage
);
egret
.
Tween
.
removeTweens
(
this
.
showImage
);
//类型重置,showImage修改
//类型重置,showImage修改
this
.
_type
=
type
;
this
.
_type
=
type
;
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
canno
box
.
visible
=
this
.
canno
lab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
// this.cannolab.visible = false;
this
.
changeSource
(
"ele"
+
type
+
"_png"
);
this
.
changeSource
(
"ele"
+
type
+
"_png"
);
//特效重置
//特效重置
...
...
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