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
e30a0296
Commit
e30a0296
authored
Jan 06, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
60a60cac
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
183 additions
and
32 deletions
+183
-32
MainBase.ts
egret/libs/new_wx/MainBase.ts
+8
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+1
-1
EleDisAni.ts
egret/src/something/anis/candy/EleDisAni.ts
+0
-30
createCandyDie0Ani.ts
egret/src/something/anis/candy/createCandyDie0Ani.ts
+21
-0
createCandyDie1Ani.ts
egret/src/something/anis/candy/createCandyDie1Ani.ts
+21
-0
createCandyDie2Ani.ts
egret/src/something/anis/candy/createCandyDie2Ani.ts
+21
-0
createCandyDie3Ani.ts
egret/src/something/anis/candy/createCandyDie3Ani.ts
+21
-0
createCandyDie4Ani.ts
egret/src/something/anis/candy/createCandyDie4Ani.ts
+21
-0
createCandyDieBgAni.ts
egret/src/something/anis/candy/createCandyDieBgAni.ts
+21
-0
createCandySubAni.ts
egret/src/something/anis/candy/createCandySubAni.ts
+21
-0
Element.ts
egret/src/something/class/Element.ts
+27
-1
No files found.
egret/libs/new_wx/MainBase.ts
View file @
e30a0296
...
...
@@ -244,6 +244,13 @@ export default class MainBase extends eui.UILayer {
RES
.
getResAsync
(
`nums3_png`
);
RES
.
getResAsync
(
`nums3_fnt`
);
RES
.
getResAsync
(
`candynums_fnt`
);
RES
.
getResAsync
(
'candydie0_json'
);
RES
.
getResAsync
(
'candydie1_json'
);
RES
.
getResAsync
(
'candydie2_json'
);
RES
.
getResAsync
(
'candydie3_json'
);
RES
.
getResAsync
(
'candydie4_json'
);
RES
.
getResAsync
(
'candysub_json'
);
RES
.
getResAsync
(
'candydiebg_json'
);
if
(
!
window
[
'development'
])
{
RES
.
getResAsync
(
`common_json`
);
RES
.
getResAsync
(
`share3_json`
);
...
...
@@ -262,6 +269,7 @@ export default class MainBase extends eui.UILayer {
RES
.
getResAsync
(
'maplight2_png'
);
RES
.
getResAsync
(
'main_mapbottom_png'
);
RES
.
getResAsync
(
'lightani_png'
);
for
(
var
i
=
1
;
i
<
19
;
i
++
)
{
RES
.
getResAsync
(
"boom"
+
i
+
"_png"
)
...
...
egret/src/mainScene/MainScene.ts
View file @
e30a0296
...
...
@@ -2370,7 +2370,7 @@ export default class MainScene extends Scene {
if
(
FiveBaseElementTypes
.
indexOf
(
ele
.
type
)
>=
0
)
{
if
(
ele
.
candy
)
{
//糖果
if
(
ele
.
candy
.
step
)
{
//有步数的时候消除
this
.
playAni
(
RecoverName
.
ELEDIS_ANI
,
p
)
ele
.
playCandyDieAni
();
//这里面会去算个数
this
.
recoverEle
(
index
);
this
.
playAni
(
RecoverName
.
STEP_ANI
,
[
50
,
100
]);
...
...
egret/src/something/anis/candy/EleDisAni.ts
deleted
100644 → 0
View file @
60a60cac
import
{
Ani
}
from
"../../class/Ani"
;
import
{
ImageAni
}
from
"../../class/ImageAni"
;
//原点已是中心
export
class
EleDisAni
extends
Ani
{
/**
* 图片
*/
showImage
:
ImageAni
;
constructor
()
{
super
();
this
.
aniName
=
"EleDisAni"
;
var
arr
=
[]
for
(
var
i
=
1
;
i
<=
19
;
i
++
)
{
arr
.
push
(
"eleDis"
+
i
+
"_png"
);
}
this
.
showImage
=
new
ImageAni
(
arr
);
this
.
addChild
(
this
.
showImage
)
}
play
()
{
//重置图片
this
.
showImage
.
currentFrame
=
0
;
this
.
showImage
.
source
=
this
.
showImage
.
sourceAll
[
0
];
this
.
showImage
.
play
(()
=>
{
this
.
recover
();
})
}
}
\ No newline at end of file
egret/src/something/anis/candy/createCandyDie0Ani.ts
0 → 100644
View file @
e30a0296
import
{
getEffectFramesStr
}
from
"../../../effect/createEffect1"
;
import
MovieClip
from
"../../../movieclip/MovieClip"
;
export
const
createCandyDie0Ani
=
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'candydie0_json'
);
const
list
=
getEffectFramesStr
(
'破碎兔_000'
,
0
,
12
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
2
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
0.4
,
anchor
:
[.
5
,
0.25
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,()
=>
{
p
.
removeChild
(
movieclip
);
},
this
);
}
\ No newline at end of file
egret/src/something/anis/candy/createCandyDie1Ani.ts
0 → 100644
View file @
e30a0296
import
{
getEffectFramesStr
}
from
"../../../effect/createEffect1"
;
import
MovieClip
from
"../../../movieclip/MovieClip"
;
export
const
createCandyDie1Ani
=
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'candydie1_json'
);
const
list
=
getEffectFramesStr
(
'破碎鸟_000'
,
0
,
12
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
2
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
0.4
,
anchor
:
[.
5
,
0.25
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,()
=>
{
p
.
removeChild
(
movieclip
);
},
this
);
}
\ No newline at end of file
egret/src/something/anis/candy/createCandyDie2Ani.ts
0 → 100644
View file @
e30a0296
import
{
getEffectFramesStr
}
from
"../../../effect/createEffect1"
;
import
MovieClip
from
"../../../movieclip/MovieClip"
;
export
const
createCandyDie2Ani
=
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'candydie2_json'
);
const
list
=
getEffectFramesStr
(
'破碎牛_000'
,
0
,
12
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
2
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
0.4
,
anchor
:
[.
5
,
0.25
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,()
=>
{
p
.
removeChild
(
movieclip
);
},
this
);
}
\ No newline at end of file
egret/src/something/anis/candy/createCandyDie3Ani.ts
0 → 100644
View file @
e30a0296
import
{
getEffectFramesStr
}
from
"../../../effect/createEffect1"
;
import
MovieClip
from
"../../../movieclip/MovieClip"
;
export
const
createCandyDie3Ani
=
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'candydie3_json'
);
const
list
=
getEffectFramesStr
(
'破碎狮子_000'
,
0
,
12
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
2
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
0.4
,
anchor
:
[.
5
,
0.25
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,()
=>
{
p
.
removeChild
(
movieclip
);
},
this
);
}
\ No newline at end of file
egret/src/something/anis/candy/createCandyDie4Ani.ts
0 → 100644
View file @
e30a0296
import
{
getEffectFramesStr
}
from
"../../../effect/createEffect1"
;
import
MovieClip
from
"../../../movieclip/MovieClip"
;
export
const
createCandyDie4Ani
=
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'candydie4_json'
);
const
list
=
getEffectFramesStr
(
'破碎猪_000'
,
0
,
12
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
2
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
0.4
,
anchor
:
[.
5
,
0.25
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,()
=>
{
p
.
removeChild
(
movieclip
);
},
this
);
}
\ No newline at end of file
egret/src/something/anis/candy/createCandyDieBgAni.ts
0 → 100644
View file @
e30a0296
import
{
getEffectFramesStr
}
from
"../../../effect/createEffect1"
;
import
MovieClip
from
"../../../movieclip/MovieClip"
;
export
const
createCandyDieBgAni
=
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'candydiebg_json'
);
const
list
=
getEffectFramesStr
(
'糖果消失光_000'
,
0
,
13
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
3
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
1
,
anchor
:
[.
5
,
0.5
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,()
=>
{
p
.
removeChild
(
movieclip
);
},
this
);
}
\ No newline at end of file
egret/src/something/anis/candy/createCandySubAni.ts
0 → 100644
View file @
e30a0296
import
{
getEffectFramesStr
}
from
"../../../effect/createEffect1"
;
import
MovieClip
from
"../../../movieclip/MovieClip"
;
export
const
createCandySubAni
=
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'candysub_json'
);
const
list
=
getEffectFramesStr
(
'数字减少星星_000'
,
0
,
15
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
3
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
1
,
anchor
:
[.
5
,
.
5
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,()
=>
{
p
.
removeChild
(
movieclip
);
},
this
);
}
\ No newline at end of file
egret/src/something/class/Element.ts
View file @
e30a0296
...
...
@@ -13,6 +13,13 @@ import { FestivalEle } from "./FestivalEle";
import
{
FestivalEle2
}
from
"./FestivalEle2"
;
import
{
State
}
from
"./State"
;
import
{
Candy
}
from
"./Candy"
;
import
{
createCandySubAni
}
from
"../anis/candy/createCandySubAni"
;
import
{
createCandyDie0Ani
}
from
"../anis/candy/createCandyDie0Ani"
;
import
{
createCandyDieBgAni
}
from
"../anis/candy/createCandyDieBgAni"
;
import
{
createCandyDie1Ani
}
from
"../anis/candy/createCandyDie1Ani"
;
import
{
createCandyDie2Ani
}
from
"../anis/candy/createCandyDie2Ani"
;
import
{
createCandyDie3Ani
}
from
"../anis/candy/createCandyDie3Ani"
;
import
{
createCandyDie4Ani
}
from
"../anis/candy/createCandyDie4Ani"
;
/**
* 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点
...
...
@@ -36,12 +43,29 @@ export class Element extends eui.Component {
this
.
addCandyStandbyAni
();
}
playCandyDieAni
()
{
var
p
=
Tool
.
getPositionByIndex
(
this
.
index
);
createCandyDieBgAni
(
p
[
0
],
p
[
1
],
this
.
stage
);
if
(
this
.
type
==
ElementType
.
RABBIT
)
createCandyDie0Ani
(
p
[
0
],
p
[
1
],
this
.
stage
);
if
(
this
.
type
==
ElementType
.
CHICKEN
)
createCandyDie1Ani
(
p
[
0
],
p
[
1
],
this
.
stage
);
if
(
this
.
type
==
ElementType
.
CATTLE
)
createCandyDie2Ani
(
p
[
0
],
p
[
1
],
this
.
stage
);
if
(
this
.
type
==
ElementType
.
LION
)
createCandyDie3Ani
(
p
[
0
],
p
[
1
],
this
.
stage
);
if
(
this
.
type
==
ElementType
.
PIG
)
createCandyDie4Ani
(
p
[
0
],
p
[
1
],
this
.
stage
);
}
playCandySubAni
()
{
return
new
Promise
((
r
)
=>
{
egret
.
Tween
.
removeTweens
(
this
.
showImage
);
egret
.
Tween
.
get
(
this
.
showImage
).
to
({
scaleX
:
0
,
scaleY
:
0
},
200
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
backOut
).
call
(()
=>
{
.
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
backOut
).
call
(()
=>
{
this
.
addCandyStandbyAni
();
var
p
=
Tool
.
getPositionByIndex
(
this
.
index
);
createCandySubAni
(
p
[
0
],
p
[
1
],
this
.
stage
);
r
();
});
});
...
...
@@ -226,6 +250,8 @@ export class Element extends eui.Component {
this
.
alpha
=
this
.
scaleX
=
this
.
scaleY
=
1
;
this
.
showImage
.
anchorOffsetX
=
0
;
this
.
showImage
.
anchorOffsetY
=
0
;
this
.
showImage
.
scaleY
=
1
;
this
.
showImage
.
scaleX
=
1
;
egret
.
Tween
.
removeTweens
(
this
.
showImage
);
//类型重置,showImage修改
this
.
_type
=
type
;
...
...
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