Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbox_tracingLetters
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
Sbox_tracingLetters
Commits
9e54c779
Commit
9e54c779
authored
Feb 03, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change request
parent
f995a9b7
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
628 additions
and
184 deletions
+628
-184
form.component.html
form/src/app/form/form.component.html
+2
-2
good_job.mp3
play/assets/tmpGame/audios/good_job.mp3
+0
-0
good_job.mp3.meta
play/assets/tmpGame/audios/good_job.mp3.meta
+7
-0
n_xuan1.fire
play/assets/tmpGame/scene/n_xuan1.fire
+504
-165
n_xuan1.js
play/assets/tmpGame/scene/n_xuan1.js
+110
-16
MusicNode.js
play/assets/tmpGame/script/MusicNode.js
+4
-0
defaultData.js
play/assets/tmpGame/script/defaultData.js
+1
-1
No files found.
form/src/app/form/form.component.html
View file @
9e54c779
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
<br>
<br>
</div>
</div>
<div
class=
"border"
style=
"float: left; width: 350px;"
>
<
!-- <
div class="border" style="float: left; width: 350px;">
<span style="height: 30px; font-size: 18px;">可选小写字母(点击下方字母选择):</span>
<span style="height: 30px; font-size: 18px;">可选小写字母(点击下方字母选择):</span>
<br>
<br>
<a (click)="addLetter('a')" style="font-size: 50px;">a </a>
<a (click)="addLetter('a')" style="font-size: 50px;">a </a>
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
<a (click)="addLetter('z')" style="font-size: 50px;">z </a>
<a (click)="addLetter('z')" style="font-size: 50px;">z </a>
<br>
<br>
</div>
</div>
</div>
</div>
-->
<!-- <div class="border" style=" width: 520px; height: 120px;">
<!-- <div class="border" style=" width: 520px; height: 120px;">
<span style="height: 30px; font-size: 18px;">单词音频:</span>
<span style="height: 30px; font-size: 18px;">单词音频:</span>
...
...
play/assets/tmpGame/audios/good_job.mp3
0 → 100644
View file @
9e54c779
File added
play/assets/tmpGame/audios/good_job.mp3.meta
0 → 100644
View file @
9e54c779
{
"ver": "2.0.1",
"uuid": "a8b712a7-104b-465b-a29f-9ee7ee0fd1ec",
"downloadMode": 0,
"duration": 1.044898,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/scene/n_xuan1.fire
View file @
9e54c779
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/scene/n_xuan1.js
View file @
9e54c779
...
@@ -282,6 +282,8 @@ cc.Class({
...
@@ -282,6 +282,8 @@ cc.Class({
this
.
_lastDrawPos
=
-
1
;
this
.
_lastDrawPos
=
-
1
;
this
.
_lastMainBg
=
1
;
this
.
_lastMainBg
=
1
;
this
.
_enableRestart
=
true
;
this
.
_enableRestart
=
true
;
this
.
doneFlag
=
[
false
,
false
];
this
.
currentCase
=
0
;
},
},
start
()
{
start
()
{
...
@@ -347,11 +349,14 @@ cc.Class({
...
@@ -347,11 +349,14 @@ cc.Class({
const
pictureWordSmallBg
=
cc
.
find
(
'
Canvas/LetterPicturePage/PictureWordSmallBg
'
);
const
pictureWordSmallBg
=
cc
.
find
(
'
Canvas/LetterPicturePage/PictureWordSmallBg
'
);
const
pictureWordBigBg
=
cc
.
find
(
'
Canvas/LetterPicturePage/PictureWordBigBg
'
);
const
pictureWordBigBg
=
cc
.
find
(
'
Canvas/LetterPicturePage/PictureWordBigBg
'
);
const
btn_restart
=
cc
.
find
(
'
Canvas/buttons/btn_restart
'
);
const
btn_restart
=
cc
.
find
(
'
Canvas/buttons/btn_restart
'
);
const
switch_b2s
=
cc
.
find
(
'
Canvas/buttons/switch_b2s
'
);
const
switch_s2b
=
cc
.
find
(
'
Canvas/buttons/switch_s2b
'
);
console
.
log
(
switch_b2s
,
switch_s2b
)
this
.
repositionButton
();
this
.
repositionButton
();
let
that
=
this
let
that
=
this
cc
.
view
.
setResizeCallback
(
function
()
{
cc
.
view
.
setResizeCallback
(
function
()
{
// console.log("sizeChange");
that
.
repositionButton
();
that
.
repositionButton
();
});
});
...
@@ -364,7 +369,12 @@ cc.Class({
...
@@ -364,7 +369,12 @@ cc.Class({
await
jelly
(
btn_restart
);
await
jelly
(
btn_restart
);
btn_restart
.
active
=
false
;
btn_restart
.
active
=
false
;
this
.
pageFlyOut
();
this
.
pageFlyOut
();
this
.
restartGame
();
// this.restartGame();
if
(
this
.
sharkNode
)
{
this
.
sharkNode
.
parent
=
null
;
this
.
sharkNode
=
null
;
}
this
.
createLetterPage
(
this
.
letter
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
btn_restart
.
active
=
true
;
btn_restart
.
active
=
true
;
this
.
_enableRestart
=
true
;;
this
.
_enableRestart
=
true
;;
...
@@ -388,6 +398,49 @@ cc.Class({
...
@@ -388,6 +398,49 @@ cc.Class({
pictureWordSmallBg
.
active
=
!
pictureWordSmallBg
.
active
;
pictureWordSmallBg
.
active
=
!
pictureWordSmallBg
.
active
;
});
});
switch_b2s
.
on
(
'
click
'
,
()
=>
{
console
.
log
(
"
switch_b2s click
"
)
// this.playEffect(`letter${this.letter.toUpperCase()}`);
cc
.
tween
(
switch_b2s
)
.
call
(()
=>
{
this
.
letter
=
this
.
letter
.
toLowerCase
();
this
.
pageFlyOut
();
if
(
this
.
sharkNode
)
{
this
.
sharkNode
.
parent
=
null
;
this
.
sharkNode
=
null
;
}
this
.
createLetterPage
(
this
.
letter
);
this
.
currentCase
=
1
;
switch_b2s
.
active
=
false
;
switch_s2b
.
active
=
true
;
})
.
to
(
0.1
,
{
angle
:
5
})
.
to
(
0.1
,
{
angle
:
-
5
})
.
to
(
0.1
,
{
angle
:
0
})
.
start
();
});
switch_s2b
.
on
(
'
click
'
,
()
=>
{
console
.
log
(
"
switch_s2b click
"
)
// this.playEffect(`letter${this.letter.toUpperCase()}`);
cc
.
tween
(
switch_s2b
)
.
call
(()
=>
{
this
.
letter
=
this
.
letter
.
toUpperCase
();
this
.
pageFlyOut
();
if
(
this
.
sharkNode
)
{
this
.
sharkNode
.
parent
=
null
;
this
.
sharkNode
=
null
;
}
this
.
createLetterPage
(
this
.
letter
);
this
.
currentCase
=
0
;
switch_b2s
.
active
=
true
;
switch_s2b
.
active
=
false
;
})
.
to
(
0.1
,
{
angle
:
5
})
.
to
(
0.1
,
{
angle
:
-
5
})
.
to
(
0.1
,
{
angle
:
0
})
.
start
();
});
smallLetterBase
.
on
(
'
click
'
,
()
=>
{
smallLetterBase
.
on
(
'
click
'
,
()
=>
{
this
.
playEffect
(
`letter
${
this
.
letter
.
toUpperCase
()}
`
);
this
.
playEffect
(
`letter
${
this
.
letter
.
toUpperCase
()}
`
);
cc
.
tween
(
smallLetterBase
)
cc
.
tween
(
smallLetterBase
)
...
@@ -420,20 +473,31 @@ cc.Class({
...
@@ -420,20 +473,31 @@ cc.Class({
btnNext
.
active
=
false
;
btnNext
.
active
=
false
;
btnBefore
.
on
(
'
click
'
,
async
()
=>
{
btnBefore
.
on
(
'
click
'
,
async
()
=>
{
console
.
log
(
"
btnBefore click
"
)
if
(
btnClicked
)
{
if
(
btnClicked
)
{
return
;
return
;
}
}
btnClicked
=
true
;
btnClicked
=
true
;
this
.
playEffect
(
'
按钮
'
);
this
.
playEffect
(
'
按钮
'
);
await
jelly
(
btnBefore
);
await
jelly
(
btnBefore
);
this
.
_status
.
currentLetterIdx
--
;
this
.
_status
.
currentLetterIdx
--
;
this
.
_status
.
currentLetterIdx
=
Math
.
max
(
this
.
_status
.
currentLetterIdx
,
0
);
this
.
_status
.
currentLetterIdx
=
Math
.
max
(
this
.
_status
.
currentLetterIdx
,
0
);
this
.
letter
=
this
.
data
.
letterList
[
this
.
_status
.
currentLetterIdx
];
this
.
updateLetter
();
if
(
this
.
sharkNode
)
{
this
.
sharkNode
.
parent
=
null
;
this
.
sharkNode
=
null
;
}
this
.
pageFlyOut
();
this
.
createLetterPage
(
this
.
letter
);
this
.
checkButton
();
this
.
currentCase
=
0
;
switch_b2s
.
active
=
true
;
switch_s2b
.
active
=
false
;
btnClicked
=
false
;
btnClicked
=
false
;
});
});
btnNext
.
on
(
'
click
'
,
async
()
=>
{
btnNext
.
on
(
'
click
'
,
async
()
=>
{
console
.
log
(
"
btnNext click
"
)
if
(
btnClicked
)
{
if
(
btnClicked
)
{
return
;
return
;
}
}
...
@@ -444,18 +508,39 @@ cc.Class({
...
@@ -444,18 +508,39 @@ cc.Class({
this
.
_status
.
currentLetterIdx
++
;
this
.
_status
.
currentLetterIdx
++
;
this
.
_status
.
currentLetterIdx
=
Math
.
min
(
this
.
_status
.
currentLetterIdx
,
this
.
data
.
letterList
.
length
-
1
);
this
.
_status
.
currentLetterIdx
=
Math
.
min
(
this
.
_status
.
currentLetterIdx
,
this
.
data
.
letterList
.
length
-
1
);
this
.
updateLetter
();
this
.
letter
=
this
.
data
.
letterList
[
this
.
_status
.
currentLetterIdx
];
if
(
this
.
sharkNode
)
{
this
.
sharkNode
.
parent
=
null
;
this
.
sharkNode
=
null
;
}
this
.
pageFlyOut
();
this
.
createLetterPage
(
this
.
letter
);
this
.
checkButton
();
this
.
currentCase
=
0
;
switch_b2s
.
active
=
true
;
switch_s2b
.
active
=
false
;
btnClicked
=
false
;
btnClicked
=
false
;
});
});
// this.checkButton();
},
},
loadNextLetter
()
{
loadNextLetter
()
{
const
switch_b2s
=
cc
.
find
(
'
Canvas/buttons/switch_b2s
'
);
const
switch_s2b
=
cc
.
find
(
'
Canvas/buttons/switch_s2b
'
);
switch_b2s
.
active
=
true
;
switch_s2b
.
active
=
false
;
this
.
_status
.
currentLetterIdx
++
;
this
.
_status
.
currentLetterIdx
++
;
this
.
_status
.
currentLetterIdx
=
Math
.
min
(
this
.
_status
.
currentLetterIdx
,
this
.
data
.
letterList
.
length
-
1
);
this
.
_status
.
currentLetterIdx
=
Math
.
min
(
this
.
_status
.
currentLetterIdx
,
this
.
data
.
letterList
.
length
-
1
);
this
.
doneFlag
=
[
false
,
false
];
this
.
currentCase
=
0
;
this
.
updateLetter
();
this
.
updateLetter
();
this
.
checkButton
()
},
},
onLoadFinish
()
{
onLoadFinish
()
{
this
.
initListeners
();
this
.
initListeners
();
this
.
_status
=
{
this
.
_status
=
{
...
@@ -464,6 +549,7 @@ cc.Class({
...
@@ -464,6 +549,7 @@ cc.Class({
currentStrokeStageIdx
:
0
currentStrokeStageIdx
:
0
}
}
this
.
updateLetter
();
this
.
updateLetter
();
this
.
checkButton
();
},
},
restartGame
()
{
restartGame
()
{
...
@@ -959,7 +1045,7 @@ cc.Class({
...
@@ -959,7 +1045,7 @@ cc.Class({
})
})
.
start
();
.
start
();
},
},
async
showOver
()
{
async
showOver
()
{
let
btn_restart
=
cc
.
find
(
'
Canvas/buttons/btn_restart
'
);
let
btn_restart
=
cc
.
find
(
'
Canvas/buttons/btn_restart
'
);
btn_restart
.
active
=
false
;
btn_restart
.
active
=
false
;
...
@@ -971,14 +1057,21 @@ cc.Class({
...
@@ -971,14 +1057,21 @@ cc.Class({
},
5000
);
},
5000
);
this
.
hideShark
();
this
.
hideShark
();
this
.
playEffect
(
'
放大
'
);
//
this.playEffect('放大');
await
this
.
showCompleteStar
();
await
this
.
showCompleteStar
();
this
.
playEffect
(
`letter
${
this
.
letter
.
toUpperCase
()}
`
);
await
this
.
playEffect
(
"
GoodJob
"
);
// await this.showRibbons();
await
asyncDelay
(
0.5
)
if
(
this
.
_status
.
currentLetterIdx
!=
(
this
.
data
.
letterList
.
length
-
1
))
{
await
this
.
playEffect
(
`letter
${
this
.
letter
.
toUpperCase
()}
`
);
this
.
doneFlag
[
this
.
currentCase
]
=
true
;
if
(
this
.
doneFlag
[
0
]
&&
this
.
doneFlag
[
1
])
{
await
this
.
fireworks
()
await
this
.
fireworks
()
this
.
playEffect
(
'
撒花
'
);
this
.
playEffect
(
'
撒花
'
);
}
}
// await this.showRibbons();
// if(this._status.currentLetterIdx != (this.data.letterList.length-1)) {
// await this.fireworks()
// this.playEffect('撒花');
// }
await
this
.
showCloud
();
await
this
.
showCloud
();
// console.log(this._status.currentLetterIdx, this.data.letterList.length-1)
// console.log(this._status.currentLetterIdx, this.data.letterList.length-1)
// if (this.letter !== this.letter.toLowerCase()) {
// if (this.letter !== this.letter.toLowerCase()) {
...
@@ -991,10 +1084,11 @@ cc.Class({
...
@@ -991,10 +1084,11 @@ cc.Class({
// this.loadNextLetter()
// this.loadNextLetter()
// }
// }
// }
// }
if
(
this
.
_status
.
currentLetterIdx
!=
(
this
.
data
.
letterList
.
length
-
1
))
{
this
.
pageFlyOut
();
// if(this._status.currentLetterIdx != (this.data.letterList.length-1)) {
this
.
loadNextLetter
()
// this.pageFlyOut();
}
// this.loadNextLetter()
// }
},
},
async
showCompleteStar
()
{
async
showCompleteStar
()
{
...
...
play/assets/tmpGame/script/MusicNode.js
View file @
9e54c779
...
@@ -36,6 +36,10 @@ cc.Class({
...
@@ -36,6 +36,10 @@ cc.Class({
default
:
null
,
default
:
null
,
type
:
cc
.
AudioClip
type
:
cc
.
AudioClip
},
},
GoodJob
:
{
default
:
null
,
type
:
cc
.
AudioClip
},
撒花
:
{
撒花
:
{
default
:
null
,
default
:
null
,
type
:
cc
.
AudioClip
type
:
cc
.
AudioClip
...
...
play/assets/tmpGame/script/defaultData.js
View file @
9e54c779
module
.
exports
=
{
module
.
exports
=
{
letterList
:
[
"
A
"
,
"
a
"
,
"
B
"
,
"
C
"
,
"
d
"
]
letterList
:
[
"
A
"
,
"
B
"
,
"
C
"
]
}
}
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