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

Change request

parent f995a9b7
...@@ -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&nbsp;</a> <a (click)="addLetter('a')" style="font-size: 50px;">a&nbsp;</a>
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<a (click)="addLetter('z')" style="font-size: 50px;">z&nbsp;</a> <a (click)="addLetter('z')" style="font-size: 50px;">z&nbsp;</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>
......
{
"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({ ...@@ -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() {
......
...@@ -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
......
module.exports = { 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