Commit 786a9bc9 authored by huoshizhe's avatar huoshizhe

fix: bugs

parent 70ec82ca
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
</button> </button>
</div> </div>
</div> </div>
<div *ngIf="(item.wordList.length < 5)">
<div class="border" style="width: 430px; height: 100px;"> <div class="border" style="width: 430px; height: 100px;">
<button style="height: 55px; width: 385px;" nz-button nzType="dashed" class="add-btn" (click)="createShell()"> <button style="height: 55px; width: 385px;" nz-button nzType="dashed" class="add-btn" (click)="createShell()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
...@@ -32,7 +31,6 @@ ...@@ -32,7 +31,6 @@
</button> </button>
</div> </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>
<br> <br>
......
This diff is collapsed.
{
"ver": "1.2.7",
"uuid": "82b173cf-75c4-4b54-8143-01df312ee386",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -27,6 +27,11 @@ cc.Class({ ...@@ -27,6 +27,11 @@ cc.Class({
type: cc.Prefab, type: cc.Prefab,
default: null, default: null,
}, },
shellPrefab: {
type: cc.Prefab,
default: null,
},
}, },
ctor() { ctor() {
...@@ -35,7 +40,6 @@ cc.Class({ ...@@ -35,7 +40,6 @@ cc.Class({
this._status = { this._status = {
treeHeight: -1, treeHeight: -1,
} }
this._maxTreeHeight = 5;
}, },
start() { start() {
...@@ -94,6 +98,7 @@ cc.Class({ ...@@ -94,6 +98,7 @@ cc.Class({
hideAirClassLoading() { hideAirClassLoading() {
if (window && window["air"]) { if (window && window["air"]) {
window["air"].hideAirClassLoading(); window["air"].hideAirClassLoading();
console.log('hideAirClassLoading');
} }
}, },
...@@ -146,7 +151,6 @@ cc.Class({ ...@@ -146,7 +151,6 @@ cc.Class({
cc.tween(nodeCharacterBase) cc.tween(nodeCharacterBase)
.delay(1.5) .delay(1.5)
.call(() => { .call(() => {
this.playEffect('植物');
this.showTree(0); this.showTree(0);
}) })
.delay(1) .delay(1)
...@@ -162,17 +166,34 @@ cc.Class({ ...@@ -162,17 +166,34 @@ cc.Class({
}, },
async showTree(idx) { async showTree(idx) {
if (idx <= this._status.treeHeight || idx >= this._maxTreeHeight) { if (idx <= this._status.treeHeight || this.data.wordList.length <= idx) {
return; return;
} }
const treeYList = [500, 700, 900, 1100, 1300];
const nodeTree = cc.find('Canvas/NodeBg/TreeMaskNode/NodeTree'); const nodeTree = cc.find('Canvas/NodeBg/TreeMaskNode/NodeTree');
this.moveCamera(idx); this.playEffect('植物');
await asyncTweenTo(nodeTree, 3, { y: treeYList[idx] }); this._status.treeHeight = idx;
this.growTree(idx);
this.growSky(idx);
await asyncTweenTo(nodeTree, 3, { y: 500 + 200 * idx });
this.playEffect('路牌'); this.playEffect('路牌');
this.showShell(idx); this.showShell(idx);
this._status.treeHeight = idx; },
growTree(idx) {
if (idx < 5) {
return;
}
const nodeTree = cc.find('Canvas/NodeBg/TreeMaskNode/NodeTree');
asyncTweenTo(nodeTree, 3, { scaleY: (nodeTree.height + 200 * (idx - 4)) / nodeTree.height });
},
growSky(idx) {
if (idx < 5) {
return;
}
const nodeBg = cc.find('Canvas/NodeBg');
asyncTweenTo(nodeBg, 3, { height: (nodeBg.height + 200 * (idx - 4)) });
}, },
moveCamera(idx) { moveCamera(idx) {
...@@ -182,10 +203,13 @@ cc.Class({ ...@@ -182,10 +203,13 @@ cc.Class({
}, },
showShell(idx) { showShell(idx) {
const nodeShell = cc.find(`Canvas/NodeBg/TreeMaskNode/NodeShell_${idx}`); const nodeShell = cc.instantiate(this.shellPrefab);
const btnChange = cc.find(`Canvas/NodeBg/TreeMaskNode/NodeShell_${idx}/BtnChange`); nodeShell.parent = cc.find('Canvas/NodeBg/TreeMaskNode');
const labelNode = cc.find(`Canvas/NodeBg/TreeMaskNode/NodeShell_${idx}/LabelNode`); nodeShell.y = idx * 200 + 300;
const labelNodeBack = cc.find(`Canvas/NodeBg/TreeMaskNode/NodeShell_${idx}/LabelNodeBack`);
const btnChange = nodeShell.getChildByName('BtnChange');
const labelNode = nodeShell.getChildByName('LabelNode');
const labelNodeBack = nodeShell.getChildByName('LabelNodeBack');
btnChange.on('click', () => { btnChange.on('click', () => {
cc.tween(nodeShell) cc.tween(nodeShell)
...@@ -207,7 +231,6 @@ cc.Class({ ...@@ -207,7 +231,6 @@ cc.Class({
labelNode.on('click', () => { labelNode.on('click', () => {
asyncPlayEffectByUrl(this.data.wordList[idx].audio); asyncPlayEffectByUrl(this.data.wordList[idx].audio);
if (this.data.wordList[idx].backWord == '') { if (this.data.wordList[idx].backWord == '') {
this.playEffect('植物');
this.showTree(idx + 1); this.showTree(idx + 1);
return; return;
} }
...@@ -281,7 +304,7 @@ cc.Class({ ...@@ -281,7 +304,7 @@ cc.Class({
const targetPosList = [] const targetPosList = []
for (let i = 1; i < 5; i++) { for (let i = 1; i < 5; i++) {
const node = cc.find(`Canvas/NodeBg/NodePosBase/NodeFishPos_${i}`); const node = cc.find(`Canvas/NodeBg/NodePosBase/NodeFishPos_${i}`);
targetPosList.push({ x: node.x, y: node.y }); targetPosList.push({ x: node.x, y: node.y + 720 });
} }
const nodeBg = cc.find('Canvas/NodeBg'); const nodeBg = cc.find('Canvas/NodeBg');
...@@ -297,7 +320,7 @@ cc.Class({ ...@@ -297,7 +320,7 @@ cc.Class({
const fish = cc.instantiate(this.fishPrefab); const fish = cc.instantiate(this.fishPrefab);
fish.parent = nodeBg; fish.parent = nodeBg;
fish.x = -1000 + offsetX; fish.x = -1000 + offsetX;
fish.y = 400 + offsetY; fish.y = 1020 + offsetY;
fish.scaleX = fishScle + Math.random() * 0.3; fish.scaleX = fishScle + Math.random() * 0.3;
fish.scaleY = fishScle + Math.random() * 0.3; fish.scaleY = fishScle + Math.random() * 0.3;
......
...@@ -19,6 +19,21 @@ module.exports = { ...@@ -19,6 +19,21 @@ module.exports = {
audio: 'ee.mp3', audio: 'ee.mp3',
backWord: '', backWord: '',
backWordAudio: '', backWordAudio: '',
}, {
word: 'ee',
audio: 'ee.mp3',
backWord: '',
backWordAudio: '',
}, {
word: 'ee',
audio: 'ee.mp3',
backWord: '',
backWordAudio: '',
}, {
word: 'ee',
audio: 'ee.mp3',
backWord: '',
backWordAudio: '',
}, { }, {
word: 'ea', word: 'ea',
audio: 'ea.mp3', audio: 'ea.mp3',
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
"height": 1440, "height": 1440,
"rawWidth": 1280, "rawWidth": 1280,
"rawHeight": 1440, "rawHeight": 1440,
"borderTop": 0, "borderTop": 45,
"borderBottom": 0, "borderBottom": 1336,
"borderLeft": 0, "borderLeft": 0,
"borderRight": 0, "borderRight": 0,
"subMetas": {} "subMetas": {}
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
"height": 1224, "height": 1224,
"rawWidth": 127, "rawWidth": 127,
"rawHeight": 1224, "rawHeight": 1224,
"borderTop": 0, "borderTop": 899,
"borderBottom": 0, "borderBottom": 316,
"borderLeft": 0, "borderLeft": 0,
"borderRight": 0, "borderRight": 0,
"subMetas": {} "subMetas": {}
......
{
"title": "play",
"packageName": "org.cocos2d.demo",
"startScene": "95683576-d267-4b91-91b5-d4938a156943",
"excludeScenes": [],
"includeSDKBox": false,
"orientation": {
"landscapeLeft": true,
"landscapeRight": true,
"portrait": false,
"upsideDown": false
},
"webOrientation": "auto",
"inlineSpriteFrames": false,
"inlineSpriteFrames_native": true,
"mainCompressionType": "default",
"mainIsRemote": false,
"optimizeHotUpdate": false,
"md5Cache": false,
"nativeMd5Cache": true,
"encryptJs": true,
"xxteaKey": "3870a9ca-a3da-4d",
"zipCompressJs": true,
"fb-instant-games": {},
"android": {
"REMOTE_SERVER_ROOT": "",
"packageName": "org.cocos2d.demo"
},
"ios": {
"REMOTE_SERVER_ROOT": "",
"packageName": "org.cocos2d.demo"
},
"mac": {
"REMOTE_SERVER_ROOT": "",
"height": 720,
"packageName": "org.cocos2d.demo",
"width": 1280
},
"win32": {
"REMOTE_SERVER_ROOT": "",
"height": 720,
"width": 1280
},
"android-instant": {
"REMOTE_SERVER_ROOT": "",
"host": "",
"packageName": "org.cocos2d.demo",
"pathPattern": "",
"recordPath": "",
"scheme": "https",
"skipRecord": false
},
"appBundle": false
}
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