Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy_write_word
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
hy_write_word
Commits
2fea06f1
Commit
2fea06f1
authored
Sep 19, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
1555d306
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
118 additions
and
5 deletions
+118
-5
hy_write_word.js
assets/hy_write_word/scene/hy_write_word.js
+118
-5
No files found.
assets/hy_write_word/scene/hy_write_word.js
View file @
2fea06f1
...
...
@@ -213,12 +213,12 @@ cc.Class({
this
.
initTopPart
();
this
.
initCurQues
();
this
.
showWord
();
this
.
showPic
();
this
.
initColorPen
();
// this.createLetterPage(this._status.currentLetter);
// // this.initTitle();
...
...
@@ -236,6 +236,11 @@ cc.Class({
},
startShow
()
{
this
.
showWord
();
this
.
showPic
();
},
initCurQues
()
{
this
.
curQues
=
this
.
wordArr
[
this
.
wordArrIndex
];
if
(
!
this
.
curQues
)
{
...
...
@@ -709,6 +714,7 @@ cc.Class({
if
(
!
this
.
data
.
npcAudio
)
{
this
.
img_npc_voice
.
active
=
false
;
this
.
startShow
();
}
else
{
...
...
@@ -716,7 +722,9 @@ cc.Class({
this
.
npcVoiceClick
();
})
this
.
npcVoiceClick
();
this
.
npcVoiceClick
(()
=>
{
this
.
startShow
();
});
}
...
...
@@ -726,7 +734,7 @@ cc.Class({
},
npcVoiceClick
()
{
npcVoiceClick
(
cb
=
null
)
{
const
picNode
=
cc
.
find
(
'
p1
'
,
this
.
img_npc_voice
);
const
animNode
=
cc
.
find
(
"
p2
"
,
this
.
img_npc_voice
);
...
...
@@ -741,6 +749,7 @@ cc.Class({
return
;
}
cb
&&
cb
();
// picNode.active = true;
// animNode.active = false;
// this.maskNode.active = false;
...
...
@@ -1238,7 +1247,8 @@ cc.Class({
onSharkTouchEnd
(
event
)
{
const
shark
=
event
.
target
;
this
.
checkOnEndPoint
(
shark
);
// this.checkOnEndPoint(shark);
this
.
checkNoPoint
(
shark
);
this
.
isCheckPlayMoveAudio
=
false
;
this
.
oldMoveLocaltion
=
false
;
...
...
@@ -1246,14 +1256,112 @@ cc.Class({
// const shark = event.target;
shark
.
lastPos
=
null
;
shark
.
startPos
=
null
;
this
.
curMoveLocation
=
null
;
// this._status._currentPointIdx = 0;
// this.updateCurrentGraph(true);
// this.moveSharkBack(event.target);
// this.showArrows();
},
checkNoPoint
(
shark
)
{
if
(
!
this
.
curMoveLocation
)
{
return
;
}
for
(
let
i
=
0
;
i
<
this
.
_arrowList
.
length
;
i
++
)
{
if
(
this
.
_arrowList
[
i
].
active
)
{
return
;
}
}
console
.
log
(
"
in checkOnEndPoint
"
)
const
pos
=
cc
.
v2
(
shark
.
x
,
shark
.
y
);
const
letter
=
this
.
_status
.
currentLetter
;
const
penIdx
=
this
.
_status
.
_currentPenIdx
;
const
pointIdx
=
this
.
_status
.
_currentPointIdx
;
if
(
!
letterData
[
letter
][
penIdx
])
{
return
;
}
this
.
_status
.
_currentPointIdx
++
;
if
(
this
.
_status
.
_currentPointIdx
>=
letterData
[
letter
][
penIdx
].
length
-
1
)
{
this
.
changeCurDrawNode
();
this
.
_status
.
_currentPointIdx
=
0
;
this
.
_status
.
_currentPenIdx
++
;
shark
.
lastPos
=
null
;
shark
.
startPos
=
null
;
// this.showFlower(shark);
if
(
this
.
_status
.
_currentPenIdx
<
letterData
[
letter
].
length
)
{
this
.
removeStar
();
this
.
createArrows
();
this
.
createStar
();
playAudio
(
this
.
line_end_Clip
);
}
else
{
this
.
removeStar
();
this
.
showOver
(
shark
);
this
.
playLetterAudio
(()
=>
{
this
.
showGold
(()
=>
{
if
(
this
.
isDestroy
)
{
return
;
}
this
.
changeNewLetter
();
});
})
}
this
.
curMoveLocation
=
null
;
this
.
updateCurrentPointIdx
(
shark
);
this
.
_status
.
_currentPointIdx
=
0
;
this
.
moveSharkBack
(
shark
);
}
this
.
updateArrows
(
shark
);
},
checkOnEndPoint
(
shark
)
{
if
(
!
this
.
curMoveLocation
)
{
return
;
}
console
.
log
(
"
in checkOnEndPoint
"
)
const
pos
=
cc
.
v2
(
shark
.
x
,
shark
.
y
);
const
letter
=
this
.
_status
.
currentLetter
;
...
...
@@ -1302,10 +1410,14 @@ cc.Class({
this
.
createStar
();
playAudio
(
this
.
line_end_Clip
);
}
else
{
this
.
oneLetterEnd
(
shark
);
}
this
.
curMoveLocation
=
null
;
// this.updateCurrentGraph(true);
...
...
@@ -1402,6 +1514,7 @@ cc.Class({
}
// this.updateCurrentGraph(true);
this
.
curMoveLocation
=
null
;
this
.
updateCurrentPointIdx
(
shark
);
...
...
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