Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_cocos_trace_letter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
dfzx_cocos_trace_letter
Commits
cb466971
Commit
cb466971
authored
Jun 11, 2021
by
LMZ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: showStar
parent
7e74769f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
67 deletions
+57
-67
star.js
play/assets/ET_07/prefab/star.js
+57
-67
No files found.
play/assets/ET_07/prefab/star.js
View file @
cb466971
...
...
@@ -117,76 +117,66 @@ cc.Class({
}
},
showBigStar
()
{
if
(
!
this
.
bigStarArr
||
this
.
bigStarArr
.
length
<=
0
)
{
// this.checkGameEnd();
return
;
currentStarIdx
:
null
,
showStar
(
)
{
if
(
!
this
.
currentStarIdx
)
{
this
.
currentStarIdx
=
0
;
}
const
bigStarBg
=
this
.
bigStarArr
[
this
.
curGroupIndex
];
const
starBig
=
bigStarBg
.
starBig
;
const
starBase
=
cc
.
find
(
`Canvas/layout/starBase_
${
this
.
currentStarIdx
}
`
);
if
(
!
starBase
)
{
return
;
}
const
star
=
starBase
.
getChildByName
(
'
Star
'
);
const
starBig
=
star
.
getChildByName
(
'
StarBig
'
);
starBig
.
scale
=
1
;
const
star
=
bigStarBg
.
star
;
star
.
active
=
true
;
star
.
scaleX
=
0.7
/
bigStarBg
.
scale
;
star
.
scaleY
=
1
/
bigStarBg
.
scale
;
star
.
scaleX
=
0.7
/
starBase
.
scale
;
star
.
scaleY
=
1
/
starBase
.
scale
;
star
.
angle
=
90
;
const
canvas
=
cc
.
find
(
"
Canvas
"
);
const
startPos
=
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
2
)
);
const
middlePos
=
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
4
)
);
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
startPos
=
this
.
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
2
));
const
middlePos
=
this
.
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
4
));
star
.
x
=
startPos
.
x
;
star
.
y
=
startPos
.
y
-
starBig
.
height
;
console
.
log
(
"
middlePos =
"
+
JSON
.
stringify
(
middlePos
));
console
.
log
(
'
middlePos =
'
+
JSON
.
stringify
(
middlePos
));
const
time
=
1
;
cc
.
tween
(
star
)
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
80
},
{
easing
:
"
quadOut
"
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
+
40
,
scaleX
:
1.2
/
bigStarBg
.
scale
,
scaleY
:
0.8
/
bigStarBg
.
scale
,
},
{
easing
:
"
quadOut
"
}
)
.
to
(
0.1
,
{
y
:
middlePos
.
y
,
scaleX
:
1
/
bigStarBg
.
scale
,
scaleY
:
1
/
bigStarBg
.
scale
,
},
{
easing
:
"
quadOut
"
}
)
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
80
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
+
40
,
scaleX
:
1.2
/
starBase
.
scale
,
scaleY
:
0.8
/
starBase
.
scale
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
,
scaleX
:
1
/
starBase
.
scale
,
scaleY
:
1
/
starBase
.
scale
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.1
)
.
to
(
0.8
,
{
angle
:
-
720
,
scale
:
1
})
.
start
();
cc
.
tween
(
star
).
delay
(
0.6
).
to
(
0.8
,
{
x
:
0
},
{
easing
:
"
quadIn
"
}).
start
();
cc
.
tween
(
star
).
delay
(
0.6
).
to
(
0.8
,
{
y
:
0
},
{
easing
:
"
quadOut
"
}).
start
();
cc
.
tween
(
star
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
start
();
cc
.
tween
(
star
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
y
:
0
},
{
easing
:
'
quadOut
'
})
.
start
();
cc
.
tween
(
starBig
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
scale
:
0
},
{
easing
:
"
quadOut
"
})
.
to
(
0.8
,
{
scale
:
0
},
{
easing
:
'
quadOut
'
})
.
call
(()
=>
{
// this.checkGameEnd();
// playAudio(this.starCountClip);
})
.
start
();
// playAudio(this.bigStarClip)
;
this
.
currentStarIdx
++
;
},
exchangeNodePos
(
targetNode
,
baseNode
,
basePos
)
{
return
targetNode
.
convertToNodeSpaceAR
(
baseNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
basePos
.
x
,
basePos
.
y
)));
},
between
(
a
,
b
,
c
)
{
return
[
a
,
b
,
c
].
sort
()[
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