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
908db4b2
Commit
908db4b2
authored
Mar 10, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e9bcbca9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
148 deletions
+138
-148
doConveyorAI.ts
egret/src/mainScene/doConveyorAI.ts
+15
-23
ConveyorAni.ts
egret/src/something/conveyor/ConveyorAni.ts
+73
-0
ConveyorDownAni.ts
egret/src/something/conveyor/ConveyorDownAni.ts
+12
-0
ConveyorLeftAni.ts
egret/src/something/conveyor/ConveyorLeftAni.ts
+13
-0
ConveyorRightAni.ts
egret/src/something/conveyor/ConveyorRightAni.ts
+12
-0
ConveyorTopAni.ts
egret/src/something/conveyor/ConveyorTopAni.ts
+13
-0
home.json
mock/happyclear/home.json
+0
-125
No files found.
egret/src/mainScene/doConveyorAI.ts
View file @
908db4b2
import
{
Lattice
}
from
"../something/class/Lattice"
;
import
ConveyorAni
,
{
getConveyorAni
}
from
"../something/conveyor/ConveyorAni"
;
import
{
ARROW_DIR
,
fillConveyor
,
findTarget
,
getArrowDir
}
from
"../something/conveyor/conveyorTool"
;
import
MainScene
from
"./MainScene"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
Lattice
}
from
"../something/class/Lattic
e"
;
import
MainScene
from
"./MainScen
e"
;
export
const
CONVERYOR_ANI_DUR
=
200
;
const
getTargetIndexs
=
(
conveyor
:
number
[])
=>
{
const
dir
=
getArrowDir
(
conveyor
);
let
list
=
fillConveyor
(
conveyor
);
...
...
@@ -14,23 +15,6 @@ const getTargetIndexs = (conveyor: number[]) => {
return
list
;
}
let
conveyorAniList
:
{
[
key
:
string
]:
ConveyorAni
;
}
=
null
;
//单个皮带转动动效
class
ConveyorAni
{
private
orign
:
any
[];
private
list
:
any
[];
private
views
:
any
[]
=
[]
constructor
(
conveyor
)
{
this
.
list
=
fillConveyor
(
conveyor
);
this
.
orign
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
list
));
this
.
views
=
this
.
list
;
}
play
()
{
}
}
export
default
async
(
thisObj
:
MainScene
)
=>
{
//加上传送带的动画
//移动的动画,如果是两头的需要一个带遮罩的动画
...
...
@@ -43,12 +27,13 @@ export default async (thisObj: MainScene) => {
const
targetIndexsList
=
[];
let
listItems
=
[];
if
(
!
conveyorAniList
)
conveyorAniList
=
{};
if
(
!
thisObj
[
'conveyorAniList'
])
thisObj
[
'conveyorAniList'
]
=
{};
for
(
const
conveyor
of
conveyorList
)
{
const
list
=
fillConveyor
(
conveyor
);
listItems
=
listItems
.
concat
(
list
);
const
targetIndexs
=
getTargetIndexs
(
conveyor
);
conveyorAniList
[
conveyor
.
toString
()]
=
new
ConveyorAni
(
conveyor
);
if
(
!
thisObj
[
'conveyorAniList'
][
conveyor
.
toString
()])
thisObj
[
'conveyorAniList'
][
conveyor
.
toString
()]
=
getConveyorAni
(
conveyor
,
thisObj
);
const
dir
=
getArrowDir
(
conveyor
);
let
foundTarget
:
number
;
...
...
@@ -85,11 +70,18 @@ export default async (thisObj: MainScene) => {
targetLattices
[
eleIndex
].
element
=
ele
;
const
targetP
=
Tool
.
getPositionByIndex
(
targetIndexs
[
eleIndex
]);
const
promise
=
new
Promise
((
r
)
=>
{
egret
.
Tween
.
get
(
ele
).
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
]
},
200
).
call
(
r
);
egret
.
Tween
.
get
(
ele
).
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
]
},
CONVERYOR_ANI_DUR
).
call
(
r
);
});
promiseList
.
push
(
promise
)
});
});
for
(
const
key
in
thisObj
[
'conveyorAniList'
])
{
if
(
thisObj
[
'conveyorAniList'
].
hasOwnProperty
(
key
))
{
const
ani
:
ConveyorAni
=
thisObj
[
'conveyorAniList'
][
key
];
ani
.
play
();
}
}
await
Promise
.
all
(
promiseList
);
}
\ No newline at end of file
egret/src/something/conveyor/ConveyorAni.ts
0 → 100644
View file @
908db4b2
import
{
CONVERYOR_ANI_DUR
}
from
"../../mainScene/doConveyorAI"
;
import
MainScene
from
"../../mainScene/MainScene"
;
import
{
Tool
}
from
"../Tool"
;
import
{
ARROW_DIR
,
fillConveyor
,
getArrowDir
}
from
"./conveyorTool"
;
//单个皮带转动动效
export
default
class
ConveyorAni
{
protected
orign
:
any
[];
protected
list
:
any
[];
protected
views
:
any
[]
=
[]
protected
_dir
;
constructor
(
conveyor
,
thisobj
:
MainScene
)
{
this
.
list
=
fillConveyor
(
conveyor
);
this
.
orign
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
list
));
this
.
views
=
this
.
list
.
map
(
index
=>
thisobj
.
conveyorMap
[
index
]);
this
.
_dir
=
getArrowDir
(
conveyor
);
}
play
()
{
}
}
class
ConveyorDownAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
y
:
view
.
y
+
Tool
.
height
},
CONVERYOR_ANI_DUR
).
call
(()
=>
{
});
})
}
}
class
ConveyorUpAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
y
:
view
.
y
-
Tool
.
height
},
CONVERYOR_ANI_DUR
).
call
(()
=>
{
})
})
}
}
class
ConveyorLeftAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
x
:
view
.
x
-
Tool
.
width
},
CONVERYOR_ANI_DUR
).
call
(()
=>
{
})
})
}
}
class
ConveyorRightAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
x
:
view
.
x
+
Tool
.
width
},
CONVERYOR_ANI_DUR
).
call
(()
=>
{
})
})
}
}
export
const
getConveyorAni
=
(
conveyor
,
thisobj
:
MainScene
)
=>
{
const
dir
=
getArrowDir
(
conveyor
);
switch
(
dir
)
{
case
ARROW_DIR
.
LEFT
:
return
new
ConveyorLeftAni
(
conveyor
,
thisobj
)
case
ARROW_DIR
.
RIGHT
:
return
new
ConveyorRightAni
(
conveyor
,
thisobj
)
case
ARROW_DIR
.
UP
:
return
new
ConveyorUpAni
(
conveyor
,
thisobj
)
case
ARROW_DIR
.
DOWN
:
return
new
ConveyorDownAni
(
conveyor
,
thisobj
)
}
}
\ No newline at end of file
egret/src/something/conveyor/ConveyorDownAni.ts
0 → 100644
View file @
908db4b2
import
{
CONVERYOR_ANI_DUR
}
from
"../../mainScene/doConveyorAI"
;
import
{
Tool
}
from
"../Tool"
;
import
ConveyorAni
from
"./ConveyorAni"
;
//单个皮带转动动效
export
default
class
ConveyorDownAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
y
:
view
.
y
+
Tool
.
height
},
CONVERYOR_ANI_DUR
);
})
}
}
egret/src/something/conveyor/ConveyorLeftAni.ts
0 → 100644
View file @
908db4b2
import
ConveyorAni
from
"./ConveyorAni"
;
import
{
Tool
}
from
"../Tool"
;
import
{
CONVERYOR_ANI_DUR
}
from
"../../mainScene/doConveyorAI"
;
//单个皮带转动动效
export
class
ConveyorLeftAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
x
:
view
.
x
-
Tool
.
width
},
CONVERYOR_ANI_DUR
);
})
}
}
egret/src/something/conveyor/ConveyorRightAni.ts
0 → 100644
View file @
908db4b2
import
ConveyorAni
from
"./ConveyorAni"
;
import
{
Tool
}
from
"../Tool"
;
import
{
CONVERYOR_ANI_DUR
}
from
"../../mainScene/doConveyorAI"
;
//单个皮带转动动效
export
default
class
ConveyorRightAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
x
:
view
.
x
+
Tool
.
width
},
CONVERYOR_ANI_DUR
);
})
}
}
egret/src/something/conveyor/ConveyorTopAni.ts
0 → 100644
View file @
908db4b2
import
ConveyorAni
from
"./ConveyorAni"
;
import
{
Tool
}
from
"../Tool"
;
import
{
CONVERYOR_ANI_DUR
}
from
"../../mainScene/doConveyorAI"
;
//单个皮带转动动效
export
default
class
ConveyorUpAni
extends
ConveyorAni
{
play
()
{
this
.
views
.
forEach
(
view
=>
{
egret
.
Tween
.
get
(
view
).
to
({
y
:
view
.
y
-
Tool
.
height
},
CONVERYOR_ANI_DUR
);
})
}
}
mock/happyclear/home.json
View file @
908db4b2
...
...
@@ -2513,131 +2513,6 @@
"levelNum"
:
500
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
501
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
502
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
503
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
504
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
505
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
506
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
507
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
508
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
509
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
510
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
511
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
512
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
513
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
514
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
515
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
516
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
517
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
518
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
519
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
520
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
521
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
522
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
523
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
524
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
525
,
"maxScore"
:
47440
,
"stars"
:
1
}
],
...
...
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