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
587ee86b
Commit
587ee86b
authored
Jan 14, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b76a017a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
jellyMonsterAI.ts
egret/src/mainScene/jellyMonsterAI.ts
+3
-1
jellyMonsterAni.ts
egret/src/mainScene/jellyMonsterAni.ts
+22
-2
No files found.
egret/src/mainScene/jellyMonsterAI.ts
View file @
587ee86b
...
...
@@ -4,6 +4,7 @@ import { ElementType } from "../something/enum/ElementType";
import
{
AiControl
}
from
"../something/logic/AiControl"
;
import
{
Tool
}
from
"../something/Tool"
;
import
MainScene
from
"./MainScene"
;
import
jellyMonsterAni
from
"./jellyMonsterAni"
;
export
default
async
(
thisObj
:
MainScene
)
=>
{
//找到所有的怪物
...
...
@@ -36,8 +37,9 @@ export default async (thisObj: MainScene) => {
spread
=
spreads
.
splice
(
i
,
1
)[
0
];
const
[
fromIndex
,
toIndex
]
=
spread
;
const
fromEle
:
Element
=
thisObj
.
lattices
[
fromIndex
].
element
;
//起始元素
await
fromEle
.
toAction
();
//准备开始吹
const
endEle
:
Element
=
thisObj
.
lattices
[
toIndex
].
element
;
//终点元素
await
fromEle
.
toAction
();
//准备开始吹
await
jellyMonsterAni
(
thisObj
,[
fromEle
.
x
,
fromEle
.
y
],[
endEle
.
x
,
endEle
.
y
]);
endEle
.
reset
(
ElementType
.
JELLY
);
endEle
.
isMonsterJelly
=
true
;
}
...
...
egret/src/mainScene/jellyMonsterAni.ts
View file @
587ee86b
export
default
()
=>
{
import
MainScene
from
"./MainScene"
;
export
default
(
thisobj
:
MainScene
,
from
:
number
[],
to
:
number
[])
=>
{
//每次只有一个怪物吹气泡
return
new
Promise
((
r
)
=>
{
r
();
const
tex
:
egret
.
Texture
=
RES
.
getRes
(
"ele20_png"
);
const
pic
=
new
egret
.
Bitmap
(
tex
);
pic
.
anchorOffsetX
=
tex
.
textureWidth
/
2
;
pic
.
anchorOffsetY
=
tex
.
textureHeight
;
pic
.
x
=
from
[
0
];
pic
.
y
=
from
[
1
]
+
20
;
thisobj
.
addChild
(
pic
);
egret
.
Tween
.
get
(
pic
).
set
({
scaleX
:
0
,
scaleY
:
0
})
.
to
({
scaleX
:
1.1
,
scaleY
:
0.9
},
300
)
.
to
({
scaleX
:
0.9
,
scaleY
:
1.1
},
100
)
.
to
({
scaleX
:
1.05
,
scaleY
:
0.95
},
100
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
100
)
.
wait
(
300
)
.
set
({
anchorOffsetY
:
tex
.
textureHeight
/
2
,
y
:
from
[
1
]
+
20
-
tex
.
textureHeight
/
2
})
.
to
({
x
:
to
[
0
],
y
:
to
[
1
]},
500
)
.
to
({
scaleX
:
0.9
,
scaleY
:
1.1
},
100
)
.
to
({
scaleX
:
1.05
,
scaleY
:
0.95
},
100
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
call
(
r
)
// r();
});
}
\ 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