Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP15
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
OP15
Commits
40cd4b23
Commit
40cd4b23
authored
Dec 23, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
f3bcc7bd
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
167 additions
and
513 deletions
+167
-513
form.component.html
form/src/app/form/form.component.html
+52
-3
cat.meta
play/assets/OP15/dragonBones/cat.meta
+12
-0
OP15.fire
play/assets/OP15/scene/OP15.fire
+9
-5
OP15.js
play/assets/OP15/scene/OP15.js
+93
-29
defaultData.js
play/assets/OP15/script/defaultData.js
+1
-476
No files found.
form/src/app/form/form.component.html
View file @
40cd4b23
...
@@ -2,10 +2,24 @@
...
@@ -2,10 +2,24 @@
<div
style=
"padding: 10px;"
>
<div
style=
"padding: 10px;"
>
<div
style=
"margin-top: 5px"
>
<div
style=
"margin-top: 5px"
>
<span>
开
头
音频:
</span>
<span>
开
始第1遍
音频:
</span>
<app-audio-recorder
<app-audio-recorder
[
audioUrl
]="
item
.
begin_audio
"
[
audioUrl
]="
item
.
begin_audio1
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
begin_audio
')"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
begin_audio1
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
开始第2遍音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
begin_audio2
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
begin_audio2
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
做题引导音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
guide_audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
guide_audio
')"
></app-audio-recorder>
></app-audio-recorder>
</div>
</div>
<div
style=
"margin-top: 5px"
>
<div
style=
"margin-top: 5px"
>
...
@@ -15,6 +29,41 @@
...
@@ -15,6 +29,41 @@
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
playing_audio
')"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
playing_audio
')"
></app-audio-recorder>
></app-audio-recorder>
</div>
</div>
<!-- <div style="margin-top: 5px">-->
<!-- <span>做题引导音频: </span>-->
<!-- <app-audio-recorder-->
<!-- [audioUrl]="item.guide_audio"-->
<!-- (audioUploaded)="onAudioUploadSuccess($event, 'guide_audio')"-->
<!-- ></app-audio-recorder>-->
<!-- </div>-->
<div
style=
"margin-top: 5px"
>
<span>
正确提示音:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
right_audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
right_audio
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
默认错误提示音:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
wrong_audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
wrong_audio
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
错误提示音频1:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
wrong_audio1
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
wrong_audio1
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
错误提示音频2:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
wrong_audio2
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
wrong_audio2
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<div
style=
"margin-top: 5px"
>
<span>
结尾音频:
</span>
<span>
结尾音频:
</span>
<app-audio-recorder
<app-audio-recorder
...
...
play/assets/OP15/dragonBones/cat.meta
0 → 100644
View file @
40cd4b23
{
"ver": "1.1.2",
"uuid": "7b142208-7ebf-4c01-894f-e214d8bc95c8",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
play/assets/OP15/scene/OP15.fire
View file @
40cd4b23
...
@@ -2169,22 +2169,26 @@
...
@@ -2169,22 +2169,26 @@
}
}
],
],
"_armatureName": "Armature",
"_armatureName": "Armature",
"_animationName": "",
"_animationName": "
enlarge
",
"_preCacheMode": 0,
"_preCacheMode": 0,
"_cacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": -1,
"premultipliedAlpha": false,
"premultipliedAlpha": false,
"_armatureKey": "
4d85228f-ec02-4cbe-a0d8-cc8628fe805d#146d0d76-3625-438b-a6c8-dbd27ca2af63
",
"_armatureKey": "
ff020f6d-a4b6-4baf-bcad-94ae605c2977#ac49bcc0-d84e-4dd4-a8e3-7d81d1885337
",
"_accTime": 0,
"_accTime": 0,
"_playCount": 0,
"_playCount": 0,
"_frameCache": null,
"_frameCache": null,
"_curFrame": null,
"_curFrame": null,
"_playing": false,
"_playing": false,
"_armatureCache": null,
"_armatureCache": null,
"_N$dragonAsset": null,
"_N$dragonAsset": {
"_N$dragonAtlasAsset": null,
"__uuid__": "ff020f6d-a4b6-4baf-bcad-94ae605c2977"
},
"_N$dragonAtlasAsset": {
"__uuid__": "ac49bcc0-d84e-4dd4-a8e3-7d81d1885337"
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex":
0
,
"_N$_animationIndex":
2
,
"_N$_defaultCacheMode": 0,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
...
...
play/assets/OP15/scene/OP15.js
View file @
40cd4b23
...
@@ -110,11 +110,14 @@ cc.Class({
...
@@ -110,11 +110,14 @@ cc.Class({
_hintsNodeList
:
null
,
_hintsNodeList
:
null
,
_figurePointRectArray
:
null
,
_figurePointRectArray
:
null
,
_allAnimationNodes
:
null
,
initSceneData
()
{
initSceneData
()
{
this
.
_imageResList
=
[];
this
.
_imageResList
=
[];
this
.
_audioResList
=
[];
this
.
_audioResList
=
[];
this
.
_animaResList
=
[];
this
.
_animaResList
=
[];
this
.
_allAnimationNodes
=
[];
this
.
_hintsNodeList
=
[];
this
.
_hintsNodeList
=
[];
this
.
_lastFingerPosition
=
{
this
.
_lastFingerPosition
=
{
pos
:
null
,
pos
:
null
,
...
@@ -208,12 +211,12 @@ cc.Class({
...
@@ -208,12 +211,12 @@ cc.Class({
src
:
(
context
,
event
)
=>
(
callback
,
onReceive
)
=>
{
src
:
(
context
,
event
)
=>
(
callback
,
onReceive
)
=>
{
console
.
log
(
'
[answer] thinking and playing
'
);
console
.
log
(
'
[answer] thinking and playing
'
);
//
This will send the 'INC' event to the parent
every second
//
check
every second
const
id
=
setInterval
(()
=>
{
const
id
=
setInterval
(()
=>
{
const
region
=
context
.
questions
[
context
.
questionIndex
];
const
region
=
context
.
questions
[
context
.
questionIndex
];
const
result
=
this
.
checkInRegion
(
region
.
rect
);
const
result
=
this
.
checkInRegion
(
region
.
rect
);
console
.
log
(
'
checkInRegion
'
,
JSON
.
stringify
(
this
.
_lastFingerPosition
),
JSON
.
stringify
(
region
.
rect
),
result
);
//
console.log('checkInRegion', JSON.stringify(this._lastFingerPosition), JSON.stringify(region.rect), result);
if
(
result
)
{
if
(
result
)
{
callback
(
'
RIGHT
'
)
callback
(
'
RIGHT
'
)
// playAudioByUrl(this.data.begin_audio, () => {
// playAudioByUrl(this.data.begin_audio, () => {
...
@@ -277,17 +280,27 @@ cc.Class({
...
@@ -277,17 +280,27 @@ cc.Class({
wrong
:{
wrong
:{
invoke
:
{
invoke
:
{
src
:
(
context
,
event
)
=>
{
src
:
(
context
,
event
)
=>
{
console
.
log
(
1111
)
this
.
_lastFingerPosition
.
pos
=
null
;
this
.
_lastFingerPosition
.
pos
=
null
;
this
.
_lastFingerPosition
.
dirty
=
false
;
this
.
_lastFingerPosition
.
dirty
=
false
;
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
'
answer wrong
'
,
context
.
questionPlayTimes
,
context
.
maxQuestionTryTimes
);
console
.
log
(
'
answer wrong
'
,
context
.
question
Index
,
context
.
question
PlayTimes
,
context
.
maxQuestionTryTimes
);
const
ddLogoCat
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
const
ddLogoCat
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
ddLogoCat
.
playAnimation
(
'
wrong
'
,
1
)
ddLogoCat
.
playAnimation
(
'
wrong
'
,
1
)
ddLogoCat
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
function
()
{
ddLogoCat
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
function
()
{
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
'
normal
'
,
0
)
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
'
normal
'
,
0
)
},
this
)
},
this
);
playAudioByUrl
(
this
.
wrongAudio
,
()
=>
{
let
wrongEffect
=
this
.
wrongAudio
;
// 第一和第二题的提示音
if
([
0
,
1
].
includes
(
context
.
questionIndex
))
{
wrongEffect
=
this
.
data
[
`wrong_audio
${
context
.
questionPlayTimes
}
`
]
}
else
{
// 非第一和第二题,并且做第二遍的提示音
if
(
context
.
questionPlayTimes
==
2
)
{
wrongEffect
=
this
.
data
[
`wrong_audio
${
context
.
questionPlayTimes
}
`
]
}
}
playAudioByUrl
(
wrongEffect
,
()
=>
{
if
(
context
.
questionPlayTimes
>=
context
.
maxQuestionTryTimes
)
{
if
(
context
.
questionPlayTimes
>=
context
.
maxQuestionTryTimes
)
{
const
an
=
context
.
questions
[
context
.
questionIndex
].
node
;
const
an
=
context
.
questions
[
context
.
questionIndex
].
node
;
an
.
active
=
true
;
an
.
active
=
true
;
...
@@ -298,7 +311,6 @@ cc.Class({
...
@@ -298,7 +311,6 @@ cc.Class({
}
else
{
}
else
{
resolve
()
resolve
()
}
}
})
})
});
});
},
},
...
@@ -312,9 +324,6 @@ cc.Class({
...
@@ -312,9 +324,6 @@ cc.Class({
}
}
}
}
},
},
}
}
}
}
const
QuestionsArrayStatus
=
{
const
QuestionsArrayStatus
=
{
...
@@ -322,7 +331,6 @@ cc.Class({
...
@@ -322,7 +331,6 @@ cc.Class({
initial
:
'
play
'
,
initial
:
'
play
'
,
states
:
{
states
:
{
play
:
{
play
:
{
...
QuestionState
...
QuestionState
},
},
next
:
{
next
:
{
...
@@ -356,10 +364,9 @@ cc.Class({
...
@@ -356,10 +364,9 @@ cc.Class({
},
},
states
:
{
states
:
{
begin
:
{
begin
:
{
invoke
:
{
invoke
:
{
src
:
(
ctx
)
=>
{
src
:
(
ctx
)
=>
{
console
.
log
(
'
game begin
'
);
console
.
log
(
'
game begin
1
'
);
if
(
window
.
courseware
&&
window
.
courseware
.
openOsmoFingerRead
)
{
if
(
window
.
courseware
&&
window
.
courseware
.
openOsmoFingerRead
)
{
this
.
isOpenedOsmoFingerRead
=
true
;
this
.
isOpenedOsmoFingerRead
=
true
;
window
.
courseware
.
openOsmoFingerRead
()
window
.
courseware
.
openOsmoFingerRead
()
...
@@ -367,15 +374,50 @@ cc.Class({
...
@@ -367,15 +374,50 @@ cc.Class({
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
'
begin
'
,
0
);
const
state
=
dragonDisplay
.
playAnimation
(
'
begin
'
,
0
);
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
playAudioByUrl
(
this
.
data
.
begin_audio
,
()
=>
{
playAudioByUrl
(
this
.
data
.
begin_audio
1
,
()
=>
{
console
.
log
(
'
game begin audio finish
'
);
console
.
log
(
'
game begin audio finish
'
);
resolve
()
resolve
()
})
})
});
});
},
},
onDone
:
'
begin2
'
,
onError
:
'
begin2
'
}
},
begin2
:
{
invoke
:
{
src
:
(
ctx
)
=>
{
console
.
log
(
'
game begin 2
'
);
for
(
let
i
=
0
;
i
<
this
.
_allAnimationNodes
.
length
;
i
++
)
{
const
t
=
this
.
_allAnimationNodes
[
i
];
const
dragonDisplay
=
t
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
normal
'
,
0
);
}
return
new
Promise
((
resolve
,
reject
)
=>
{
playAudioByUrl
(
this
.
data
.
begin_audio2
,
()
=>
{
resolve
()
})
});
},
onDone
:
'
guide
'
,
onError
:
'
guide
'
}
},
guide
:{
invoke
:
{
src
:
(
ctx
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
playAudioByUrl
(
this
.
data
.
guide_audio
,
()
=>
{
console
.
log
(
'
game guide audio finish
'
);
reject
()
})
});
},
onDone
:
'
playing
'
,
onDone
:
'
playing
'
,
onError
:
'
playing
'
onError
:
'
playing
'
}
},
},
},
playing
:
{
playing
:
{
entry
:
(
ctx
)
=>
{
entry
:
(
ctx
)
=>
{
...
@@ -401,9 +443,9 @@ cc.Class({
...
@@ -401,9 +443,9 @@ cc.Class({
},
},
end
:
{
end
:
{
entry
:
(
ctx
,
event
)
=>
{
entry
:
(
ctx
,
event
)
=>
{
console
.
log
(
'
game end
'
,
ctx
,
event
);
console
.
log
(
'
game end
'
);
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
'
end
'
,
0
);
const
state
=
dragonDisplay
.
playAnimation
(
'
finish
'
,
0
);
if
(
window
.
courseware
&&
window
.
courseware
.
closeOsmoFingerRead
)
{
if
(
window
.
courseware
&&
window
.
courseware
.
closeOsmoFingerRead
)
{
this
.
isOpenedOsmoFingerRead
=
false
;
this
.
isOpenedOsmoFingerRead
=
false
;
window
.
courseware
.
closeOsmoFingerRead
()
window
.
courseware
.
closeOsmoFingerRead
()
...
@@ -428,17 +470,26 @@ cc.Class({
...
@@ -428,17 +470,26 @@ cc.Class({
const
k
=
this
.
_hintsNodeList
[
i
].
after
;
const
k
=
this
.
_hintsNodeList
[
i
].
after
;
after
[
k
]
=
{
after
[
k
]
=
{
actions
:
()
=>
{
actions
:
()
=>
{
console
.
log
(
k
)
// this.playAni(i, 'normal')
// cc.tween(t).to(.8, {scale: .3}).to(.8, {scale: .25}).start();
const
dragonDisplay
=
t
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
dragonDisplay
=
t
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
enlarge
'
,
1
);
dragonDisplay
.
playAnimation
(
'
enlarge
'
,
1
);
console
.
log
(
dragonDisplay
.
_armatureKey
,
'
enlarge
'
)
dragonDisplay
.
addEventListener
(
dragonBones
.
EventObject
.
COMPLETE
,
(
event
)
=>
{
dragonDisplay
.
addEventListener
(
dragonBones
.
EventObject
.
COMPLETE
,
(
event
)
=>
{
//TODO 这里写触发事件
//
TODO 这里写触发事件
//event.name为事件名称
//
event.name为事件名称
event
.
armature
.
animation
.
play
(
'
normal
'
,
0
);
//
event.armature.animation.play('normal', 0);
console
.
log
(
event
.
animationState
.
name
)
// console.log(event.animationState.name, dragonDisplay._armatureKey, 'end'
)
},
this
);
},
this
);
// const dragonDisplay = t.getComponent(dragonBones.ArmatureDisplay);
// dragonDisplay.playAnimation('enlarge', 1);
// console.log(dragonDisplay._armatureKey, 'enlarge')
// dragonDisplay.addEventListener(dragonBones.EventObject.COMPLETE, (event) => {
// //TODO 这里写触发事件
// //event.name为事件名称
// event.armature.animation.play('normal', 0);
// console.log(event.animationState.name, dragonDisplay._armatureKey, 'end')
// }, this);
}
}
}
}
}
}
...
@@ -463,7 +514,7 @@ cc.Class({
...
@@ -463,7 +514,7 @@ cc.Class({
}
}
getData
((
data
)
=>
{
getData
((
data
)
=>
{
console
.
log
(
'
data:
'
,
data
);
//
console.log('data:', data);
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
...
@@ -549,8 +600,20 @@ cc.Class({
...
@@ -549,8 +600,20 @@ cc.Class({
addPreloadAudio
()
{
addPreloadAudio
()
{
this
.
_audioResList
.
push
({
url
:
this
.
data
.
begin_audio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
begin_audio1
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
begin_audio2
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
guide_audio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
playing_audio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
playing_audio
});
if
(
this
.
data
.
wrong_audio
)
{
this
.
_audioResList
.
push
({
url
:
this
.
data
.
wrong_audio
});
this
.
wrongAudio
=
this
.
data
.
wrong_audio
}
if
(
this
.
data
.
right_audio
)
{
this
.
_audioResList
.
push
({
url
:
this
.
data
.
right_audio
});
this
.
rightAudio
=
this
.
data
.
right_audio
}
this
.
_audioResList
.
push
({
url
:
this
.
data
.
wrong_audio1
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
wrong_audio2
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
end_audio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
end_audio
});
...
@@ -572,7 +635,7 @@ cc.Class({
...
@@ -572,7 +635,7 @@ cc.Class({
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
(
f
,
t
,
item
)
=>
{
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
(
f
,
t
,
item
)
=>
{
// console.log(f, t, item)
// console.log(f, t, item)
},
(
err
,
data
)
=>
{
},
(
err
,
data
)
=>
{
console
.
log
(
err
,
data
);
//
console.log(err, data);
const
ground
=
cc
.
find
(
`Canvas/frame-border/ground`
);
const
ground
=
cc
.
find
(
`Canvas/frame-border/ground`
);
const
groundBg
=
cc
.
find
(
`Canvas/frame-border/ground/bg`
);
const
groundBg
=
cc
.
find
(
`Canvas/frame-border/ground/bg`
);
groundBg
.
active
=
false
;
groundBg
.
active
=
false
;
...
@@ -617,7 +680,8 @@ cc.Class({
...
@@ -617,7 +680,8 @@ cc.Class({
n
.
width
=
width
;
n
.
width
=
width
;
n
.
height
=
height
;
n
.
height
=
height
;
n
.
active
=
true
;
n
.
active
=
true
;
db
.
playAnimation
(
'
normal
'
,
0
);
db
.
playAnimation
(
'
null
'
,
0
);
this
.
_allAnimationNodes
.
push
(
n
);
finishDbCount
++
;
finishDbCount
++
;
console
.
log
(
finishDbCount
,
dbCount
)
console
.
log
(
finishDbCount
,
dbCount
)
if
(
finishDbCount
==
dbCount
)
{
if
(
finishDbCount
==
dbCount
)
{
...
...
play/assets/OP15/script/defaultData.js
View file @
40cd4b23
This diff is collapsed.
Click to expand it.
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