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
b7501c26
Commit
b7501c26
authored
May 27, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新元素动画调整
parent
bc650908
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
31 deletions
+64
-31
MainScene.ts
egret/src/mainScene/MainScene.ts
+18
-3
foodAni.ts
egret/src/something/anis/foodAni.ts
+20
-2
getChapter.ts
egret/src/something/chapters/getChapter.ts
+26
-26
No files found.
egret/src/mainScene/MainScene.ts
View file @
b7501c26
...
...
@@ -7206,8 +7206,15 @@ export default class MainScene extends Scene {
var
p1
=
new
egret
.
Point
(
fromP
[
0
],
fromP
[
1
]);
var
p3
=
new
egret
.
Point
(
midx
,
midy
);
var
p2
=
new
egret
.
Point
((
p1
.
x
-
p3
.
x
)
/
2
+
p3
.
x
,
p3
.
y
);
foodani1
.
setData
(
mv
,
p1
,
p2
,
p3
,
this
,
this
.
playElfoodAni2
,
type
,
1
);
var
time1
=
Math
.
ceil
(
egret
.
Point
.
distance
(
p1
,
p3
)
*
2
);
if
(
time1
<
300
){
time1
=
300
;
}
else
if
(
time1
>
500
){
time1
=
500
;
}
console
.
log
(
"位移时间"
,
time1
);
foodani1
.
setData
(
mv
,
p1
,
p2
,
p3
,
this
,
this
.
playElfoodAni2
,
type
,
1
,
"ani1"
,
time1
);
// console.log(mv);
this
.
effectContainer
.
addChild
(
mv
);
...
...
@@ -7270,7 +7277,15 @@ export default class MainScene extends Scene {
p3
.
y
=
p3
.
y
-
foodhei
/
2
+
addy
;
var
p2
=
new
egret
.
Point
((
p3
.
x
-
p1
.
x
)
/
3
+
p1
.
x
,(
p3
.
y
-
p1
.
y
)
/
3
+
p1
.
y
);
foodani2
.
setData
(
mv
,
p1
,
p2
,
p3
,
mainscene
,
mainscene
.
playElfoodAni3
,
type
,
tscale
);
var
time1
=
Math
.
ceil
(
egret
.
Point
.
distance
(
p1
,
p3
)
*
2
);
if
(
time1
<
300
){
time1
=
300
;
}
else
if
(
time1
>
500
){
time1
=
500
;
}
console
.
log
(
"位移时间"
,
time1
);
foodani2
.
setData
(
mv
,
p1
,
p2
,
p3
,
mainscene
,
mainscene
.
playElfoodAni3
,
type
,
tscale
,
"ani2"
,
time1
);
}
//食物通关目标动画3段
playElfoodAni3
(
mv
:
any
,
type
:
ElementType
,
mainscene
:
MainScene
){
...
...
egret/src/something/anis/foodAni.ts
View file @
b7501c26
...
...
@@ -34,15 +34,33 @@ export default class foodAni{
}
setData
(
mv
:
any
,
p1
:
egret
.
Point
,
p2
:
egret
.
Point
,
p3
:
egret
.
Point
,
mainscene
:
MainScene
,
callback
:
any
,
type
:
ElementType
,
mscale
:
number
){
setData
(
mv
:
any
,
p1
:
egret
.
Point
,
p2
:
egret
.
Point
,
p3
:
egret
.
Point
,
mainscene
:
MainScene
,
callback
:
any
,
type
:
ElementType
,
mscale
:
number
,
aniname
:
string
,
time1
:
number
){
this
.
moveimg
=
mv
;
this
.
movep1
=
p1
;
this
.
movec1
=
p2
;
this
.
movep2
=
p3
;
this
.
mscale
=
mscale
;
egret
.
Tween
.
get
(
this
).
to
({
factor
:
1
},
500
).
call
(
function
(){
egret
.
Tween
.
get
(
this
).
to
({
factor
:
1
},
time1
).
call
(
function
(){
callback
&&
callback
(
mv
,
type
,
mainscene
);
});
if
(
aniname
==
"ani1"
){
var
stime1
=
Math
.
floor
(
time1
/
4
);
egret
.
Tween
.
get
(
mv
).
to
({
scaleX
:
0.9
,
scaleY
:
1.1
},
stime1
,
egret
.
Ease
.
quadInOut
).
call
(()
=>
{
egret
.
Tween
.
get
(
mv
).
to
({
scaleX
:
1
,
scaleY
:
1
},
stime1
,
egret
.
Ease
.
quadInOut
).
call
(()
=>
{
egret
.
Tween
.
get
(
mv
).
to
({
scaleX
:
0.9618
,
scaleY
:
1.0618
},
stime1
,
egret
.
Ease
.
quadInOut
).
call
(()
=>
{
egret
.
Tween
.
get
(
mv
).
to
({
scaleX
:
1
,
scaleY
:
1
},
stime1
,
egret
.
Ease
.
quadInOut
)
});
})
});
}
}
}
\ No newline at end of file
egret/src/something/chapters/getChapter.ts
View file @
b7501c26
...
...
@@ -100,31 +100,31 @@ var a = {
};
// 取数据格式用,一般情况注释
(
function
exportFile
(
chapters
:
ChapterData
[])
{
var
obj
=
[]
for
(
var
i
=
1
;
i
<
chapters
.
length
;
i
++
)
{
var
chapter
:
ChapterData
=
chapters
[
i
]
var
target
:
PassTargetData
=
chapter
.
passTarget
var
a
:
any
=
{};
a
[
"lev"
]
=
i
;
a
[
"tar"
]
=
[];
if
(
target
.
type
==
PassType
.
SCORE_TARGET
)
{
a
[
"tar"
].
push
({
"type"
:
1
,
"num"
:
target
.
score
})
}
else
{
for
(
var
j
=
0
;
j
<
target
.
elements
.
length
;
j
++
)
{
var
element
=
target
.
elements
[
j
];
a
[
"tar"
].
push
({
"type"
:
submitTran
[
element
.
type
],
"num"
:
element
.
count
})
}
}
//
(function exportFile(chapters: ChapterData[]) {
//
var obj = []
//
for (var i = 1; i < chapters.length; i++) {
//
var chapter: ChapterData = chapters[i]
//
var target: PassTargetData = chapter.passTarget
//
var a: any = {};
//
a["lev"] = i;
//
a["tar"] = [];
//
if (target.type == PassType.SCORE_TARGET) {
//
a["tar"].push({ "type": 1, "num": target.score })
//
} else {
//
for (var j = 0; j < target.elements.length; j++) {
//
var element = target.elements[j];
//
a["tar"].push({ "type": submitTran[element.type], "num": element.count })
//
}
//
}
if
(
!
chapter
.
starScores
||
chapter
.
starScores
.
length
<=
0
)
throw
new
Error
(
'starScores未配置'
+
i
)
a
[
"one"
]
=
chapter
.
starScores
[
0
];
a
[
"two"
]
=
chapter
.
starScores
[
1
];
a
[
"three"
]
=
chapter
.
starScores
[
2
];
//
if(!chapter.starScores || chapter.starScores.length <=0)
//
throw new Error('starScores未配置'+i)
//
a["one"] = chapter.starScores[0];
//
a["two"] = chapter.starScores[1];
//
a["three"] = chapter.starScores[2];
obj
.
push
(
a
)
}
var
file
=
new
File
([
JSON
.
stringify
(
obj
)],
"cfg.json"
,
{
type
:
"text/plain;charset=utf-8"
});
window
[
"saveAs"
](
file
);
})(
chapters
)
//
obj.push(a)
//
}
//
var file = new File([JSON.stringify(obj)], "cfg.json", { type: "text/plain;charset=utf-8" });
//
window["saveAs"](file);
//
})(chapters)
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