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
18601d69
Commit
18601d69
authored
Feb 09, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ba185f36
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
13 deletions
+80
-13
main2.tmproject
egret/resource/TextureMerger/main2.tmproject
+1
-1
monsterState.json
egret/resource/assets/mc/monsterState.json
+16
-0
monsterState.png
egret/resource/assets/mc/monsterState.png
+0
-0
default.res.json
egret/resource/default.res.json
+10
-0
MyExmlPlugin.ts
egret/scripts/MyExmlPlugin.ts
+1
-0
createMonsterStatusAni.ts
egret/src/effect/createMonsterStatusAni.ts
+25
-0
doMonsterAI.ts
egret/src/mainScene/doMonsterAI.ts
+8
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+2
-1
MonsterShootAni.ts
egret/src/something/anis/MonsterShootAni.ts
+2
-4
Monster.ts
egret/src/something/class/Monster.ts
+15
-5
No files found.
egret/resource/TextureMerger/main2.tmproject
View file @
18601d69
This diff is collapsed.
Click to expand it.
egret/resource/assets/mc/monsterState.json
0 → 100644
View file @
18601d69
{
"file"
:
"monsterState.png"
,
"frames"
:{
"糖果消失_00014"
:{
"x"
:
422
,
"y"
:
462
,
"w"
:
84
,
"h"
:
100
,
"offX"
:
56
,
"offY"
:
46
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00013"
:{
"x"
:
332
,
"y"
:
462
,
"w"
:
88
,
"h"
:
105
,
"offX"
:
55
,
"offY"
:
44
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00012"
:{
"x"
:
239
,
"y"
:
370
,
"w"
:
91
,
"h"
:
106
,
"offX"
:
54
,
"offY"
:
42
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00011"
:{
"x"
:
374
,
"y"
:
348
,
"w"
:
93
,
"h"
:
112
,
"offX"
:
52
,
"offY"
:
40
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00010"
:{
"x"
:
146
,
"y"
:
370
,
"w"
:
91
,
"h"
:
110
,
"offX"
:
53
,
"offY"
:
40
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00009"
:{
"x"
:
378
,
"y"
:
131
,
"w"
:
105
,
"h"
:
109
,
"offX"
:
53
,
"offY"
:
42
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00008"
:{
"x"
:
378
,
"y"
:
0
,
"w"
:
130
,
"h"
:
129
,
"offX"
:
41
,
"offY"
:
33
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00007"
:{
"x"
:
191
,
"y"
:
0
,
"w"
:
185
,
"h"
:
184
,
"offX"
:
14
,
"offY"
:
6
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00006"
:{
"x"
:
0
,
"y"
:
344
,
"w"
:
144
,
"h"
:
143
,
"offX"
:
34
,
"offY"
:
26
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00005"
:{
"x"
:
239
,
"y"
:
478
,
"w"
:
85
,
"h"
:
84
,
"offX"
:
63
,
"offY"
:
55
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00004"
:{
"x"
:
146
,
"y"
:
482
,
"w"
:
55
,
"h"
:
59
,
"offX"
:
73
,
"offY"
:
69
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00003"
:{
"x"
:
374
,
"y"
:
242
,
"w"
:
103
,
"h"
:
104
,
"offX"
:
49
,
"offY"
:
47
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00002"
:{
"x"
:
0
,
"y"
:
192
,
"w"
:
149
,
"h"
:
150
,
"offX"
:
26
,
"offY"
:
24
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00001"
:{
"x"
:
191
,
"y"
:
186
,
"w"
:
181
,
"h"
:
182
,
"offX"
:
10
,
"offY"
:
8
,
"sourceW"
:
200
,
"sourceH"
:
200
},
"糖果消失_00000"
:{
"x"
:
0
,
"y"
:
0
,
"w"
:
189
,
"h"
:
190
,
"offX"
:
6
,
"offY"
:
4
,
"sourceW"
:
200
,
"sourceH"
:
200
}}}
\ No newline at end of file
egret/resource/assets/mc/monsterState.png
0 → 100644
View file @
18601d69
155 KB
egret/resource/default.res.json
View file @
18601d69
...
...
@@ -231,6 +231,10 @@
{
"keys"
:
"backindex_png"
,
"name"
:
"backindex"
},
{
"name"
:
"preload"
,
"keys"
:
"monsterState_json"
}
],
"resources"
:
[
...
...
@@ -4467,6 +4471,12 @@
"url"
:
"assets/mainScene/monster_shoot.png"
,
"type"
:
"image"
,
"name"
:
"monster_shoot_png"
},
{
"name"
:
"monsterState_json"
,
"type"
:
"sheet"
,
"url"
:
"assets/mc/monsterState.json"
,
"subkeys"
:
"糖果消失_00014,糖果消失_00013,糖果消失_00012,糖果消失_00011,糖果消失_00010,糖果消失_00009,糖果消失_00008,糖果消失_00007,糖果消失_00006,糖果消失_00005,糖果消失_00004,糖果消失_00003,糖果消失_00002,糖果消失_00001,糖果消失_00000"
}
]
}
\ No newline at end of file
egret/scripts/MyExmlPlugin.ts
View file @
18601d69
...
...
@@ -9,6 +9,7 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
async
onFile
(
file
:
plugins
.
File
)
{
const
excludes
=
[
'candydiebg.png'
,
'monsterState.png'
,
'candysub.png'
,
'candydis0.png'
,
...
...
egret/src/effect/createMonsterStatusAni.ts
0 → 100644
View file @
18601d69
import
MovieClip
from
"../movieclip/MovieClip"
;
import
{
getEffectFramesStr
}
from
"./createEffect1"
;
import
wait
from
"../../libs/new_tc/wait"
;
export
const
createMonsterStatusAni
=
async
(
x
,
y
,
p
)
=>
{
const
spritesheet
=
await
RES
.
getResAsync
(
'monsterState_json'
);
const
list
=
getEffectFramesStr
(
'糖果消失_000'
,
0
,
14
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
2
,
frames
:
list
,
position
:
[
x
,
y
],
scale
:
1
,
anchor
:
[.
5
,
.
5
],
loop
:
false
});
p
.
addChild
(
movieclip
);
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,
()
=>
{
if
(
movieclip
.
parent
)
movieclip
.
parent
.
removeChild
(
movieclip
);
},
this
)
await
wait
(
300
)
}
\ No newline at end of file
egret/src/mainScene/doMonsterAI.ts
View file @
18601d69
...
...
@@ -7,6 +7,7 @@ import wait from "../../libs/new_tc/wait";
import
{
MonsterShootAni
,
monstShootAniDur
}
from
"../something/anis/MonsterShootAni"
;
import
{
RecoverName
}
from
"../something/enum/RecoverName"
;
import
{
Pool
}
from
"../something/Pool"
;
import
{
createMonsterStatusAni
}
from
"../effect/createMonsterStatusAni"
;
/**
* 独眼怪爆炸
*/
...
...
@@ -49,10 +50,12 @@ export default async (thisObj: MainScene) => {
foundsResult
[
index
]
=
founds
;
}
for
(
let
index
=
0
;
index
<
activeMosterEles
.
length
;
index
++
)
{
const
playEffect
=
async
(
index
)
=>
{
const
monsterEle
=
activeMosterEles
[
index
];
//找到相同颜色的元素
let
founds
=
foundsResult
[
index
];
await
createMonsterStatusAni
(
monsterEle
.
x
,
monsterEle
.
y
,
thisObj
);
monsterEle
.
monster
.
hide
();
founds
.
forEach
((
ele
)
=>
{
let
bonusShootAni
:
MonsterShootAni
=
Pool
.
takeOut
(
RecoverName
.
MONSTER_SHOOT_ANI
);
if
(
!
bonusShootAni
)
...
...
@@ -61,10 +64,13 @@ export default async (thisObj: MainScene) => {
bonusShootAni
.
play
(
r
*
180
/
Math
.
PI
,
[
monsterEle
.
x
,
monsterEle
.
y
],
[
ele
.
x
,
ele
.
y
],
()
=>
{
});
thisObj
.
addChild
(
bonusShootAni
);
});
};
for
(
let
index
=
0
;
index
<
activeMosterEles
.
length
;
index
++
)
{
playEffect
(
index
);
}
if
(
genarateEffect
.
length
>
0
)
await
wait
(
monstShootAniDur
);
await
wait
(
monstShootAniDur
+
300
);
for
(
let
index
=
0
;
index
<
foundsResult
.
length
;
index
++
)
{
const
founds
=
foundsResult
[
index
];
founds
.
forEach
(
ele
=>
{
...
...
egret/src/mapScene/MapScene.ts
View file @
18601d69
...
...
@@ -364,16 +364,17 @@ export default class MapScene extends Scene {
RES
.
getResAsync
(
'candydie3_json'
);
RES
.
getResAsync
(
'candydie4_json'
);
RES
.
getResAsync
(
'candysub_json'
);
RES
.
getResAsync
(
'monsterState_json'
);
RES
.
getResAsync
(
'candydiebg_json'
);
RES
.
getResAsync
(
'redrainbg_jpg'
);
RES
.
getResAsync
(
'hbRule_bg_png'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster0.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster2.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster3.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster4.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster5.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/box.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turntable.svga'
);
...
...
egret/src/something/anis/MonsterShootAni.ts
View file @
18601d69
import
{
ImageAni
}
from
"../class/ImageAni"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
playSound
,
SoundType
}
from
"../../soundCtr
l"
;
import
{
Pool
}
from
"../Poo
l"
;
export
const
monstShootAniDur
:
number
=
5
00
;
export
const
monstShootAniDur
:
number
=
4
00
;
/**
* 需要回调的
* 手动修改this.shoot.rotation=
...
...
egret/src/something/class/Monster.ts
View file @
18601d69
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
{
createMonsterStatusAni
}
from
"../../effect/createMonsterStatusAni"
;
const
frames
=
[
[
1
,
120
],
[
121
,
360
],
...
...
@@ -8,21 +9,30 @@ const frames = [
[
601
,
960
],
];
export
class
Monster
extends
eui
.
Component
{
nextStatus
()
{
async
nextStatus
()
{
this
.
_statusNum
++
;
if
(
this
.
_statusNum
>
4
)
{
this
.
_statusNum
=
4
;
this
.
removeEvents
();
}
//播放动画,动画时间要短200ms以内
if
(
this
.
_statusNum
<=
3
)
if
(
this
.
_statusNum
<=
3
)
{
createMonsterStatusAni
(
this
.
x
,
this
.
y
,
this
.
parent
);
this
.
changeSource
();
}
}
hide
(){
this
.
_mv
.
scaleX
=
this
.
_mv
.
scaleY
=
0
;
}
resetStatus
()
{
this
.
addEvents
();
this
.
_statusNum
=
0
;
this
.
changeSource
();
this
.
_mv
.
gotoAndPlay
(
1
);
egret
.
Tween
.
get
(
this
.
_mv
).
to
({
scaleY
:
1
,
scaleX
:
1
},
500
,
egret
.
Ease
.
backOut
).
call
(()
=>
{
this
.
changeSource
();
})
}
get
active
():
boolean
{
...
...
@@ -40,7 +50,7 @@ export class Monster extends eui.Component {
return
`ele
${
this
.
res
}
_
${
this
.
_statusNum
}
_png`
;
}
type
;
constructor
(
res
:
ElementType
,
type
:
number
,
n
:
number
=
0
)
{
constructor
(
res
:
ElementType
,
type
:
number
,
n
:
number
=
3
)
{
super
();
this
.
res
=
res
;
this
.
type
=
type
;
...
...
@@ -62,7 +72,7 @@ export class Monster extends eui.Component {
}
onEnterFrame
()
{
if
(
this
.
_statusNum
<=
3
&&
this
.
_mv
.
currentFrame
==
frames
[
this
.
_statusNum
][
1
])
{
if
(
this
.
_statusNum
<=
3
&&
this
.
_mv
.
currentFrame
==
frames
[
this
.
_statusNum
][
1
])
{
this
.
_mv
.
gotoAndPlay
(
frames
[
this
.
_statusNum
][
0
]);
}
}
...
...
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