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
2585ed68
Commit
2585ed68
authored
Mar 02, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a48e1eff
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
10 deletions
+120
-10
eleDisNew.tmproject
egret/resource/TextureMerger/eleDisNew.tmproject
+1
-0
main2.tmproject
egret/resource/TextureMerger/main2.tmproject
+1
-1
doSandAI.ts
egret/src/mainScene/doSandAI.ts
+22
-5
SandMoveAni.ts
egret/src/something/anis/SandMoveAni.ts
+81
-0
Chapter18.ts
egret/src/something/chapters/Chapter18.ts
+14
-4
RecoverName.ts
egret/src/something/enum/RecoverName.ts
+1
-0
No files found.
egret/resource/TextureMerger/eleDisNew.tmproject
0 → 100644
View file @
2585ed68
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"eleDisNew","version":5,"files":["../assets/eleDisNew/eleDisNew4_9.png","../assets/eleDisNew/eleDisNew4_8.png","../assets/eleDisNew/eleDisNew4_7.png","../assets/eleDisNew/eleDisNew4_6.png","../assets/eleDisNew/eleDisNew4_5.png","../assets/eleDisNew/eleDisNew4_4.png","../assets/eleDisNew/eleDisNew4_3.png","../assets/eleDisNew/eleDisNew4_2.png","../assets/eleDisNew/eleDisNew4_14.png","../assets/eleDisNew/eleDisNew4_13.png","../assets/eleDisNew/eleDisNew4_12.png","../assets/eleDisNew/eleDisNew4_11.png","../assets/eleDisNew/eleDisNew4_10.png","../assets/eleDisNew/eleDisNew4_1.png","../assets/eleDisNew/eleDisNew4_0.png","../assets/eleDisNew/eleDisNew3_9.png","../assets/eleDisNew/eleDisNew3_8.png","../assets/eleDisNew/eleDisNew3_7.png","../assets/eleDisNew/eleDisNew3_6.png","../assets/eleDisNew/eleDisNew3_5.png","../assets/eleDisNew/eleDisNew3_4.png","../assets/eleDisNew/eleDisNew3_3.png","../assets/eleDisNew/eleDisNew3_2.png","../assets/eleDisNew/eleDisNew3_14.png","../assets/eleDisNew/eleDisNew3_13.png","../assets/eleDisNew/eleDisNew3_12.png","../assets/eleDisNew/eleDisNew3_11.png","../assets/eleDisNew/eleDisNew3_10.png","../assets/eleDisNew/eleDisNew3_1.png","../assets/eleDisNew/eleDisNew3_0.png","../assets/eleDisNew/eleDisNew2_9.png","../assets/eleDisNew/eleDisNew2_8.png","../assets/eleDisNew/eleDisNew2_7.png","../assets/eleDisNew/eleDisNew2_6.png","../assets/eleDisNew/eleDisNew2_5.png","../assets/eleDisNew/eleDisNew2_4.png","../assets/eleDisNew/eleDisNew2_3.png","../assets/eleDisNew/eleDisNew2_2.png","../assets/eleDisNew/eleDisNew2_14.png","../assets/eleDisNew/eleDisNew2_13.png","../assets/eleDisNew/eleDisNew2_12.png","../assets/eleDisNew/eleDisNew2_11.png","../assets/eleDisNew/eleDisNew2_10.png","../assets/eleDisNew/eleDisNew2_1.png","../assets/eleDisNew/eleDisNew2_0.png","../assets/eleDisNew/eleDisNew1_9.png","../assets/eleDisNew/eleDisNew1_8.png","../assets/eleDisNew/eleDisNew1_7.png","../assets/eleDisNew/eleDisNew1_6.png","../assets/eleDisNew/eleDisNew1_5.png","../assets/eleDisNew/eleDisNew1_4.png","../assets/eleDisNew/eleDisNew1_3.png","../assets/eleDisNew/eleDisNew1_2.png","../assets/eleDisNew/eleDisNew1_14.png","../assets/eleDisNew/eleDisNew1_13.png","../assets/eleDisNew/eleDisNew1_12.png","../assets/eleDisNew/eleDisNew1_11.png","../assets/eleDisNew/eleDisNew1_10.png","../assets/eleDisNew/eleDisNew1_1.png","../assets/eleDisNew/eleDisNew1_0.png","../assets/eleDisNew/eleDisNew0_9.png","../assets/eleDisNew/eleDisNew0_8.png","../assets/eleDisNew/eleDisNew0_7.png","../assets/eleDisNew/eleDisNew0_6.png","../assets/eleDisNew/eleDisNew0_5.png","../assets/eleDisNew/eleDisNew0_4.png","../assets/eleDisNew/eleDisNew0_3.png","../assets/eleDisNew/eleDisNew0_2.png","../assets/eleDisNew/eleDisNew0_14.png","../assets/eleDisNew/eleDisNew0_13.png","../assets/eleDisNew/eleDisNew0_12.png","../assets/eleDisNew/eleDisNew0_11.png","../assets/eleDisNew/eleDisNew0_10.png","../assets/eleDisNew/eleDisNew0_1.png","../assets/eleDisNew/eleDisNew0_0.png"]}
\ No newline at end of file
egret/resource/TextureMerger/main2.tmproject
View file @
2585ed68
This diff is collapsed.
Click to expand it.
egret/src/mainScene/doSandAI.ts
View file @
2585ed68
import
MainScene
from
"./MainScene
"
;
import
{
SandMoveAni
}
from
"../something/anis/SandMoveAni
"
;
import
{
Lattice
}
from
"../something/class/Lattice"
;
import
{
RecoverName
}
from
"../something/enum/RecoverName"
;
import
{
Pool
}
from
"../something/Pool"
;
import
{
Tool
}
from
"../something/Tool"
;
import
MainScene
from
"./MainScene"
;
/**
* 沙子移动
*/
...
...
@@ -16,21 +19,35 @@ export default async (thisObj: MainScene) => {
console
.
log
(
sandLattices
);
//map promise
//先判断是否能跳动,目前都能跳
const
promiseList
:
Promise
<
any
>
[]
=
[];
const
sands
=
[];
for
(
let
i
=
0
;
i
<
sandLattices
.
length
;
i
++
)
{
const
sandLattice
=
sandLattices
[
i
];
const
indexEnd
=
judgeActionIndex
(
sandLattice
.
index
,
thisObj
.
lattices
)
if
(
indexEnd
)
{
//判断是否有地方可以
//先修改数据,再进行动画播放
const
sand
=
sandLattice
.
sand
;
sandLattice
.
sand
=
null
;
sandLattice
.
sand
=
null
;
const
latticeEnd
=
thisObj
.
lattices
[
indexEnd
];
latticeEnd
.
sand
=
sand
;
const
p
=
Tool
.
getPositionByIndex
(
indexEnd
);
egret
.
Tween
.
get
(
sand
).
to
({
x
:
p
[
0
],
y
:
p
[
1
]},
200
);
// sand.x = p[0];
// sand.y = p[1];
// egret.Tween.get(sand).to({x:p[0],y:p[1]},200);
const
from
=
[
sand
.
x
,
sand
.
y
];
sand
.
x
=
p
[
0
];
sand
.
y
=
p
[
1
];
sand
.
visible
=
false
;
let
sandMoveAni
:
SandMoveAni
=
Pool
.
takeOut
(
RecoverName
.
SAND_MOVE_ANI
);
if
(
!
sandMoveAni
)
{
sandMoveAni
=
new
SandMoveAni
();
}
thisObj
.
addChild
(
sandMoveAni
);
promiseList
.
push
(
sandMoveAni
.
play
([
sand
.
x
,
sand
.
y
],
p
));
sands
.
push
(
sand
);
}
}
await
Promise
.
all
(
promiseList
);
sands
.
forEach
(
e
=>
e
.
visible
=
true
);
}
//找到毛球移动的目标位置
...
...
egret/src/something/anis/SandMoveAni.ts
0 → 100644
View file @
2585ed68
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
Pool
}
from
"../Pool"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
wait
from
"../../../libs/new_tc/wait"
;
export
const
monstShootAniDur
:
number
=
400
;
/**
* 需要回调的
* 手动修改this.shoot.rotation=
*/
export
class
SandMoveAni
extends
egret
.
DisplayObjectContainer
{
fromContainer
;
toContainer
;
constructor
()
{
super
()
}
async
initMc
(
from
:
number
[],
to
:
number
[])
{
const
fromContainer
=
await
this
.
createContainer
();
fromContainer
.
x
=
from
[
0
];
fromContainer
.
y
=
from
[
1
];
this
.
fromContainer
=
fromContainer
;
const
toContainer
=
await
this
.
createContainer
();
toContainer
.
x
=
to
[
0
];
toContainer
.
y
=
to
[
1
];
this
.
toContainer
=
toContainer
;
this
.
addChild
(
this
.
fromContainer
);
this
.
addChild
(
this
.
toContainer
);
}
private
reset
(
from
:
number
[],
to
:
number
[])
{
this
.
fromContainer
.
x
=
from
[
0
];
this
.
fromContainer
.
y
=
from
[
1
];
this
.
toContainer
.
x
=
to
[
0
];
this
.
toContainer
.
y
=
to
[
1
];
}
async
play
(
from
:
number
[],
to
:
number
[])
{
if
(
!
this
.
fromContainer
)
{
await
this
.
initMc
(
from
,
to
);
}
else
{
this
.
reset
(
from
,
to
);
}
await
wait
(
5000
);
this
.
parent
&&
this
.
parent
.
removeChild
(
this
);
Pool
.
recover
(
RecoverName
.
SAND_MOVE_ANI
,
this
);
return
null
;
}
private
async
createContainer
()
{
const
container
=
new
egret
.
Sprite
();
const
rect
=
this
.
createRect
();
const
mc
=
await
this
.
createMc
();
container
.
addChild
(
mc
);
container
.
addChild
(
rect
);
mc
.
mask
=
rect
;
return
mc
;
}
private
createRect
()
{
const
rect
=
new
egret
.
Shape
();
rect
.
graphics
.
beginFill
(
0
,
1
);
const
r
=
80
;
rect
.
graphics
.
drawRect
(
-
r
/
2
,
-
r
/
2
,
r
,
r
);
rect
.
graphics
.
endFill
();
return
rect
;
}
private
async
createMc
()
{
const
movieclip
:
egret
.
DisplayObject
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_standby.svga'
)
as
egret
.
DisplayObject
;
movieclip
.
anchorOffsetX
=
78
/
2
;
movieclip
.
anchorOffsetY
=
78
/
2
;
return
movieclip
;
}
}
\ No newline at end of file
egret/src/something/chapters/Chapter18.ts
100755 → 100644
View file @
2585ed68
This diff is collapsed.
Click to expand it.
egret/src/something/enum/RecoverName.ts
View file @
2585ed68
...
...
@@ -18,6 +18,7 @@ export enum RecoverName {
//带回调的动画,和不带的合并不了,因为可能还有其他参数
BONUSSHOOT_ANI
=
"BonusShootAni"
,
MONSTER_SHOOT_ANI
=
"MONSTER_SHOOT_ANI"
,
SAND_MOVE_ANI
=
"SAND_MOVE_ANI"
,
HONEY_SHOOT_ANI
=
"HONEY_SHOOT_ANI"
,
JELLYSPREAD_ANI
=
"JellySpreadAni"
,
PIECETOEGG_ANI
=
"PieceToEggAni"
,
...
...
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