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
2f224257
Commit
2f224257
authored
Mar 15, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bugs
parent
618dfdb1
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
271 additions
and
101 deletions
+271
-101
et_13.fire
play/assets/et_13/scene/et_13.fire
+167
-70
et_13.js
play/assets/et_13/script/et_13.js
+55
-22
util.js
play/assets/et_13/script/util.js
+13
-9
icon_bigstar.png
play/assets/et_13/texture/icon_bigstar.png
+0
-0
icon_bigstar.png.meta
play/assets/et_13/texture/icon_bigstar.png.meta
+36
-0
No files found.
play/assets/et_13/scene/et_13.fire
View file @
2f224257
This diff is collapsed.
Click to expand it.
play/assets/et_13/script/et_13.js
View file @
2f224257
...
...
@@ -99,7 +99,7 @@ cc.Class({
},
getDefaultData
()
{
const
dataJson
=
'
{"groupArr":[{"ques":"","optionArr":[{"type":"text","isRight":"1","text":"
aaa"},{"type":"text","isRight":"0","text":"bbb"},{"type":"text","isRight":"0","text":"ccc
"}]}]}
'
;
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
data1
=
JSON
.
parse
(
dataJson
);
return
data1
;
},
...
...
@@ -249,7 +249,7 @@ cc.Class({
bigStarArr
:
null
,
initStar
()
{
const
gArr
=
this
.
data
.
groupArr
;
if
(
gArr
.
length
<
1
)
{
if
(
gArr
.
length
<
=
1
)
{
return
;
}
...
...
@@ -269,6 +269,11 @@ cc.Class({
starTop
.
active
=
false
;
starBg
.
star
=
starTop
;
const
starBig
=
getSprNode
(
'
icon_bigstar
'
);
starBg
.
addChild
(
starBig
);
starBig
.
active
=
false
;
starBg
.
starBig
=
starBig
;
this
.
bigStarArr
.
push
(
starBg
);
}
},
...
...
@@ -322,8 +327,7 @@ cc.Class({
},
startBtnClicked
()
{
this
.
showQuestion
();
playAudio
(
this
.
btnClip
,
()
=>
{
this
.
showQuestion
(()
=>
{
cc
.
tween
(
this
)
.
delay
(
0.3
)
.
call
(()
=>
{
...
...
@@ -331,6 +335,7 @@ cc.Class({
})
.
start
();
});
playAudio
(
this
.
btnClip
);
},
restartBtnClicked
()
{
...
...
@@ -341,6 +346,9 @@ cc.Class({
},
hideBigStar
()
{
if
(
!
this
.
bigStarArr
)
{
return
;
}
for
(
let
i
=
0
;
i
<
this
.
bigStarArr
.
length
;
i
++
)
{
cc
.
tween
(
this
.
bigStarArr
[
i
].
star
)
.
to
(
0.5
,
{
scale
:
0
},
{
easing
:
'
cubicOut
'
})
...
...
@@ -353,18 +361,22 @@ cc.Class({
const
btn
=
cc
.
find
(
'
Canvas/btn_laba
'
)
btn
.
addComponent
(
cc
.
Button
);
btn
.
on
(
'
click
'
,
()
=>
{
playAudio
(
this
.
btnClip
,
()
=>
{
this
.
showQuestion
();
playAudio
(
this
.
btnClip
);
}
);
})
},
showQuestion
()
{
showQuestion
(
func
)
{
var
anim
=
cc
.
find
(
'
Canvas/btn_laba
'
).
getComponent
(
cc
.
Animation
);
anim
.
play
();
playAudioByUrl
(
this
.
curGroup
.
audio_url
,
()
=>
{
anim
.
stop
();
if
(
func
&&
typeof
(
func
)
==
'
function
'
)
{
func
();
}
});
...
...
@@ -604,35 +616,54 @@ cc.Class({
},
showBigStar
()
{
if
(
!
this
.
bigStarArr
||
this
.
bigStarArr
.
length
<=
0
)
{
this
.
checkGameEnd
();
return
;
}
const
bigStarBg
=
this
.
bigStarArr
[
this
.
groupIndex
];
const
star
=
bigStarBg
.
star
;
star
.
active
=
true
;
star
.
opacity
=
0
;
star
.
scale
=
7
*
this
.
_mapScaleMin
;
star
.
rotation
=
0
;
const
canvas
=
cc
.
find
(
'
Canvas
'
);
star
.
scale
=
1
;
star
.
angle
=
0
;
const
pos
=
star
.
parent
.
convertToNodeSpaceAR
(
canvas
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
-
canvas
.
height
/
2
)));
const
starBig
=
bigStarBg
.
starBig
;
starBig
.
active
=
true
;
starBig
.
scale
=
1
;
starBig
.
angle
=
-
90
;
star
.
x
=
pos
.
x
;
star
.
y
=
pos
.
y
;
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
startPos
=
star
.
parent
.
convertToNodeSpaceAR
(
canvas
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
-
canvas
.
height
/
2
)));
starBig
.
x
=
startPos
.
x
;
starBig
.
y
=
startPos
.
y
;
star
.
x
=
startPos
.
x
;
star
.
y
=
startPos
.
y
;
const
time
=
1
;
cc
.
tween
(
star
)
.
delay
(
time
/
3
)
.
to
(
time
*
2
/
3
,
{
x
:
0
})
.
to
(
time
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
start
();
cc
.
tween
(
star
)
.
to
(
time
,
{
y
:
0
},
{
easing
:
'
quadInOut
'
})
.
to
(
time
,
{
angle
:
-
720
})
.
start
();
cc
.
tween
(
star
)
.
to
(
time
,
{
scale
:
1
,
opacity
:
255
,
rotation
:
360
},
{
easing
:
'
quadOut
'
})
.
to
(
time
,
{
y
:
0
,
scale
:
1
,
opacity
:
255
},
{
easing
:
'
quadOut
'
})
.
call
(()
=>
{
this
.
checkGameEnd
();
})
.
start
();
cc
.
tween
(
starBig
)
.
to
(
time
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
start
();
cc
.
tween
(
starBig
)
.
to
(
time
,
{
angle
:
-
720
-
90
})
.
start
();
cc
.
tween
(
starBig
)
.
to
(
time
,
{
y
:
0
,
scale
:
0
},
{
easing
:
'
quadOut
'
})
.
start
();
playAudio
(
this
.
bigStarClip
);
},
...
...
@@ -645,11 +676,13 @@ cc.Class({
return
;
}
await
asyncDelay
(
3
);
await
asyncDelay
(
1
);
this
.
initCurGroup
();
this
.
showQuestion
(()
=>
{
this
.
showOnePenguin
();
this
.
showQuestion
(
);
}
);
},
gameEnd
()
{
...
...
@@ -741,7 +774,7 @@ cc.Class({
cc
.
Color
.
fromHEX
(
color
,
'
c1431d
'
);
labelNode
.
color
=
color
;
labelNode
.
y
=
5
;
labelNode
.
y
=
-
2.
5
;
textPanel
.
label
=
label
;
...
...
play/assets/et_13/script/util.js
View file @
2f224257
...
...
@@ -72,7 +72,7 @@ export function setSprNodeMaxLen(sprNode, maxW, maxH) {
export
function
getSpriteFrimeByUrl
(
url
,
cb
)
{
cc
.
loader
.
load
({
url
},
(
err
,
img
)
=>
{
cc
.
loader
.
load
({
url
},
(
err
,
img
)
=>
{
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
if
(
cb
)
{
cb
(
spriteFrame
);
...
...
@@ -100,7 +100,7 @@ export function getSprNodeByUrl(url, cb) {
export
function
playAudio
(
audioClip
,
cb
=
null
)
{
export
function
playAudio
(
audioClip
,
cb
=
null
)
{
if
(
audioClip
)
{
const
audioId
=
cc
.
audioEngine
.
playEffect
(
audioClip
,
false
,
0.8
);
if
(
cb
)
{
...
...
@@ -112,11 +112,15 @@ export function playAudio(audioClip, cb=null) {
}
export
function
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
export
function
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
if
(
audio_url
)
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
)
=>
{
playAudio
(
audioClip
,
cb
);
});
}
else
{
if
(
cb
&&
typeof
(
cb
)
==
'
function
'
)
{
cb
();
}
}
}
...
...
play/assets/et_13/texture/icon_bigstar.png
0 → 100644
View file @
2f224257
14.5 KB
play/assets/et_13/texture/icon_bigstar.png.meta
0 → 100644
View file @
2f224257
{
"ver": "2.3.5",
"uuid": "d3a49532-95aa-4e7c-928b-a27b02497a8f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 278,
"height": 275,
"platformSettings": {},
"subMetas": {
"icon_bigstar": {
"ver": "1.0.4",
"uuid": "34d97abe-f3fb-4599-9d5a-55e730f6d897",
"rawTextureUuid": "d3a49532-95aa-4e7c-928b-a27b02497a8f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 278,
"height": 275,
"rawWidth": 278,
"rawHeight": 275,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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