Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy08_caici
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
hy08_caici
Commits
b1dd2c8f
Commit
b1dd2c8f
authored
Jun 24, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
待声音接口确认后再进行api添加
parent
885ee0df
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1405 additions
and
551 deletions
+1405
-551
hy06_danxuan.fire
assets/hy06_danxuan/scene/hy06_danxuan.fire
+1296
-545
hy06_danxuan.ts
assets/hy06_danxuan/scene/hy06_danxuan.ts
+97
-5
pg_hy06_danxuan.ts
assets/hy06_danxuan/scene/pg_hy06_danxuan.ts
+12
-1
please5speak.mp3
assets/hy06_danxuan/textures/hy08/audio/please5speak.mp3
+0
-0
please5speak.mp3.meta
...ts/hy06_danxuan/textures/hy08/audio/please5speak.mp3.meta
+0
-0
readyGo.mp3
assets/hy06_danxuan/textures/hy08/audio/readyGo.mp3
+0
-0
readyGo.mp3.meta
assets/hy06_danxuan/textures/hy08/audio/readyGo.mp3.meta
+0
-0
right.mp3
assets/hy06_danxuan/textures/hy08/audio/right.mp3
+0
-0
right.mp3.meta
assets/hy06_danxuan/textures/hy08/audio/right.mp3.meta
+0
-0
showCard.mp3
assets/hy06_danxuan/textures/hy08/audio/showCard.mp3
+0
-0
showCard.mp3.meta
assets/hy06_danxuan/textures/hy08/audio/showCard.mp3.meta
+0
-0
start2Tiger.mp3
assets/hy06_danxuan/textures/hy08/audio/start2Tiger.mp3
+0
-0
start2Tiger.mp3.meta
assets/hy06_danxuan/textures/hy08/audio/start2Tiger.mp3.meta
+0
-0
No files found.
assets/hy06_danxuan/scene/hy06_danxuan.fire
View file @
b1dd2c8f
This diff is collapsed.
Click to expand it.
assets/hy06_danxuan/scene/hy06_danxuan.ts
View file @
b1dd2c8f
...
@@ -4,6 +4,8 @@ import pg from "./pg_hy06_danxuan";
...
@@ -4,6 +4,8 @@ import pg from "./pg_hy06_danxuan";
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
let
win
:
any
=
window
;
let
courseware
=
win
.
courseware
;
@
ccclass
@
ccclass
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
...
@@ -51,16 +53,110 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -51,16 +53,110 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
right
:
number
private
right
:
number
//进度条成都
//进度条成都
private
lengthProgress
:
number
private
lengthProgress
:
number
private
layer_game
:
cc
.
Node
;
private
layout_begin
:
cc
.
Node
;
initView
()
{
initView
()
{
// 取对象
// 取对象
/* this.topQuestion = pg.view.find(this, 'topQuestion'); */
/* this.topQuestion = pg.view.find(this, 'topQuestion'); */
this
.
layer_game
=
pg
.
view
.
find
(
this
,
'
layer_game
'
);
this
.
layout_begin
=
pg
.
view
.
find
(
this
.
layer_game
,
'
layout_begin
'
);
}
}
initListener
()
{
initListener
()
{
//增加图片答案对象点击事件
//增加图片答案对象点击事件
}
async
initGame
()
{
await
this
.
showBegin
()
this
.
hideBegin
();
this
.
nextQuestion
();
}
showCamera
()
{
// cw.openRecognitionCamera({
// x: 0,
// y: 0,
// width: 1,
// height: 1,
// })
}
startRecord
()
{
courseware
&&
courseware
.
startTest
(
''
);
//开始录音
}
endRecord
()
{
let
testData
=
{
"
dtLastResponse
"
:
"
2021-09-17 13:36:26:109
"
,
"
refText
"
:
"
I haven't found anything out about him yet.
"
,
"
recordId
"
:
"
6144295213f0a2200000ed93
"
,
"
eof
"
:
1
,
"
result
"
:
{
"
pronunciation
"
:
25
,
"
resource_version
"
:
"
3.1.0
"
,
"
fluency
"
:
60
,
"
rhythm
"
:
90
,
"
kernel_version
"
:
"
5.2.4
"
,
"
overall
"
:
25
,
//75
"
integrity
"
:
100
,
"
duration
"
:
"
6.779
"
,
"
rear_tone
"
:
"
fall
"
,
"
speed
"
:
96
,
},
"
tokenId
"
:
"
6144295408558b08dd000001
"
,
"
applicationId
"
:
"
154838659000009e
"
}
if
(
!
courseware
)
return
this
.
recrodEnd
(
testData
)
courseware
&&
courseware
.
stopTest
((
data
)
=>
{
data
=
JSON
.
parse
(
data
);
this
.
recrodEnd
(
data
);
});
//结束录音
}
}
recrodEnd
(
data
)
{
let
score
=
data
.
result
.
overall
;
initGame
()
{
}
//----------------------Ready Go------------------------------------
showBegin
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
layout_begin
.
active
=
true
;
let
bottom
=
pg
.
view
.
find
(
this
.
layout_begin
,
'
layout_bottom/bottom
'
);
let
ready
=
pg
.
view
.
find
(
this
.
layout_begin
,
'
layout_middle/ready
'
);
let
go
=
pg
.
view
.
find
(
this
.
layout_begin
,
'
layout_middle/go
'
);
// ready go
ready
.
y
=
2000
;
go
.
y
=
2000
;
this
.
aniBottomEnter
().
then
(()
=>
{
pg
.
hw
.
playAudio
(
'
readyGo
'
,
false
,
()
=>
{
});
cc
.
tween
(
ready
).
to
(
1
,
{
y
:
-
20
}).
to
(
0.2
,
{
y
:
0
}).
delay
(
1
).
call
(()
=>
{
ready
.
active
=
false
;
}).
start
();
cc
.
tween
(
go
).
delay
(
1
).
to
(
1
,
{
y
:
-
20
}).
to
(
0.2
,
{
y
:
0
}).
delay
(
0.5
).
call
(()
=>
{
go
.
active
=
false
;
resolve
(
''
);
}).
start
();
})
});
}
hideBegin
()
{
this
.
layout_begin
.
active
=
false
;
}
aniBottomEnter
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
bottom
=
pg
.
view
.
find
(
this
.
layout_begin
,
'
layout_bottom/bottom
'
);
const
bottomOrgPos
=
cc
.
v2
(
0
,
-
736
);
bottom
.
active
=
true
;
bottom
.
y
=
bottomOrgPos
.
y
-
bottom
.
height
;
cc
.
tween
(
bottom
).
to
(
1
,
{
y
:
bottomOrgPos
.
y
}).
start
();
pg
.
hw
.
playAudio
(
'
please5speak
'
,
false
,
()
=>
{
resolve
(
''
);
});
});
}
//----------------------Question------------------------------------
nextQuestion
()
{
// 游戏所需的初始化数据
this
.
currentId
=
0
this
.
currentId
=
0
this
.
time
=
this
.
data
.
options
.
length
*
5
this
.
time
=
this
.
data
.
options
.
length
*
5
console
.
log
(
this
.
time
,
'
456
'
)
console
.
log
(
this
.
time
,
'
456
'
)
...
@@ -68,12 +164,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -68,12 +164,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
countdownTime
=
"
60.00
"
this
.
countdownTime
=
"
60.00
"
this
.
lengthProgress
=
0
this
.
lengthProgress
=
0
this
.
right
=
0
this
.
right
=
0
this
.
question
()
}
question
()
{
//预加载第一题
//预加载第一题
this
.
firstOptions
()
this
.
firstOptions
()
//题目数分配
//题目数分配
this
.
questionNuber
()
this
.
questionNuber
()
}
}
...
...
assets/hy06_danxuan/scene/pg_hy06_danxuan.ts
View file @
b1dd2c8f
...
@@ -674,7 +674,18 @@ let pg = {
...
@@ -674,7 +674,18 @@ let pg = {
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
loop
);
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
loop
);
resolve
(
id
);
resolve
(
id
);
})
})
}
},
playAudio
(
audioName
,
loop
=
false
,
cb
)
{
console
.
log
(
"
play audio->
"
+
audioName
);
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
return
new
Promise
((
resolve
,
reject
)
=>
{
const
audioId
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
loop
);
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
cb
&&
cb
();
});
resolve
(
audioId
);
})
},
},
},
signal
:
{
signal
:
{
createSignal
():
Signal
{
createSignal
():
Signal
{
...
...
assets/hy06_danxuan/textures/hy08/audio/
请在5秒内说出正确答案
.mp3
→
assets/hy06_danxuan/textures/hy08/audio/
please5speak
.mp3
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/
请在5秒内说出正确答案
.mp3.meta
→
assets/hy06_danxuan/textures/hy08/audio/
please5speak
.mp3.meta
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/ready
g
o.mp3
→
assets/hy06_danxuan/textures/hy08/audio/ready
G
o.mp3
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/ready
g
o.mp3.meta
→
assets/hy06_danxuan/textures/hy08/audio/ready
G
o.mp3.meta
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/
正确
.mp3
→
assets/hy06_danxuan/textures/hy08/audio/
right
.mp3
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/
正确
.mp3.meta
→
assets/hy06_danxuan/textures/hy08/audio/
right
.mp3.meta
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/
图片卡片出现
.mp3
→
assets/hy06_danxuan/textures/hy08/audio/
showCard
.mp3
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/
图片卡片出现
.mp3.meta
→
assets/hy06_danxuan/textures/hy08/audio/
showCard
.mp3.meta
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/
星星变虎头
.mp3
→
assets/hy06_danxuan/textures/hy08/audio/
start2Tiger
.mp3
View file @
b1dd2c8f
File moved
assets/hy06_danxuan/textures/hy08/audio/
星星变虎头
.mp3.meta
→
assets/hy06_danxuan/textures/hy08/audio/
start2Tiger
.mp3.meta
View file @
b1dd2c8f
File moved
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