Commit bd1ac5d6 authored by asdf's avatar asdf

.

parent 9900f36b
{
"ver": "2.0.1",
"uuid": "61bb3c5a-7125-4710-aa40-7fb3d9feb3d1",
"downloadMode": 0,
"duration": 0.216,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "509a0fa6-1734-4386-815d-3d518bb1cf8f",
"downloadMode": 0,
"duration": 1.854694,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "69c6499a-e0df-47b5-a5df-20a5f3272254",
"downloadMode": 0,
"duration": 1.044898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f87f553d-42df-42cc-98df-264b0752357f",
"downloadMode": 0,
"duration": 1.393083,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "8ab43197-f011-4f59-9341-71def648e29c",
"downloadMode": 0,
"duration": 3.787755,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "5ae1822d-008f-4fda-994c-7e44bc02a4a1",
"subMetas": {}
}
\ No newline at end of file
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 26.62, "width": 0,
"height": 100.8 "height": 100.8
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -270,8 +270,8 @@ ...@@ -270,8 +270,8 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_useOriginalSize": false, "_useOriginalSize": false,
"_string": "j", "_string": "",
"_N$string": "j", "_N$string": "",
"_fontSize": 66, "_fontSize": 66,
"_lineHeight": 80, "_lineHeight": 80,
"_enableWrapText": true, "_enableWrapText": true,
...@@ -312,6 +312,9 @@ ...@@ -312,6 +312,9 @@
"labWord": { "labWord": {
"__id__": 6 "__id__": 6
}, },
"audDrop": {
"__uuid__": "61bb3c5a-7125-4710-aa40-7fb3d9feb3d1"
},
"_id": "" "_id": ""
}, },
{ {
......
This diff is collapsed.
{
"ver": "1.2.7",
"uuid": "08943eff-5fc8-47e9-bf14-8f95396918a9",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -2754,7 +2754,7 @@ ...@@ -2754,7 +2754,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 288.95, "width": 0,
"height": 50.4 "height": 50.4
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -3562,6 +3562,9 @@ ...@@ -3562,6 +3562,9 @@
"pfbItemCollisionEffect": { "pfbItemCollisionEffect": {
"__uuid__": "dc01f23a-4f76-4fc8-9793-1c29e3774b79" "__uuid__": "dc01f23a-4f76-4fc8-9793-1c29e3774b79"
}, },
"layerOver": {
"__uuid__": "08943eff-5fc8-47e9-bf14-8f95396918a9"
},
"spfAudio": [ "spfAudio": [
{ {
"__uuid__": "621af077-00ed-4f70-b28d-614b433de24d" "__uuid__": "621af077-00ed-4f70-b28d-614b433de24d"
...@@ -3589,6 +3592,18 @@ ...@@ -3589,6 +3592,18 @@
"__uuid__": "6d54e77c-2b6b-45a3-b4ae-1aa53f84531b" "__uuid__": "6d54e77c-2b6b-45a3-b4ae-1aa53f84531b"
} }
], ],
"audEnter": {
"__uuid__": "509a0fa6-1734-4386-815d-3d518bb1cf8f"
},
"audReplay": {
"__uuid__": "f87f553d-42df-42cc-98df-264b0752357f"
},
"audWelldone": {
"__uuid__": "8ab43197-f011-4f59-9341-71def648e29c"
},
"audGoodjob": {
"__uuid__": "69c6499a-e0df-47b5-a5df-20a5f3272254"
},
"_id": "76pKAVQpBDVby2iIHB3LLz" "_id": "76pKAVQpBDVby2iIHB3LLz"
} }
] ]
\ No newline at end of file
...@@ -5,6 +5,7 @@ cc.Class({ ...@@ -5,6 +5,7 @@ cc.Class({
properties: { properties: {
labWord: cc.Label, labWord: cc.Label,
audDrop:cc.AudioClip,
}, },
onLoad() { onLoad() {
...@@ -107,9 +108,18 @@ cc.Class({ ...@@ -107,9 +108,18 @@ cc.Class({
EventMgr.emit('onTouchmove', { x: delta.x, index: itemList[0].index }); EventMgr.emit('onTouchmove', { x: delta.x, index: itemList[0].index });
} }
}, },
playAudioDrop() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audDrop, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
onTouchEnd() { onTouchEnd() {
if (!this.hadMove) { if (!this.hadMove) {
this.playAudio(); this.playAudio();
}else{
this.playAudioDrop();
} }
this.hadMove = false; this.hadMove = false;
this.isActive = false; this.isActive = false;
......
...@@ -5,7 +5,6 @@ cc.Class({ ...@@ -5,7 +5,6 @@ cc.Class({
properties: { properties: {
audOver: cc.AudioClip, audOver: cc.AudioClip,
audOver2: cc.AudioClip,
}, },
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
...@@ -15,24 +14,21 @@ cc.Class({ ...@@ -15,24 +14,21 @@ cc.Class({
}, },
start() { start() {
this.scheduleOnce(() => { showFireworks(
showFireworks( this.node,
this.node, this.node.getChildByName('RibbonNodeBase').children,
this.node.getChildByName('RibbonNodeBase').children, cc.v2(0, -400), cc.v2(0, 1000), 200, 200
cc.v2(0, -400), cc.v2(0, 1000), 200, 200 );
); showFireworks(
showFireworks( this.node,
this.node, this.node.getChildByName('RibbonNodeBase').children,
this.node.getChildByName('RibbonNodeBase').children, cc.v2(-600, -400), cc.v2(200, 1000), 200, 200
cc.v2(-600, -400), cc.v2(200, 1000), 200, 200 );
); showFireworks(
showFireworks( this.node,
this.node, this.node.getChildByName('RibbonNodeBase').children,
this.node.getChildByName('RibbonNodeBase').children, cc.v2(600, -400), cc.v2(-200, 1000), 200, 200
cc.v2(600, -400), cc.v2(-200, 1000), 200, 200 );
);
this.playAudioOver2();
}, 0.6)
this.playAudioOver(); this.playAudioOver();
}, },
...@@ -43,12 +39,6 @@ cc.Class({ ...@@ -43,12 +39,6 @@ cc.Class({
GameData.audioCount--; GameData.audioCount--;
}) })
}, },
playAudioOver2() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audOver2, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
// update (dt) {}, // update (dt) {},
}); });
...@@ -10,9 +10,14 @@ cc.Class({ ...@@ -10,9 +10,14 @@ cc.Class({
pfbItem: cc.Prefab, pfbItem: cc.Prefab,
pfbItemWord: cc.Prefab, pfbItemWord: cc.Prefab,
pfbItemCollisionEffect: cc.Prefab, pfbItemCollisionEffect: cc.Prefab,
layerOver: cc.Prefab,
spfAudio: [cc.SpriteFrame], spfAudio: [cc.SpriteFrame],
spfLeft: [cc.SpriteFrame], spfLeft: [cc.SpriteFrame],
spfRight: [cc.SpriteFrame], spfRight: [cc.SpriteFrame],
audEnter: cc.AudioClip,
audReplay: cc.AudioClip,
audWelldone: cc.AudioClip,
audGoodjob: cc.AudioClip,
}, },
// 生命周期 onLoad // 生命周期 onLoad
...@@ -111,6 +116,10 @@ cc.Class({ ...@@ -111,6 +116,10 @@ cc.Class({
return; return;
} }
GameData.questionIndex = 0; GameData.questionIndex = 0;
this.questionList = [];
for (let i = 0; i < this.data.questionList.length; i++) {
this.questionList.push(i);
}
this.initData(); this.initData();
this.updateBtnStatus(); this.updateBtnStatus();
...@@ -129,7 +138,7 @@ cc.Class({ ...@@ -129,7 +138,7 @@ cc.Class({
}, },
startGame() { startGame() {
this.playAudioEnter();
}, },
initTitle() { initTitle() {
...@@ -171,6 +180,14 @@ cc.Class({ ...@@ -171,6 +180,14 @@ cc.Class({
}) })
}, },
playAudioEnter() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audEnter, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
updateBtnStatus() { updateBtnStatus() {
if (this.data.questionList.length === 1) { if (this.data.questionList.length === 1) {
this.nodeDict.btnLast.active = false; this.nodeDict.btnLast.active = false;
...@@ -189,17 +206,16 @@ cc.Class({ ...@@ -189,17 +206,16 @@ cc.Class({
} }
}, },
checkOver() {
if (this.questionList.length == 0) {
return true;
}
},
checkDone(length, pos) { checkDone(length, pos) {
if (length < this.data.questionList[GameData.questionIndex].optionList.length) { if (length < this.data.questionList[GameData.questionIndex].optionList.length) {
return; return;
} }
for (let i = 0; i < this.questionList.length; i++) {
if (this.questionList[i] === GameData.questionIndex) {
this.questionList.splice(i, 1);
i--;
}
}
this.nodeDict.layerParts.destroyAllChildren(); this.nodeDict.layerParts.destroyAllChildren();
let node = cc.instantiate(this.pfbItemWord); let node = cc.instantiate(this.pfbItemWord);
node.parent = this.nodeDict.layerParts; node.parent = this.nodeDict.layerParts;
...@@ -216,9 +232,21 @@ cc.Class({ ...@@ -216,9 +232,21 @@ cc.Class({
cc.tween(this.nodeDict.layerDone) cc.tween(this.nodeDict.layerDone)
.to(0.25, { scale: 1.05 }) .to(0.25, { scale: 1.05 })
.to(0.1, { scale: 1 }) .to(0.1, { scale: 1 })
.call(() => {
this.onBtnClickAudio(() => {
this.playAudioGoodjob();
});
})
.start() .start()
}, },
playAudioGoodjob() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audGoodjob, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
this.checkOver();
})
},
resetDate() { resetDate() {
this.nodeDict.layerDone.active = false; this.nodeDict.layerDone.active = false;
cc.audioEngine.stopAll(); cc.audioEngine.stopAll();
...@@ -237,6 +265,7 @@ cc.Class({ ...@@ -237,6 +265,7 @@ cc.Class({
return; return;
} }
this.resetDate(); this.resetDate();
this.playAudioReplay();
}, },
onTurnNext() { onTurnNext() {
if (GameData.audioCount != 0) { if (GameData.audioCount != 0) {
...@@ -253,14 +282,14 @@ cc.Class({ ...@@ -253,14 +282,14 @@ cc.Class({
} }
this.playAudio() this.playAudio()
} else if (button.node.name == 'btnLast') { } else if (button.node.name == 'btnLast') {
if(this.nodeDict.btnLast.getComponent(cc.Sprite).spriteFrame === this.spfLeft[0]){ if (this.nodeDict.btnLast.getComponent(cc.Sprite).spriteFrame === this.spfLeft[0]) {
return; return;
} }
this.onTurnLast(); this.onTurnLast();
} else if (button.node.name == 'btnReplay') { } else if (button.node.name == 'btnReplay') {
this.onReplay(); this.onReplay();
} else if (button.node.name == 'btnNext') { } else if (button.node.name == 'btnNext') {
if(this.nodeDict.btnNext.getComponent(cc.Sprite).spriteFrame === this.spfRight[0]){ if (this.nodeDict.btnNext.getComponent(cc.Sprite).spriteFrame === this.spfRight[0]) {
return; return;
} }
this.onTurnNext(); this.onTurnNext();
...@@ -268,19 +297,24 @@ cc.Class({ ...@@ -268,19 +297,24 @@ cc.Class({
this.onBtnClickAudio(); this.onBtnClickAudio();
} }
}, },
playAudioReplay() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audReplay, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
changeAudioSpfCb() { changeAudioSpfCb() {
this.sprAudio.spriteFrame = this.spfAudio[this.audioSpfIndex]; this.sprAudio.spriteFrame = this.spfAudio[this.audioSpfIndex];
this.audioSpfIndex++; this.audioSpfIndex++;
this.audioSpfIndex = this.audioSpfIndex % 3; this.audioSpfIndex = this.audioSpfIndex % 3;
}, },
onBtnClickAudio() { onBtnClickAudio(cb) {
if (GameData.audioCount > 0) {
return;
}
this.sprAudio.spriteFrame = this.spfAudio[0]; this.sprAudio.spriteFrame = this.spfAudio[0];
this.unschedule(this.changeAudioSpfCb)
this.schedule(this.changeAudioSpfCb, 0.2) this.schedule(this.changeAudioSpfCb, 0.2)
this.playAudio(() => { this.playAudio(() => {
cb && cb();
this.unschedule(this.changeAudioSpfCb) this.unschedule(this.changeAudioSpfCb)
this.sprAudio.spriteFrame = this.spfAudio[1]; this.sprAudio.spriteFrame = this.spfAudio[1];
}); });
...@@ -317,4 +351,20 @@ cc.Class({ ...@@ -317,4 +351,20 @@ cc.Class({
} }
}, 2) }, 2)
}, },
checkOver() {
if (this.questionList.length !== 0) {
return;
}
if (this.gameOver) {
return;
}
this.gameOver = true;
this.showGameOver();
},
showGameOver() {
let node = cc.instantiate(this.layerOver);
node.parent = this.node;
},
}); });
{
"ver": "2.3.5",
"uuid": "8113da78-a59d-4620-a728-bbe19ebee330",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 36,
"height": 24,
"platformSettings": {},
"subMetas": {
"bg_sahua": {
"ver": "1.0.4",
"uuid": "7306b5ce-b40a-40ca-aa2c-c9d2689516c8",
"rawTextureUuid": "8113da78-a59d-4620-a728-bbe19ebee330",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 36,
"height": 24,
"rawWidth": 36,
"rawHeight": 24,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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