Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_cocos_dds
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_dds
Commits
75e92b5f
Commit
75e92b5f
authored
Mar 16, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 超过5个题的时候右侧星星缩放
parent
4749dfda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
.DS_Store
.DS_Store
+0
-0
et_13.js
play/assets/et_13/script/et_13.js
+12
-5
No files found.
.DS_Store
View file @
75e92b5f
No preview for this file type
play/assets/et_13/script/et_13.js
View file @
75e92b5f
...
@@ -99,7 +99,7 @@ cc.Class({
...
@@ -99,7 +99,7 @@ cc.Class({
},
},
getDefaultData
()
{
getDefaultData
()
{
const
dataJson
=
'
{"groupArr":[{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"bdpq"},{"type":"text","isRight":"0","text":"ooo"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]}]}
'
;
const
dataJson
=
'
{"groupArr":[{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"bdpq"},{"type":"text","isRight":"0","text":"ooo"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]}
,{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]},{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"pad"},{"type":"text","isRight":"0","text":"ggff"},{"type":"text","isRight":"0","text":"OOO"}]}
]}
'
;
const
data1
=
JSON
.
parse
(
dataJson
);
const
data1
=
JSON
.
parse
(
dataJson
);
return
data1
;
return
data1
;
},
},
...
@@ -258,11 +258,17 @@ cc.Class({
...
@@ -258,11 +258,17 @@ cc.Class({
let
baseX
=
this
.
canvas
.
width
/
2
-
80
*
this
.
_mapScaleMin
;
let
baseX
=
this
.
canvas
.
width
/
2
-
80
*
this
.
_mapScaleMin
;
let
baseY
=
this
.
canvas
.
height
/
2
-
80
*
this
.
_mapScaleMin
;
let
baseY
=
this
.
canvas
.
height
/
2
-
80
*
this
.
_mapScaleMin
;
let
disH
=
80
*
this
.
_mapScaleMin
;
let
disH
=
80
*
this
.
_mapScaleMin
;
let
disScale
=
1
;
if
(
gArr
.
length
>
5
)
{
disH
=
(
400
/
gArr
.
length
)
*
this
.
_mapScaleMin
;
disScale
=
5
/
gArr
.
length
;
}
for
(
let
i
=
0
;
i
<
gArr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
gArr
.
length
;
i
++
)
{
const
starBg
=
getSprNode
(
'
star_bg
'
);
const
starBg
=
getSprNode
(
'
star_bg
'
);
this
.
canvas
.
addChild
(
starBg
,
2
);
this
.
canvas
.
addChild
(
starBg
,
2
);
starBg
.
x
=
baseX
;
starBg
.
x
=
baseX
;
starBg
.
y
=
baseY
-
i
*
disH
;
starBg
.
y
=
baseY
-
i
*
disH
;
starBg
.
scale
=
disScale
;
const
starTop
=
getSprNode
(
'
star
'
);
const
starTop
=
getSprNode
(
'
star
'
);
starBg
.
addChild
(
starTop
);
starBg
.
addChild
(
starTop
);
...
@@ -626,7 +632,8 @@ cc.Class({
...
@@ -626,7 +632,8 @@ cc.Class({
const
starBig
=
bigStarBg
.
starBig
;
const
starBig
=
bigStarBg
.
starBig
;
const
star
=
bigStarBg
.
star
;
const
star
=
bigStarBg
.
star
;
star
.
active
=
true
;
star
.
active
=
true
;
star
.
scaleX
=
0.7
;
star
.
scaleX
=
0.7
/
bigStarBg
.
scale
;
star
.
scaleY
=
1
/
bigStarBg
.
scale
;
star
.
angle
=
90
;
star
.
angle
=
90
;
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
startPos
=
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
2
));
const
startPos
=
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
2
));
...
@@ -638,10 +645,10 @@ cc.Class({
...
@@ -638,10 +645,10 @@ cc.Class({
const
time
=
1
;
const
time
=
1
;
cc
.
tween
(
star
)
cc
.
tween
(
star
)
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
80
},
{
easing
:
'
quadOut
'
})
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
80
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
+
40
,
scaleX
:
1.2
,
scaleY
:
0.8
},
{
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
,
scaleY
:
1
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
,
scaleX
:
1
/
bigStarBg
.
scale
,
scaleY
:
1
/
bigStarBg
.
scale
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.1
)
.
delay
(
0.1
)
.
to
(
0.8
,
{
angle
:
-
720
})
.
to
(
0.8
,
{
angle
:
-
720
,
scale
:
1
})
.
start
();
.
start
();
cc
.
tween
(
star
)
cc
.
tween
(
star
)
...
...
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