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
d701a351
Commit
d701a351
authored
3 years ago
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
22
parent
e7ba62fb
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
775 additions
and
71 deletions
+775
-71
OP15.fire
play/assets/OP15/scene/OP15.fire
+246
-63
OP15.js
play/assets/OP15/scene/OP15.js
+53
-7
defaultData.js
play/assets/OP15/script/defaultData.js
+476
-1
No files found.
play/assets/OP15/scene/OP15.fire
View file @
d701a351
This diff is collapsed.
Click to expand it.
play/assets/OP15/scene/OP15.js
View file @
d701a351
...
...
@@ -69,6 +69,10 @@ cc.Class({
default
:
null
,
type
:
cc
.
AudioClip
,
},
logoCat
:
{
default
:
null
,
type
:
cc
.
Node
}
},
...
...
@@ -80,6 +84,11 @@ cc.Class({
var
dragonDisplay
=
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
name
,
times
);
// dragonDisplay.addEventListener(dragonBones.EventObject.COMPLETE, (event) => {
// //TODO 这里写触发事件
// //event.name为事件名称
// console.log(event.name)
// }, this);
// animationDisplay.addEventListener(dragonBones.EventObject.COMPLETE, completeCallback);
return
state
;
},
...
...
@@ -240,6 +249,12 @@ cc.Class({
an
.
active
=
true
;
const
dragonDisplay
=
an
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
normal
'
,
0
);
const
ddLogoCat
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
ddLogoCat
.
playAnimation
(
'
right
'
,
1
)
ddLogoCat
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
function
()
{
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
'
normal
'
,
0
)
},
this
)
playAudioByUrl
(
this
.
rightAudio
,
()
=>
{
resolve
()
})
...
...
@@ -263,6 +278,11 @@ cc.Class({
this
.
_lastFingerPosition
.
dirty
=
false
;
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
'
answer wrong
'
,
context
.
questionPlayTimes
,
context
.
maxQuestionTryTimes
);
const
ddLogoCat
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
ddLogoCat
.
playAnimation
(
'
wrong
'
,
1
)
ddLogoCat
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
function
()
{
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
'
normal
'
,
0
)
},
this
)
playAudioByUrl
(
this
.
wrongAudio
,
()
=>
{
if
(
context
.
questionPlayTimes
>=
context
.
maxQuestionTryTimes
)
{
const
an
=
context
.
questions
[
context
.
questionIndex
].
node
;
...
...
@@ -339,6 +359,8 @@ cc.Class({
if
(
window
.
courseware
&&
window
.
courseware
.
openOsmoFingerRead
)
{
window
.
courseware
.
openOsmoFingerRead
()
}
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
'
begin
'
,
0
);
return
new
Promise
((
resolve
,
reject
)
=>
{
playAudioByUrl
(
this
.
data
.
begin_audio
,
()
=>
{
console
.
log
(
'
game begin audio finish
'
);
...
...
@@ -353,6 +375,8 @@ cc.Class({
playing
:
{
entry
:
(
ctx
)
=>
{
console
.
log
(
'
entry play stage
'
);
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
'
normal
'
,
0
);
cc
.
assetManager
.
loadRemote
(
this
.
data
.
playing_audio
,
(
err
,
audioClip
)
=>
{
cc
.
audioEngine
.
playMusic
(
audioClip
,
true
,
0.8
);
});
...
...
@@ -371,9 +395,10 @@ cc.Class({
...
QuestionsArrayStatus
},
end
:
{
entry
:
(
ctx
,
event
)
=>
{
console
.
log
(
'
game end
'
,
ctx
,
event
);
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
'
end
'
,
0
);
if
(
window
.
courseware
&&
window
.
courseware
.
closeOsmoFingerRead
)
{
window
.
courseware
.
closeOsmoFingerRead
()
}
...
...
@@ -402,6 +427,12 @@ cc.Class({
// cc.tween(t).to(.8, {scale: .3}).to(.8, {scale: .25}).start();
const
dragonDisplay
=
t
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
enlarge
'
,
1
);
dragonDisplay
.
addEventListener
(
dragonBones
.
EventObject
.
COMPLETE
,
(
event
)
=>
{
//TODO 这里写触发事件
//event.name为事件名称
event
.
armature
.
animation
.
play
(
'
normal
'
,
0
);
console
.
log
(
event
.
animationState
.
name
)
},
this
);
}
}
}
...
...
@@ -537,19 +568,28 @@ cc.Class({
},
(
err
,
data
)
=>
{
console
.
log
(
err
,
data
);
const
ground
=
cc
.
find
(
`Canvas/frame-border/ground`
);
const
groundBg
=
cc
.
find
(
`Canvas/frame-border/ground/bg`
);
groundBg
.
active
=
false
;
const
baseRect
=
this
.
data
.
bgItem
.
rect
;
getSpriteFrimeByUrl
(
this
.
data
.
bgItem
.
url
,
(
sf
)
=>
{
const
gs
=
ground
.
getComponent
(
cc
.
Sprite
);
const
gs
=
ground
Bg
.
getComponent
(
cc
.
Sprite
);
gs
.
spriteFrame
=
sf
;
groundBg
.
active
=
true
;
});
let
dbCount
=
0
;
let
finishDbCount
=
0
for
(
const
block
of
this
.
data
.
hotZoneItemArr
)
{
if
(
block
.
gIdx
==
'
0
'
||
block
.
gIdx
==
'
1
'
)
{
dbCount
++
;
}
}
for
(
const
block
of
this
.
data
.
hotZoneItemArr
)
{
if
(
block
.
gIdx
==
'
2
'
)
{
const
s1
=
((
ground
.
width
/
block
.
imgSizeW
)
+
(
ground
.
height
/
block
.
imgSizeH
))
/
2
const
node
=
new
cc
.
Node
();
node
.
parent
=
ground
;
node
.
parent
=
ground
Bg
;
const
spr
=
node
.
addComponent
(
cc
.
Sprite
);
getSpriteFrimeByUrl
(
block
.
pic_url
,
(
sf
)
=>
{
spr
.
spriteFrame
=
sf
;
...
...
@@ -561,7 +601,8 @@ cc.Class({
const
n
=
new
cc
.
Node
();
n
.
scale
=
0.25
;
const
db
=
n
.
addComponent
(
dragonBones
.
ArmatureDisplay
);
n
.
parent
=
ground
;
n
.
active
=
false
;
loadDragonBones
(
db
,
{
tex
:
block
.
texPngData
.
url
,
atlas
:
block
.
texJsonData
.
url
,
...
...
@@ -569,8 +610,13 @@ cc.Class({
}).
then
(({
width
,
height
})
=>
{
n
.
width
=
width
;
n
.
height
=
height
;
n
.
parent
=
ground
;
n
.
active
=
true
;
db
.
playAnimation
(
'
normal
'
,
0
);
finishDbCount
++
;
console
.
log
(
finishDbCount
,
dbCount
)
if
(
finishDbCount
==
dbCount
)
{
this
.
loadEnd
();
}
});
if
(
block
.
gIdx
==
'
0
'
)
{
const
rectInfo
=
{
...
...
@@ -600,7 +646,7 @@ cc.Class({
// console.log(this.data);
console
.
log
(
'
resource perload finish
'
);
this
.
loadEnd
();
if
(
window
&&
window
[
"
air
"
]
&&
window
[
"
air
"
].
hideAirClassLoading
)
{
window
[
"
air
"
].
hideAirClassLoading
();
}
...
...
This diff is collapsed.
Click to expand it.
play/assets/OP15/script/defaultData.js
View file @
d701a351
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