Commit 9e54c779 authored by 李维's avatar 李维

Change request

parent f995a9b7
......@@ -83,7 +83,7 @@
<br>
</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>
<br>
<a (click)="addLetter('a')" style="font-size: 50px;">a&nbsp;</a>
......@@ -119,7 +119,7 @@
<a (click)="addLetter('z')" style="font-size: 50px;">z&nbsp;</a>
<br>
</div>
</div>
</div> -->
<!-- <div class="border" style=" width: 520px; height: 120px;">
<span style="height: 30px; font-size: 18px;">单词音频:</span>
......
{
"ver": "2.0.1",
"uuid": "a8b712a7-104b-465b-a29f-9ee7ee0fd1ec",
"downloadMode": 0,
"duration": 1.044898,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
......@@ -282,6 +282,8 @@ cc.Class({
this._lastDrawPos = -1;
this._lastMainBg = 1;
this._enableRestart = true;
this.doneFlag = [false, false];
this.currentCase = 0;
},
start() {
......@@ -347,11 +349,14 @@ cc.Class({
const pictureWordSmallBg = cc.find('Canvas/LetterPicturePage/PictureWordSmallBg');
const pictureWordBigBg = cc.find('Canvas/LetterPicturePage/PictureWordBigBg');
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();
let that = this
cc.view.setResizeCallback(function() {
// console.log("sizeChange");
that.repositionButton();
});
......@@ -364,7 +369,12 @@ cc.Class({
await jelly(btn_restart);
btn_restart.active = false;
this.pageFlyOut();
this.restartGame();
// this.restartGame();
if(this.sharkNode) {
this.sharkNode.parent = null;
this.sharkNode = null;
}
this.createLetterPage(this.letter);
setTimeout(() => {
btn_restart.active = true;
this._enableRestart = true;;
......@@ -388,6 +398,49 @@ cc.Class({
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', () => {
this.playEffect(`letter${this.letter.toUpperCase()}`);
cc.tween(smallLetterBase)
......@@ -420,20 +473,31 @@ cc.Class({
btnNext.active = false;
btnBefore.on('click', async () => {
console.log("btnBefore click")
if (btnClicked) {
return;
}
btnClicked = true;
this.playEffect('按钮');
await jelly(btnBefore);
this._status.currentLetterIdx--;
this._status.currentLetterIdx = Math.max(this._status.currentLetterIdx, 0);
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;
});
btnNext.on('click', async () => {
console.log("btnNext click")
if (btnClicked) {
return;
}
......@@ -444,18 +508,39 @@ cc.Class({
this._status.currentLetterIdx++;
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;
});
// this.checkButton();
},
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 = Math.min(this._status.currentLetterIdx, this.data.letterList.length - 1);
this.doneFlag = [false, false];
this.currentCase = 0;
this.updateLetter();
this.checkButton()
},
onLoadFinish() {
this.initListeners();
this._status = {
......@@ -464,6 +549,7 @@ cc.Class({
currentStrokeStageIdx: 0
}
this.updateLetter();
this.checkButton();
},
restartGame() {
......@@ -959,7 +1045,7 @@ cc.Class({
})
.start();
},
async showOver() {
let btn_restart = cc.find('Canvas/buttons/btn_restart');
btn_restart.active = false;
......@@ -971,14 +1057,21 @@ cc.Class({
}, 5000);
this.hideShark();
this.playEffect('放大');
// this.playEffect('放大');
await this.showCompleteStar();
this.playEffect(`letter${this.letter.toUpperCase()}`);
// await this.showRibbons();
if(this._status.currentLetterIdx != (this.data.letterList.length-1)) {
await this.playEffect("GoodJob");
await asyncDelay(0.5)
await this.playEffect(`letter${this.letter.toUpperCase()}`);
this.doneFlag[this.currentCase] = true;
if(this.doneFlag[0] && this.doneFlag[1]) {
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();
// console.log(this._status.currentLetterIdx, this.data.letterList.length-1)
// if (this.letter !== this.letter.toLowerCase()) {
......@@ -991,10 +1084,11 @@ cc.Class({
// this.loadNextLetter()
// }
// }
if(this._status.currentLetterIdx != (this.data.letterList.length-1)) {
this.pageFlyOut();
this.loadNextLetter()
}
// if(this._status.currentLetterIdx != (this.data.letterList.length-1)) {
// this.pageFlyOut();
// this.loadNextLetter()
// }
},
async showCompleteStar() {
......
......@@ -36,6 +36,10 @@ cc.Class({
default: null,
type: cc.AudioClip
},
GoodJob: {
default: null,
type: cc.AudioClip
},
撒花: {
default: null,
type: cc.AudioClip
......
module.exports = {
letterList: ["A", "a", "B", "C", "d"]
letterList: ["A", "B", "C"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment