Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP05
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
OP05
Commits
531fc82d
Commit
531fc82d
authored
Dec 16, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改需求
parent
b9237bac
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
4939 additions
and
4306 deletions
+4939
-4306
tryagain.mp3
assets/OP05/audios/tryagain.mp3
+0
-0
tryagain.mp3.meta
assets/OP05/audios/tryagain.mp3.meta
+1
-1
OP05.fire
assets/OP05/scene/OP05.fire
+4523
-4180
OP05.js
assets/OP05/scene/OP05.js
+394
-117
gameManager.js
assets/OP05/scene/gameManager.js
+11
-1
defaultData.js
assets/OP05/script/defaultData.js
+4
-1
btn_replay.png
assets/OP05/textures/read/btn_replay.png
+0
-0
btn_replay.png.meta
assets/OP05/textures/read/btn_replay.png.meta
+6
-6
No files found.
assets/OP05/audios/tryagain.mp3
View file @
531fc82d
No preview for this file type
assets/OP05/audios/tryagain.mp3.meta
View file @
531fc82d
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
"ver": "2.0.1",
"ver": "2.0.1",
"uuid": "e187dccb-ea0a-45de-be95-53c50683cd19",
"uuid": "e187dccb-ea0a-45de-be95-53c50683cd19",
"downloadMode": 0,
"downloadMode": 0,
"duration": 1.
188
,
"duration": 1.
708286
,
"subMetas": {}
"subMetas": {}
}
}
\ No newline at end of file
assets/OP05/scene/OP05.fire
View file @
531fc82d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
assets/OP05/scene/OP05.js
View file @
531fc82d
...
@@ -103,8 +103,7 @@ cc.Class({
...
@@ -103,8 +103,7 @@ cc.Class({
},
},
getDefaultData
()
{
getDefaultData
()
{
return
itemData
;
return
defaultData
;
// return defaultData;
},
},
preloadItem
()
{
preloadItem
()
{
...
@@ -173,6 +172,7 @@ cc.Class({
...
@@ -173,6 +172,7 @@ cc.Class({
this
.
initSingleData
();
this
.
initSingleData
();
this
.
initAudio
();
this
.
initAudio
();
this
.
initView
();
this
.
initView
();
this
.
initEvent
();
},
},
...
@@ -192,6 +192,8 @@ cc.Class({
...
@@ -192,6 +192,8 @@ cc.Class({
_cardTouchItems
:
null
,
_cardTouchItems
:
null
,
_successItems
:
null
,
_successItems
:
null
,
initSingleData
()
{
initSingleData
()
{
this
.
_cat
=
GameManager
.
getIns
().
cat
;
this
.
_tryagain
=
GameManager
.
getIns
().
tryagain
;
this
.
_stageData
=
GameManager
.
getIns
().
getStageData
();
this
.
_stageData
=
GameManager
.
getIns
().
getStageData
();
GameManager
.
getIns
().
setState
(
0
);
//调用数组中的数据,同时设置关卡状态为0
GameManager
.
getIns
().
setState
(
0
);
//调用数组中的数据,同时设置关卡状态为0
// console.log("1")
// console.log("1")
...
@@ -211,6 +213,25 @@ cc.Class({
...
@@ -211,6 +213,25 @@ cc.Class({
this
.
initLayout
();
this
.
initLayout
();
},
},
initLayout
()
{
initLayout
()
{
if
(
GameManager
.
getIns
().
getState
()
==
0
)
{
this
.
state0InitPart
();
}
else
if
(
GameManager
.
getIns
().
getState
()
==
1
)
{
this
.
state1StartPlay
();
}
else
if
(
GameManager
.
getIns
().
getState
()
==
2
)
{
this
.
state2ComplatePlay
();
}
else
if
(
GameManager
.
getIns
().
getState
()
==
3
)
{
this
.
state3GoodJob
();
}
else
if
(
GameManager
.
getIns
().
getState
()
==
4
)
{
this
.
state4TryAgain
();
}
else
if
(
GameManager
.
getIns
().
getState
()
==
5
)
{
this
.
state5Finish
();
}
else
if
(
GameManager
.
getIns
().
getState
()
==
6
)
{
}
},
initEvent
()
{
let
btn_mao
=
pg
.
view
.
find
(
this
,
"
btn_mao
"
)
let
btn_carton
=
pg
.
view
.
find
(
this
,
"
btn_carton
"
)
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
...
@@ -228,15 +249,35 @@ cc.Class({
...
@@ -228,15 +249,35 @@ cc.Class({
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
pg
.
view
.
touchOn
(
btn_record
,
this
.
onTouchRecord
,
this
);
//注册按钮监听
pg
.
view
.
touchOn
(
btn_record
,
this
.
onTouchRecord
,
this
);
//注册按钮监听
pg
.
view
.
touchOn
(
btn_next
,
this
.
onTouchNext
,
this
);
pg
.
view
.
touchOn
(
btn_next
,
this
.
onTouchNext
,
this
);
pg
.
view
.
touchOn
(
btn_return
,
this
.
onTouchReturn
,
this
);
pg
.
view
.
touchOn
(
btn_return
,
this
.
onTouchReturn
,
this
);
pg
.
view
.
touchOn
(
btn_recording
,
this
.
onTouchRecording
,
this
);
pg
.
view
.
touchOn
(
btn_recording
,
this
.
onTouchRecording
,
this
);
pg
.
view
.
touchOn
(
btn_replay
,
this
.
onTouchReplay
,
this
);
pg
.
view
.
touchOn
(
btn_replay
,
this
.
onTouchReplay
,
this
);
pg
.
view
.
touchOn
(
btn_picture
,
this
.
onTouchPicture
,
this
);
pg
.
view
.
touchOn
(
btn_picture
,
this
.
onTouchPicture
,
this
);
pg
.
view
.
touchOn
(
btn_carton
,
this
.
onTouchCarton
,
this
);
pg
.
view
.
touchOn
(
icon_ex
,
this
.
onTouchWord
,
this
);
pg
.
view
.
touchOn
(
btn_mao
,
this
.
onTouchCat
,
this
);
},
state0InitPart
()
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
if
(
GameManager
.
getIns
().
getState
()
==
0
)
{
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
pg
.
view
.
visible
(
btn_replay
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
end
,
false
);
//不显示的内容用false
pg
.
view
.
visible
(
end
,
false
);
//不显示的内容用false
pg
.
view
.
visible
(
end_success
,
false
);
pg
.
view
.
visible
(
end_success
,
false
);
...
@@ -248,46 +289,102 @@ cc.Class({
...
@@ -248,46 +289,102 @@ cc.Class({
pg
.
view
.
setNetImg
(
bg_book
,
bg_book_img
);
//与界面的节点绑定
pg
.
view
.
setNetImg
(
bg_book
,
bg_book_img
);
//与界面的节点绑定
//拓展加载动画的内容
//拓展加载动画的内容
this
.
animationName
=
""
;
this
.
animationName
=
""
;
this
.
_tryagainCount
=
0
;
if
(
!
this
.
_cat
||
!
this
.
_cat
.
start
||
this
.
_catStartPlayed
)
{
pg
.
view
.
loadDB
(
carton
,
{
ske
:
this
.
_stageData
.
cartoonSke
,
tex
:
this
.
_stageData
.
cartoonTex
,
png
:
this
.
_stageData
.
cartoonPng
}).
then
((
animationName
)
=>
{
pg
.
view
.
loadDB
(
carton
,
{
ske
:
this
.
_stageData
.
cartoonSke
,
tex
:
this
.
_stageData
.
cartoonTex
,
png
:
this
.
_stageData
.
cartoonPng
}).
then
((
animationName
)
=>
{
this
.
animationName
=
animationName
;
this
.
animationName
=
animationName
;
GameManager
.
getIns
().
setState
(
1
);
GameManager
.
getIns
().
setState
(
1
);
this
.
initLayout
()
//完成后直接进入下一步
this
.
initLayout
()
//完成后直接进入下一步
})
})
}
else
if
(
GameManager
.
getIns
().
getState
()
==
1
)
{
}
else
{
pg
.
audio
.
playAudioByUrl
(
this
.
_cat
.
start
).
then
(()
=>
{
this
.
_catStartPlayed
=
true
;
pg
.
view
.
loadDB
(
carton
,
{
ske
:
this
.
_stageData
.
cartoonSke
,
tex
:
this
.
_stageData
.
cartoonTex
,
png
:
this
.
_stageData
.
cartoonPng
}).
then
((
animationName
)
=>
{
this
.
animationName
=
animationName
;
GameManager
.
getIns
().
setState
(
1
);
this
.
initLayout
()
//完成后直接进入下一步
})
})
}
},
state1StartPlay
()
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
pg
.
view
.
visible
(
btn_replay
,
false
);
pg
.
view
.
visible
(
btn_replay
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
let
dragonDisplay
=
carton
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
this
.
playPartAni
()
dragonDisplay
.
playAnimation
(
this
.
animationName
,
1
);
//animation所有的动画名称
this
.
playWordAni
().
then
(()
=>
{
icon_ex_txt
.
active
=
false
;
this
.
playRecordAudio
();
icon_ex
.
active
=
false
;
})
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
// this._timeoutIds.push(setTimeout(() => {
pg
.
view
.
visible
(
icon_ex
,
true
);
// pg.view.visible(icon_hand, true);
let
icon_ex_word
=
this
.
_stageData
.
word
;
// let action = cc.tween(icon_hand);
this
.
wordAni
(
icon_ex_txt
,
icon_ex_word
)
// action.sequence(
pg
.
audio
.
playAudioByUrl
(
this
.
_stageData
.
sound
);
// cc.tween().by(0.5, { y: 50 }),
},
1000
*
2
));
// cc.tween().by(0.5, { y: -50 }),
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
// ).repeatForever();
pg
.
view
.
visible
(
btn_record
,
true
);
// action.start();
pg
.
view
.
visible
(
btn_replay
,
true
);
// }, 1000 * 6.3));
this
.
playSFX
(
"
audio_record
"
);
},
},
1000
*
6.3
));
state2ComplatePlay
()
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
pg
.
view
.
visible
(
icon_hand
,
true
);
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
action
=
cc
.
tween
(
icon_hand
);
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
action
.
sequence
(
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
cc
.
tween
().
by
(
0.5
,
{
y
:
50
}),
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
cc
.
tween
().
by
(
0.5
,
{
y
:
-
50
}),
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
).
repeatForever
();
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
action
.
start
();
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
},
1000
*
6.3
));
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
}
else
if
(
GameManager
.
getIns
().
getState
()
==
2
)
{
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
pg
.
view
.
visible
(
icon_hand
,
false
);
pg
.
view
.
visible
(
icon_hand
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
btn_replay
,
false
);
pg
.
view
.
visible
(
btn_replay
,
false
);
pg
.
view
.
visible
(
btn_recording
,
true
);
pg
.
view
.
visible
(
btn_recording
,
true
);
pg
.
view
.
visible
(
progress
,
true
);
pg
.
view
.
visible
(
progress
,
true
);
}
else
if
(
GameManager
.
getIns
().
getState
()
==
3
)
{
},
state3GoodJob
()
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
btn_recording
,
false
);
pg
.
view
.
visible
(
btn_recording
,
false
);
pg
.
view
.
visible
(
progress
,
false
);
pg
.
view
.
visible
(
progress
,
false
);
...
@@ -299,16 +396,53 @@ cc.Class({
...
@@ -299,16 +396,53 @@ cc.Class({
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
nextStage
();
this
.
nextStage
();
},
1000
*
4
));
//6秒钟之后进入下一关卡
},
1000
*
4
));
//6秒钟之后进入下一关卡
}
else
if
(
GameManager
.
getIns
().
getState
()
==
4
)
{
},
state4TryAgain
()
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
// 一局失败弹出tryagain,同时下方录音按钮明亮并出现提示
// 一局失败弹出tryagain,同时下方录音按钮明亮并出现提示
this
.
playSFX
(
"
audio_tryagain
"
);
pg
.
view
.
visible
(
end
,
true
);
pg
.
view
.
visible
(
end
,
true
);
pg
.
view
.
visible
(
bg_tryagain
,
true
);
pg
.
view
.
visible
(
bg_tryagain
,
true
);
pg
.
view
.
visible
(
btn_recording
,
false
);
pg
.
view
.
visible
(
btn_recording
,
false
);
pg
.
view
.
visible
(
btn_record
,
true
);
pg
.
view
.
visible
(
btn_record
,
true
);
pg
.
view
.
visible
(
progress
,
false
);
pg
.
view
.
visible
(
progress
,
false
);
this
.
_playing
=
true
;
this
.
_tryagainCount
++
;
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
playSFX
(
"
audio_record
"
);
if
(
this
.
_tryagainCount
==
1
)
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
one
).
then
(()
=>
{
this
.
_playing
=
false
;
})
// this.playSFX("audio_record");
pg
.
view
.
visible
(
icon_hand
,
true
);
let
action
=
cc
.
tween
(
icon_hand
);
action
.
sequence
(
cc
.
tween
().
by
(
0.5
,
{
y
:
50
}),
cc
.
tween
().
by
(
0.5
,
{
y
:
-
50
}),
).
repeatForever
();
action
.
start
();
}
else
if
(
this
.
_tryagainCount
==
2
)
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
two
).
then
(()
=>
{
this
.
_playing
=
false
;
})
// this.playSFX("audio_record");
pg
.
view
.
visible
(
icon_hand
,
true
);
pg
.
view
.
visible
(
icon_hand
,
true
);
let
action
=
cc
.
tween
(
icon_hand
);
let
action
=
cc
.
tween
(
icon_hand
);
action
.
sequence
(
action
.
sequence
(
...
@@ -316,25 +450,147 @@ cc.Class({
...
@@ -316,25 +450,147 @@ cc.Class({
cc
.
tween
().
by
(
0.5
,
{
y
:
-
50
}),
cc
.
tween
().
by
(
0.5
,
{
y
:
-
50
}),
).
repeatForever
();
).
repeatForever
();
action
.
start
();
action
.
start
();
}
else
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
three
).
then
(()
=>
{
this
.
_playing
=
false
;
this
.
nextStage
();
})
}
},
1000
*
1
));
},
1000
*
1
));
},
state5Finish
()
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
}
else
if
(
GameManager
.
getIns
().
getState
()
==
5
)
{
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
pg
.
view
.
visible
(
end
,
false
);
pg
.
view
.
visible
(
end
,
false
);
pg
.
view
.
visible
(
end_success
,
false
);
pg
.
view
.
visible
(
end_success
,
false
);
pg
.
view
.
visible
(
bg_tryagain
,
false
);
pg
.
view
.
visible
(
bg_tryagain
,
false
);
this
.
playSFX
(
"
audio_finish
"
);
pg
.
audio
.
playAudioByUrl
(
this
.
_cat
.
finish
)
// this.playSFX("audio_finish");
// pg.view.visible(btn_picture, true);
// pg.view.visible(btn_picture, true);
pg
.
view
.
visible
(
btn_record
,
false
);
pg
.
view
.
visible
(
btn_record
,
false
);
onHomeworkFinish
&&
onHomeworkFinish
();
onHomeworkFinish
&&
onHomeworkFinish
();
}
else
if
(
GameManager
.
getIns
().
getState
()
==
6
)
{
},
playPartAni
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
let
dragonDisplay
=
carton
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
this
.
animationName
,
1
);
//animation所有的动画名称
});
},
playWordAni
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
this
.
_playing
=
true
;
icon_ex_txt
.
active
=
false
;
icon_ex
.
active
=
false
;
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
pg
.
view
.
visible
(
icon_ex
,
true
);
let
icon_ex_word
=
this
.
_stageData
.
word
;
let
aniFinished
=
false
;
let
audioFinished
=
false
;
this
.
wordAni
(
icon_ex_txt
,
icon_ex_word
).
then
(()
=>
{
aniFinished
=
true
;
if
(
aniFinished
&&
audioFinished
)
{
this
.
_playing
=
false
;
resolve
(
''
);
}
})
pg
.
audio
.
playAudioByUrl
(
this
.
_stageData
.
sound
).
then
(()
=>
{
audioFinished
=
true
;
if
(
aniFinished
&&
audioFinished
)
{
this
.
_playing
=
false
;
resolve
(
''
);
}
})
},
1000
*
2
));
});
},
playRecordAudio
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
_playing
=
true
;
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_recording
=
pg
.
view
.
find
(
this
,
"
btn_recording
"
)
let
btn_record
=
pg
.
view
.
find
(
this
,
"
btn_record
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_return
=
pg
.
view
.
find
(
this
,
"
btn_return
"
);
let
icon_ex_txt
=
pg
.
view
.
find
(
icon_ex
,
"
txt
"
);
let
icon_hand
=
pg
.
view
.
find
(
this
,
"
icon_hand
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
pg
.
view
.
visible
(
btn_record
,
true
);
pg
.
view
.
visible
(
btn_replay
,
true
);
if
(
this
.
_audio_record
)
{
this
.
_playing
=
false
;
resolve
(
""
);
}
else
{
this
.
_audio_record
=
true
;
pg
.
audio
.
playAudioByUrl
(
this
.
_cat
.
record
).
then
(()
=>
{
this
.
_playing
=
false
;
resolve
(
''
);
})
}
}
});
},
},
wordAni
(
item
,
content
)
{
wordAni
(
item
,
content
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
item
.
active
=
true
;
item
.
active
=
true
;
let
itemfirst
=
pg
.
view
.
find
(
item
,
"
first
"
);
let
itemfirst
=
pg
.
view
.
find
(
item
,
"
first
"
);
//动态居中算法。
//动态居中算法。
...
@@ -366,17 +622,16 @@ cc.Class({
...
@@ -366,17 +622,16 @@ cc.Class({
item
.
getComponent
(
cc
.
RichText
).
string
=
str2
;
item
.
getComponent
(
cc
.
RichText
).
string
=
str2
;
},
30
);
},
30
);
this
.
_intervalIds
.
push
(
inter
);
this
.
_intervalIds
.
push
(
inter
);
setTimeout
(()
=>
{
resolve
(
''
);
},
1200
);
},
4100
));
},
4100
));
// setTimeout(() => {
});
// //全部变大
// let str2 = `<size=150><color=#ffffff>${s0}</color><color=#0000>${s1}</color></size>`
// itemfirst.y = 0;
// item.getComponent(cc.RichText).string = str2;
// }, 1100);
},
},
//按钮触发,使用的方法
//按钮触发,使用的方法
onTouchRecord
()
{
onTouchRecord
()
{
if
(
this
.
_playing
)
return
;
this
.
playSFX
(
"
audio_btns
"
);
this
.
playSFX
(
"
audio_btns
"
);
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
...
@@ -393,12 +648,12 @@ cc.Class({
...
@@ -393,12 +648,12 @@ cc.Class({
"
recordId
"
:
"
6144295213f0a2200000ed93
"
,
"
recordId
"
:
"
6144295213f0a2200000ed93
"
,
"
eof
"
:
1
,
"
eof
"
:
1
,
"
result
"
:
{
"
result
"
:
{
"
pronunciation
"
:
7
5
,
"
pronunciation
"
:
2
5
,
"
resource_version
"
:
"
3.1.0
"
,
"
resource_version
"
:
"
3.1.0
"
,
"
fluency
"
:
60
,
"
fluency
"
:
60
,
"
rhythm
"
:
90
,
"
rhythm
"
:
90
,
"
kernel_version
"
:
"
5.2.4
"
,
"
kernel_version
"
:
"
5.2.4
"
,
"
overall
"
:
7
4
,
"
overall
"
:
7
5
,
"
integrity
"
:
100
,
"
integrity
"
:
100
,
"
duration
"
:
"
6.779
"
,
"
duration
"
:
"
6.779
"
,
"
rear_tone
"
:
"
fall
"
,
"
rear_tone
"
:
"
fall
"
,
...
@@ -437,6 +692,7 @@ cc.Class({
...
@@ -437,6 +692,7 @@ cc.Class({
},
},
onTouchReplay
()
{
onTouchReplay
()
{
if
(
this
.
_playing
)
return
;
this
.
playSFX
(
"
audio_btns
"
);
this
.
playSFX
(
"
audio_btns
"
);
GameManager
.
getIns
().
setState
(
1
);
GameManager
.
getIns
().
setState
(
1
);
this
.
initLayout
()
this
.
initLayout
()
...
@@ -445,6 +701,25 @@ cc.Class({
...
@@ -445,6 +701,25 @@ cc.Class({
// this.playSFX("audio_btns");
// this.playSFX("audio_btns");
},
},
onTouchCarton
()
{
if
(
this
.
_playing
)
return
;
this
.
_playing
=
true
;
this
.
playPartAni
();
setTimeout
(()
=>
{
this
.
_playing
=
false
;
},
900
);
},
onTouchWord
()
{
if
(
this
.
_playing
)
return
;
this
.
playWordAni
();
},
onTouchCat
()
{
if
(
this
.
_playing
)
return
;
this
.
_playing
=
true
;
pg
.
audio
.
playAudioByUrl
(
this
.
_cat
.
wait
).
then
(()
=>
{
this
.
_playing
=
false
;
})
},
nextStage
()
{
nextStage
()
{
let
isOver
=
GameManager
.
getIns
().
addStage
();
//关卡标记+1
let
isOver
=
GameManager
.
getIns
().
addStage
();
//关卡标记+1
...
@@ -561,8 +836,10 @@ cc.Class({
...
@@ -561,8 +836,10 @@ cc.Class({
if
(
!
audioSource
)
return
resolve
();
if
(
!
audioSource
)
return
resolve
();
let
audioClip
=
audioSource
.
clip
;
let
audioClip
=
audioSource
.
clip
;
if
(
!
audioClip
)
return
resolve
();
if
(
!
audioClip
)
return
resolve
();
cc
.
audioEngine
.
play
(
audioClip
,
false
,
1
);
let
id
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
1
);
resolve
(
''
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
();
})
});
});
},
},
...
...
assets/OP05/scene/gameManager.js
View file @
531fc82d
...
@@ -13,13 +13,17 @@ class GameManager {
...
@@ -13,13 +13,17 @@ class GameManager {
this
.
_list
=
[];
this
.
_list
=
[];
this
.
_stage
=
0
;
//关卡
this
.
_stage
=
0
;
//关卡
this
.
_state
=
0
;
//状态
this
.
_state
=
0
;
//状态
this
.
_cat
=
{};
this
.
_tryagain
=
{};
}
}
init
()
{
init
()
{
console
.
log
(
`init`
);
console
.
log
(
`init`
);
}
}
parseData
(
data
)
{
parseData
(
data
)
{
console
.
log
(
data
);
console
.
log
(
data
);
let
arr
=
data
.
contentObj
.
picArr
;
this
.
_cat
=
data
.
contentObj
.
picArr
.
cat
;
this
.
_tryagain
=
data
.
contentObj
.
picArr
.
tryagain
;
let
arr
=
data
.
contentObj
.
picArr
.
list
;
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
let
ar
=
arr
[
i
];
let
ar
=
arr
[
i
];
let
obj
=
{};
let
obj
=
{};
...
@@ -33,6 +37,12 @@ class GameManager {
...
@@ -33,6 +37,12 @@ class GameManager {
}
}
console
.
log
(
this
.
_list
);
//原始数据转为数组
console
.
log
(
this
.
_list
);
//原始数据转为数组
}
}
get
cat
()
{
return
this
.
_cat
;
}
get
tryagain
()
{
return
this
.
_tryagain
;
}
setState
(
num
)
{
setState
(
num
)
{
this
.
_state
=
num
;
this
.
_state
=
num
;
}
}
...
...
assets/OP05/script/defaultData.js
View file @
531fc82d
...
@@ -3,7 +3,10 @@ export const defaultData = {
...
@@ -3,7 +3,10 @@ export const defaultData = {
{
{
"
picArr
"
:
{
"
picArr
"
:
{
"
cat
"
:
{
"
cat
"
:
{
"
start
"
:
"
http://staging-teach.cdn.ireadabc.com/c3db5ac421ef039cf540edfa5116c831.mp3
"
,
"
record
"
:
"
http://staging-teach.cdn.ireadabc.com/2db9fa7c28a11fdbcecfa6a5b5e62319.mp3
"
,
"
wait
"
:
"
http://staging-teach.cdn.ireadabc.com/aaeb274c49f400c26b05583d481aca09.mp3
"
,
"
finish
"
:
"
http://staging-teach.cdn.ireadabc.com/f1ce89b2162d82214369265e47d3dda3.mp3
"
"
start
"
:
"
http://staging-teach.cdn.ireadabc.com/c3db5ac421ef039cf540edfa5116c831.mp3
"
,
"
record
"
:
"
http://staging-teach.cdn.ireadabc.com/2db9fa7c28a11fdbcecfa6a5b5e62319.mp3
"
,
"
wait
"
:
"
http://staging-teach.cdn.ireadabc.com/aaeb274c49f400c26b05583d481aca09.mp3
"
,
"
finish
"
:
"
http://staging-teach.cdn.ireadabc.com/f1ce89b2162d82214369265e47d3dda3.mp3
"
},
},
"
tryagain
"
:
{
"
tryagain
"
:
{
"
one
"
:
"
http://staging-teach.cdn.ireadabc.com/bdc09d9eb89b73e67357b502ae2158dd.mp3
"
,
"
two
"
:
"
http://staging-teach.cdn.ireadabc.com/aaeb274c49f400c26b05583d481aca09.mp3
"
,
"
three
"
:
"
http://staging-teach.cdn.ireadabc.com/301ec5c708d22928ccf2162215f429fe.mp3
"
"
one
"
:
"
http://staging-teach.cdn.ireadabc.com/bdc09d9eb89b73e67357b502ae2158dd.mp3
"
,
"
two
"
:
"
http://staging-teach.cdn.ireadabc.com/aaeb274c49f400c26b05583d481aca09.mp3
"
,
"
three
"
:
"
http://staging-teach.cdn.ireadabc.com/301ec5c708d22928ccf2162215f429fe.mp3
"
...
...
assets/OP05/textures/read/btn_replay.png
View replaced file @
b9237bac
View file @
531fc82d
20 KB
|
W:
|
H:
14.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/OP05/textures/read/btn_replay.png.meta
View file @
531fc82d
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"premultiplyAlpha": false,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width":
244
,
"width":
176
,
"height": 2
32
,
"height": 2
06
,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"btn_replay": {
"btn_replay": {
...
@@ -22,10 +22,10 @@
...
@@ -22,10 +22,10 @@
"offsetY": 0,
"offsetY": 0,
"trimX": 0,
"trimX": 0,
"trimY": 0,
"trimY": 0,
"width":
244
,
"width":
176
,
"height": 2
32
,
"height": 2
06
,
"rawWidth":
244
,
"rawWidth":
176
,
"rawHeight": 2
32
,
"rawHeight": 2
06
,
"borderTop": 0,
"borderTop": 0,
"borderBottom": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderLeft": 0,
...
...
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