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