Commit d5665d78 authored by Tt's avatar Tt

游戏完成

parent aef36fe4
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "665e544c-fe92-4f24-bdcc-9475a763ff0c", "uuid": "665e544c-fe92-4f24-bdcc-9475a763ff0c",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.264, "duration": 1.149388,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "552984b3-b335-40f3-94f7-b4360f0e9304",
"downloadMode": 0,
"duration": 2.448,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "d26934ee-8708-4319-a122-ef3d4fb9d2dc",
"downloadMode": 0,
"duration": 3.24,
"subMetas": {}
}
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "342d6b41-d606-43d5-9676-7b67f03d236f", "uuid": "342d6b41-d606-43d5-9676-7b67f03d236f",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.653061, "duration": 0.365714,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
let item = this.node;
// alert("抖动效果");
// let tween = cc.tween(item);
// tween.to(0.06, { angle: 10 })
// .to(0.06, { angle: 0 })
// .to(0.06, { angle: -10 })
// .to(0.06, { angle: 0 });
// tween.repeat(100);
// tween.start();
let ani = cc.repeatForever(cc.sequence(cc.moveBy(0.5, cc.v2(0, 25)), cc.moveBy(0.5, cc.v2(0, -25))));
item.runAction(ani);
},
start() {
},
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "02c49c54-b257-4df4-a4d1-53b76a3e9c3a",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -42,6 +42,12 @@ class CardManager { ...@@ -42,6 +42,12 @@ class CardManager {
getPage() { getPage() {
return this._cardArray; return this._cardArray;
} }
getAudio() {
return this._audio_url;
}
allRightNum() {
return this._cardArray.filter(c => c.right).length;
}
addPageNum() { addPageNum() {
this.pageId++; this.pageId++;
if (!this.getPage()) { if (!this.getPage()) {
......
...@@ -232,6 +232,18 @@ pg.view = { ...@@ -232,6 +232,18 @@ pg.view = {
skl.setAnimation(0, aniName, loop); skl.setAnimation(0, aniName, loop);
return skl; return skl;
}, },
playDragonBone(item, aniName, loop) {
if (!item || !cc.isValid(item)) return log.w("动画播放失败,传入了错误的item");
if (!aniName) return log.w("动画播放失败,传入了错误的aniName");
let node = item.node ? item.node : item;
if (!cc.isValid(node)) return log.w("节点已销毁");
let dba = node.getComponent(dragonBones.ArmatureDisplay);
dba.playAnimation(aniName, loop);
return dba;
},
cloneNode(node) {
return cc.instantiate(node);
}
} }
//加载 未封装bundle //加载 未封装bundle
pg.load = { pg.load = {
......
...@@ -78,37 +78,37 @@ ...@@ -78,37 +78,37 @@
"__id__": 7 "__id__": 7
}, },
{ {
"__id__": 22 "__id__": 26
}, },
{ {
"__id__": 24 "__id__": 29
}, },
{ {
"__id__": 28 "__id__": 33
}, },
{ {
"__id__": 48 "__id__": 54
}, },
{ {
"__id__": 50 "__id__": 56
}, },
{ {
"__id__": 53 "__id__": 59
}, },
{ {
"__id__": 55 "__id__": 61
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 96 "__id__": 102
}, },
{ {
"__id__": 97 "__id__": 103
}, },
{ {
"__id__": 98 "__id__": 104
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -379,6 +379,12 @@ ...@@ -379,6 +379,12 @@
}, },
{ {
"__id__": 20 "__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
} }
], ],
"_active": true, "_active": true,
...@@ -998,6 +1004,168 @@ ...@@ -998,6 +1004,168 @@
"preload": false, "preload": false,
"_id": "d5kSalW1hFrZFC/n4/ImJJ" "_id": "d5kSalW1hFrZFC/n4/ImJJ"
}, },
{
"__type__": "cc.Node",
"_name": "mao_choice",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "18FaNQc3tNHJderddeEv04"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_clip": {
"__uuid__": "552984b3-b335-40f3-94f7-b4360f0e9304"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "a5yHkl54NKgqVYLg/+k/jf"
},
{
"__type__": "cc.Node",
"_name": "mao_right",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 25
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d8JWmQ//NNu6PKxq4lCemj"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_clip": {
"__uuid__": "d26934ee-8708-4319-a122-ef3d4fb9d2dc"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "12H1OHrr5M/aqoaWxV3VHW"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bg_2", "_name": "bg_2",
...@@ -1009,7 +1177,10 @@ ...@@ -1009,7 +1177,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 27
},
{
"__id__": 28
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1036,7 +1207,7 @@ ...@@ -1036,7 +1207,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-412.507, -413.5,
0, 0,
0, 0,
0, 0,
...@@ -1065,7 +1236,7 @@ ...@@ -1065,7 +1236,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 26
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1092,6 +1263,33 @@ ...@@ -1092,6 +1263,33 @@
"_atlas": null, "_atlas": null,
"_id": "fdhRCm/Q9Ok6aVWoeI0Kie" "_id": "fdhRCm/Q9Ok6aVWoeI0Kie"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 44,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 0,
"_id": "e2ZVj+KWZJ9rapgoIudNM5"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bg_bg", "_name": "bg_bg",
...@@ -1103,13 +1301,13 @@ ...@@ -1103,13 +1301,13 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 25 "__id__": 30
}, },
{ {
"__id__": 26 "__id__": 31
}, },
{ {
"__id__": 27 "__id__": 32
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1165,7 +1363,7 @@ ...@@ -1165,7 +1363,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 24 "__id__": 29
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1197,7 +1395,7 @@ ...@@ -1197,7 +1395,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 24 "__id__": 29
}, },
"_enabled": true, "_enabled": true,
"r_width": 1, "r_width": 1,
...@@ -1218,7 +1416,7 @@ ...@@ -1218,7 +1416,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 24 "__id__": 29
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1249,28 +1447,28 @@ ...@@ -1249,28 +1447,28 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 29 "__id__": 34
}, },
{ {
"__id__": 31 "__id__": 36
}, },
{ {
"__id__": 33 "__id__": 38
}, },
{ {
"__id__": 42 "__id__": 48
}, },
{ {
"__id__": 44 "__id__": 50
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 46 "__id__": 52
}, },
{ {
"__id__": 47 "__id__": 53
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1326,13 +1524,13 @@ ...@@ -1326,13 +1524,13 @@
"_name": "txt", "_name": "txt",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 28 "__id__": 33
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 30 "__id__": 35
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1388,7 +1586,7 @@ ...@@ -1388,7 +1586,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 29 "__id__": 34
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -1419,13 +1617,13 @@ ...@@ -1419,13 +1617,13 @@
"_name": "bg", "_name": "bg",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 28 "__id__": 33
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 32 "__id__": 37
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1481,7 +1679,7 @@ ...@@ -1481,7 +1679,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 31 "__id__": 36
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1513,26 +1711,26 @@ ...@@ -1513,26 +1711,26 @@
"_name": "audio", "_name": "audio",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 28 "__id__": 33
}, },
"_children": [ "_children": [
{ {
"__id__": 34 "__id__": 39
}, },
{ {
"__id__": 36 "__id__": 42
}, },
{ {
"__id__": 38 "__id__": 44
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 40 "__id__": 46
}, },
{ {
"__id__": 41 "__id__": 47
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1588,13 +1786,16 @@ ...@@ -1588,13 +1786,16 @@
"_name": "icon_1", "_name": "icon_1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 33 "__id__": 38
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 35 "__id__": 40
},
{
"__id__": 41
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1650,7 +1851,7 @@ ...@@ -1650,7 +1851,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 34 "__id__": 39
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1677,18 +1878,28 @@ ...@@ -1677,18 +1878,28 @@
"_atlas": null, "_atlas": null,
"_id": "f9T+znRuNMXoYalS9dlXW+" "_id": "f9T+znRuNMXoYalS9dlXW+"
}, },
{
"__type__": "02c49xUsldN9KTRU7dqPpw6",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
},
"_enabled": true,
"_id": "f80jKZGKFH2LR0Tq7WAA8S"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "icon_2", "_name": "icon_2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 33 "__id__": 38
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 37 "__id__": 43
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1744,7 +1955,7 @@ ...@@ -1744,7 +1955,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 36 "__id__": 42
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1776,13 +1987,13 @@ ...@@ -1776,13 +1987,13 @@
"_name": "icon_3", "_name": "icon_3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 33 "__id__": 38
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 39 "__id__": 45
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1838,7 +2049,7 @@ ...@@ -1838,7 +2049,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 38 "__id__": 44
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1870,7 +2081,7 @@ ...@@ -1870,7 +2081,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 33 "__id__": 38
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1902,7 +2113,7 @@ ...@@ -1902,7 +2113,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 33 "__id__": 38
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -1963,7 +2174,7 @@ ...@@ -1963,7 +2174,7 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 33 "__id__": 38
}, },
"_id": "1bJozXbNFLmZDW1c5Hz2uN" "_id": "1bJozXbNFLmZDW1c5Hz2uN"
}, },
...@@ -1972,13 +2183,13 @@ ...@@ -1972,13 +2183,13 @@
"_name": "img", "_name": "img",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 28 "__id__": 33
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 43 "__id__": 49
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2034,7 +2245,7 @@ ...@@ -2034,7 +2245,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 42 "__id__": 48
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2066,13 +2277,13 @@ ...@@ -2066,13 +2277,13 @@
"_name": "box", "_name": "box",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 28 "__id__": 33
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 45 "__id__": 51
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2128,7 +2339,7 @@ ...@@ -2128,7 +2339,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 44 "__id__": 50
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2160,7 +2371,7 @@ ...@@ -2160,7 +2371,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 28 "__id__": 33
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
...@@ -2192,7 +2403,7 @@ ...@@ -2192,7 +2403,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 28 "__id__": 33
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -2253,7 +2464,7 @@ ...@@ -2253,7 +2464,7 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 28 "__id__": 33
}, },
"_id": "91dwNqgbhI6YHjRBdun/1Z" "_id": "91dwNqgbhI6YHjRBdun/1Z"
}, },
...@@ -2268,7 +2479,7 @@ ...@@ -2268,7 +2479,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 49 "__id__": 55
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2324,7 +2535,7 @@ ...@@ -2324,7 +2535,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 48 "__id__": 54
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
...@@ -2362,10 +2573,10 @@ ...@@ -2362,10 +2573,10 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 51 "__id__": 57
}, },
{ {
"__id__": 52 "__id__": 58
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2421,7 +2632,7 @@ ...@@ -2421,7 +2632,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 56
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2453,7 +2664,7 @@ ...@@ -2453,7 +2664,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 56
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -2514,13 +2725,13 @@ ...@@ -2514,13 +2725,13 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 50 "__id__": 56
}, },
"_id": "86ErSTSUhP26kFUGhhqqPn" "_id": "86ErSTSUhP26kFUGhhqqPn"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "mao", "_name": "cat",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
...@@ -2529,7 +2740,7 @@ ...@@ -2529,7 +2740,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 54 "__id__": 60
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2585,7 +2796,7 @@ ...@@ -2585,7 +2796,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 53 "__id__": 59
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2594,7 +2805,7 @@ ...@@ -2594,7 +2805,7 @@
} }
], ],
"_armatureName": "Armature", "_armatureName": "Armature",
"_animationName": "normal", "_animationName": "begin",
"_preCacheMode": 0, "_preCacheMode": 0,
"_cacheMode": 0, "_cacheMode": 0,
"playTimes": -1, "playTimes": -1,
...@@ -2613,7 +2824,7 @@ ...@@ -2613,7 +2824,7 @@
"__uuid__": "3d8e589c-5c1f-4b39-a453-5ba90fab0723" "__uuid__": "3d8e589c-5c1f-4b39-a453-5ba90fab0723"
}, },
"_N$_defaultArmatureIndex": 0, "_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 3, "_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0, "_N$_defaultCacheMode": 0,
"_N$timeScale": 1, "_N$timeScale": 1,
"_N$debugBones": false, "_N$debugBones": false,
...@@ -2629,7 +2840,7 @@ ...@@ -2629,7 +2840,7 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 56 "__id__": 62
} }
], ],
"_active": true, "_active": true,
...@@ -2687,14 +2898,14 @@ ...@@ -2687,14 +2898,14 @@
"_name": "firework_ani", "_name": "firework_ani",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 55 "__id__": 61
}, },
"_children": [ "_children": [
{ {
"__id__": 57 "__id__": 63
}, },
{ {
"__id__": 70 "__id__": 76
} }
], ],
"_active": true, "_active": true,
...@@ -2752,26 +2963,26 @@ ...@@ -2752,26 +2963,26 @@
"_name": "RibbonNodeBase", "_name": "RibbonNodeBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 56 "__id__": 62
}, },
"_children": [ "_children": [
{ {
"__id__": 58 "__id__": 64
}, },
{ {
"__id__": 60 "__id__": 66
}, },
{ {
"__id__": 62 "__id__": 68
}, },
{ {
"__id__": 64 "__id__": 70
}, },
{ {
"__id__": 66 "__id__": 72
}, },
{ {
"__id__": 68 "__id__": 74
} }
], ],
"_active": true, "_active": true,
...@@ -2829,13 +3040,13 @@ ...@@ -2829,13 +3040,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 57 "__id__": 63
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 59 "__id__": 65
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2891,7 +3102,7 @@ ...@@ -2891,7 +3102,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 58 "__id__": 64
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2923,13 +3134,13 @@ ...@@ -2923,13 +3134,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 57 "__id__": 63
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 61 "__id__": 67
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2985,7 +3196,7 @@ ...@@ -2985,7 +3196,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 60 "__id__": 66
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3017,13 +3228,13 @@ ...@@ -3017,13 +3228,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 57 "__id__": 63
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 63 "__id__": 69
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3079,7 +3290,7 @@ ...@@ -3079,7 +3290,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 62 "__id__": 68
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3111,13 +3322,13 @@ ...@@ -3111,13 +3322,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 57 "__id__": 63
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 65 "__id__": 71
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3173,7 +3384,7 @@ ...@@ -3173,7 +3384,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 64 "__id__": 70
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3205,13 +3416,13 @@ ...@@ -3205,13 +3416,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 57 "__id__": 63
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 67 "__id__": 73
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3267,7 +3478,7 @@ ...@@ -3267,7 +3478,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 66 "__id__": 72
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3299,13 +3510,13 @@ ...@@ -3299,13 +3510,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 57 "__id__": 63
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 69 "__id__": 75
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3361,7 +3572,7 @@ ...@@ -3361,7 +3572,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 68 "__id__": 74
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3393,23 +3604,23 @@ ...@@ -3393,23 +3604,23 @@
"_name": "paperBase", "_name": "paperBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 56 "__id__": 62
}, },
"_children": [ "_children": [
{ {
"__id__": 71 "__id__": 77
}, },
{ {
"__id__": 76 "__id__": 82
}, },
{ {
"__id__": 81 "__id__": 87
}, },
{ {
"__id__": 86 "__id__": 92
}, },
{ {
"__id__": 91 "__id__": 97
} }
], ],
"_active": true, "_active": true,
...@@ -3467,11 +3678,11 @@ ...@@ -3467,11 +3678,11 @@
"_name": "quadBase", "_name": "quadBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 70 "__id__": 76
}, },
"_children": [ "_children": [
{ {
"__id__": 72 "__id__": 78
} }
], ],
"_active": true, "_active": true,
...@@ -3529,17 +3740,17 @@ ...@@ -3529,17 +3740,17 @@
"_name": "quad", "_name": "quad",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 71 "__id__": 77
}, },
"_children": [ "_children": [
{ {
"__id__": 73 "__id__": 79
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 75 "__id__": 81
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3595,13 +3806,13 @@ ...@@ -3595,13 +3806,13 @@
"_name": "paper", "_name": "paper",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 72 "__id__": 78
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 74 "__id__": 80
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3657,7 +3868,7 @@ ...@@ -3657,7 +3868,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 73 "__id__": 79
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3689,7 +3900,7 @@ ...@@ -3689,7 +3900,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 72 "__id__": 78
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3711,11 +3922,11 @@ ...@@ -3711,11 +3922,11 @@
"_name": "quadBase", "_name": "quadBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 70 "__id__": 76
}, },
"_children": [ "_children": [
{ {
"__id__": 77 "__id__": 83
} }
], ],
"_active": true, "_active": true,
...@@ -3773,17 +3984,17 @@ ...@@ -3773,17 +3984,17 @@
"_name": "quad", "_name": "quad",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 76 "__id__": 82
}, },
"_children": [ "_children": [
{ {
"__id__": 78 "__id__": 84
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 80 "__id__": 86
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3839,13 +4050,13 @@ ...@@ -3839,13 +4050,13 @@
"_name": "paper", "_name": "paper",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 77 "__id__": 83
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 79 "__id__": 85
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3901,7 +4112,7 @@ ...@@ -3901,7 +4112,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 78 "__id__": 84
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3933,7 +4144,7 @@ ...@@ -3933,7 +4144,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 77 "__id__": 83
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3955,11 +4166,11 @@ ...@@ -3955,11 +4166,11 @@
"_name": "quadBase", "_name": "quadBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 70 "__id__": 76
}, },
"_children": [ "_children": [
{ {
"__id__": 82 "__id__": 88
} }
], ],
"_active": true, "_active": true,
...@@ -4017,17 +4228,17 @@ ...@@ -4017,17 +4228,17 @@
"_name": "quad", "_name": "quad",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 81 "__id__": 87
}, },
"_children": [ "_children": [
{ {
"__id__": 83 "__id__": 89
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 85 "__id__": 91
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4083,13 +4294,13 @@ ...@@ -4083,13 +4294,13 @@
"_name": "paper", "_name": "paper",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 82 "__id__": 88
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 84 "__id__": 90
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4145,7 +4356,7 @@ ...@@ -4145,7 +4356,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 83 "__id__": 89
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4177,7 +4388,7 @@ ...@@ -4177,7 +4388,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 82 "__id__": 88
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4199,11 +4410,11 @@ ...@@ -4199,11 +4410,11 @@
"_name": "quadBase", "_name": "quadBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 70 "__id__": 76
}, },
"_children": [ "_children": [
{ {
"__id__": 87 "__id__": 93
} }
], ],
"_active": true, "_active": true,
...@@ -4261,17 +4472,17 @@ ...@@ -4261,17 +4472,17 @@
"_name": "quad", "_name": "quad",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 86 "__id__": 92
}, },
"_children": [ "_children": [
{ {
"__id__": 88 "__id__": 94
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 90 "__id__": 96
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4327,13 +4538,13 @@ ...@@ -4327,13 +4538,13 @@
"_name": "paper", "_name": "paper",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 87 "__id__": 93
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 89 "__id__": 95
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4389,7 +4600,7 @@ ...@@ -4389,7 +4600,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 88 "__id__": 94
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4421,7 +4632,7 @@ ...@@ -4421,7 +4632,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 87 "__id__": 93
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4443,11 +4654,11 @@ ...@@ -4443,11 +4654,11 @@
"_name": "quadBase", "_name": "quadBase",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 70 "__id__": 76
}, },
"_children": [ "_children": [
{ {
"__id__": 92 "__id__": 98
} }
], ],
"_active": true, "_active": true,
...@@ -4505,17 +4716,17 @@ ...@@ -4505,17 +4716,17 @@
"_name": "quad", "_name": "quad",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 91 "__id__": 97
}, },
"_children": [ "_children": [
{ {
"__id__": 93 "__id__": 99
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 95 "__id__": 101
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4571,13 +4782,13 @@ ...@@ -4571,13 +4782,13 @@
"_name": "paper", "_name": "paper",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 92 "__id__": 98
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 94 "__id__": 100
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4633,7 +4844,7 @@ ...@@ -4633,7 +4844,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 93 "__id__": 99
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4665,7 +4876,7 @@ ...@@ -4665,7 +4876,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 92 "__id__": 98
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
......
...@@ -171,6 +171,9 @@ cc.Class({ ...@@ -171,6 +171,9 @@ cc.Class({
pg.view.visible(this.btn_replay, false); pg.view.visible(this.btn_replay, false);
pg.view.touchOn(this.btn_replay, this.onTouchReplay, this); pg.view.touchOn(this.btn_replay, this.onTouchReplay, this);
this.initLayout(); this.initLayout();
this.catBegin().then(() => {
this.catChoice();
});
}, },
initStars() { initStars() {
// this.length = CardManager.getIns().getTestlet(); // this.length = CardManager.getIns().getTestlet();
...@@ -213,104 +216,51 @@ cc.Class({ ...@@ -213,104 +216,51 @@ cc.Class({
pg.view.touchOn(audio, this.onTouchAudio, this); pg.view.touchOn(audio, this.onTouchAudio, this);
}, },
onTouchAudio(touch) { onTouchAudio(touch) {
if (this._gameCode != 0) return resolve('');
if (!this._cantouch) return; if (!this._cantouch) return;
this._cantouch = false; this._cantouch = false;
let item = touch.target.parent; let item = touch.target.parent;
let data = item.data;
this.playAudioAni(item).then(() => { this.playAudioAni(item).then(() => {
this._cantouch = true; this._cantouch = true;
}); });
}, },
onTouchItem(touch, info) { onTouchItem(touch, info) {
if (!this._cantouch) return; return new Promise((resolve, reject) => {
this._cantouch = false; if (this._gameCode != 0) return resolve('');
let item = touch.target; if (!this._cantouch) return resolve('');
let data = item.data; let item = touch.target;
if (data.right) { if (this._successItems.indexOf(item) > -1) return resolve('');
pg.view.visible(pg.view.find(item, 'box'), true); let data = item.data;
this.playSFX("audio_right").then(() => { this._cantouch = false;
//audio 播放的时候动画播放, audio停的时候 动画正好能停下 if (data.right) {
//如果动画停的位置不对,直接强制设置对应的效果 this.catRight();
//下一次播放没有问题即可 pg.view.visible(pg.view.find(item, 'box'), true);
this.playAudioAni(item).then(() => { this.playSFX("audio_right").then(() => {
this._cantouch = true; //audio 播放的时候动画播放, audio停的时候 动画正好能停下
}) //如果动画停的位置不对,直接强制设置对应的效果
}); //下一次播放没有问题即可
} else { this.playAudioAni(item).then(() => {
//失败--抖动效果 this._cantouch = true;
ani.shake(item); this._successItems.push(item);
// this.playAudioAni(item).then(() => { this.catNormal();
// }); this.groupEnd();
this.playSFX("audio_error").then(() => { resolve('');
this._cantouch = true; })
}); });
} } else {
// this._cardTouchItems.push(item); this.catError();
// if (this._cardTouchItems.length == 2) { //失败--抖动效果
// let item0 = this._cardTouchItems[0]; ani.shake(item);
// let item1 = this._cardTouchItems[1]; this.playSFX("audio_error").then(() => {
// //检测重复点击 取消选中 this.playAudioAni(item).then(() => {
// if (item0.data && item1.data && item0.data.cardId == item1.data.cardId) { this._cantouch = true;
// pg.view.visible(pg.view.find(item, 'box'), false); this.catNormal();
// this._cantouch = true; resolve('');
// } else if (item0.data && item1.data && item0.data.cardDid == item1.data.cardDid) { });
// //成功--变小 消失 });
// this._successItems.push(item0); }
// this._successItems.push(item1);
// pg.view.visible(pg.view.find(item, 'box'), true); });
// this.playSFX("audio_choice").then(() => {
// this.playAudioAni(item).then(() => {
// this.createRightAni(cc.v2(item0.x, item0.y));
// this.createRightAni(cc.v2(item1.x, item1.y));
// this.playSFX("audio_right").then(() => {
// this._cantouch = true;
// this.playAudioAni(item0).then(() => {
// this.playAudioAni(item1).then(() => {
// ani.scaleOut(item0);
// ani.scaleOut(item1).then(() => {
// setTimeout(() => {
// this.groupEnd();//判定单组结束
// }, 100);
// });
// pg.view.visible(pg.view.find(item0, 'box'), false);
// pg.view.visible(pg.view.find(item1, 'box'), false);
// });
// });
// });
// })
// });
// } else {
// //失败--抖动效果
// pg.view.visible(pg.view.find(item, 'box'), true);
// this.playSFX("audio_choice").then(() => {
// this.playAudioAni(item).then(() => {
// ani.shake(item0);
// ani.shake(item1);
// pg.view.visible(pg.view.find(item0, 'box'), false);
// pg.view.visible(pg.view.find(item1, 'box'), false);
// this.playSFX("audio_error").then(() => {
// this._cantouch = true;
// });
// });
// });
// }
// this._cardTouchItems.length = 0;
// } else if (this._cardTouchItems.length == 1) {
// //显示选中效果
// pg.view.visible(pg.view.find(item, 'box'), true);
// this.playSFX("audio_choice").then(() => {
// //audio 播放的时候动画播放, audio停的时候 动画正好能停下
// //如果动画停的位置不对,直接强制设置对应的效果
// //下一次播放没有问题即可
// this.playAudioAni(item).then(() => {
// this._cantouch = true;
// })
// });
// } else {
// //异常情况
// this._cardTouchItems.length = 0;
// this._cantouch = true;
// }
}, },
playAudioAni(item) { playAudioAni(item) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -339,37 +289,42 @@ cc.Class({ ...@@ -339,37 +289,42 @@ cc.Class({
}, },
//回合结束 //回合结束
groupEnd() { groupEnd() {
if (this._successItems.length < this._cardPage.length) return; if (this._successItems.length >= CardManager.getIns().allRightNum()) {
if (this._gameCode != 0) return; //判定结束
let code = CardManager.getIns().addPageNum();
if (code == 0) {
this._gameCode = 0;
this.initSingleData();
this.initLayout();
} else if (code == 1) {
this._gameCode = 1;
//播放星星动画 然后下一页
this.playSFX("audio_bigStar");
this.createStarAni().then(() => {
this._gameCode = 0;
this.initSingleData();
this.initLayout();
})
} else if (code == 2) {
this._gameCode = 2; this._gameCode = 2;
//播放星星动画 然后结束 this.catFinish();
this.playSFX("audio_bigStar");
this.playSFX("audio_sahua");
this.createStarAni().then(() => { })
this.createFireworkAni().then(() => {
//gameOver
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish();
pg.view.visible(this.btn_replay, true);
})
} }
// if (this._successItems.length < this._cardPage.length) return;
// if (this._gameCode != 0) return;
// let code = CardManager.getIns().addPageNum();
// if (code == 0) {
// this._gameCode = 0;
// this.initSingleData();
// this.initLayout();
// } else if (code == 1) {
// this._gameCode = 1;
// //播放星星动画 然后下一页
// this.playSFX("audio_bigStar");
// this.createStarAni().then(() => {
// this._gameCode = 0;
// this.initSingleData();
// this.initLayout();
// })
// } else if (code == 2) {
// this._gameCode = 2;
// //播放星星动画 然后结束
// this.playSFX("audio_bigStar");
// this.playSFX("audio_sahua");
// this.createStarAni().then(() => { })
// this.createFireworkAni().then(() => {
// //gameOver
// // 游戏结束时需要调用这个方法通知系统作业完成
// onHomeworkFinish();
// pg.view.visible(this.btn_replay, true);
// })
// }
}, },
createRightAni(pos) { createRightAni(pos) {
// let right = pg.view.find(this, 'right'); // let right = pg.view.find(this, 'right');
...@@ -420,8 +375,10 @@ cc.Class({ ...@@ -420,8 +375,10 @@ cc.Class({
if (!audioSource) return resolve(); if (!audioSource) return resolve();
let audioClip = audioSource.clip; let audioClip = audioSource.clip;
if (!audioClip) return resolve(); if (!audioClip) return resolve();
cc.audioEngine.play(audioClip, false, 1); let id = cc.audioEngine.play(audioClip, false, 1);
resolve(''); cc.audioEngine.setFinishCallback(id, () => {
resolve('');
})
}); });
}, },
length, length,
...@@ -572,4 +529,49 @@ cc.Class({ ...@@ -572,4 +529,49 @@ cc.Class({
return quadBase; return quadBase;
}, },
catBegin() {
return new Promise((resolve, reject) => {
this._cantouch = false;
let cat = pg.view.find(this, "cat");
pg.view.playDragonBone(cat, "begin");
pg.audio.playAudioByUrl(CardManager.getIns().getAudio()).then(() => {
resolve('');
});
});
},
catChoice() {
return new Promise((resolve, reject) => {
this.playSFX("mao_choice").then(() => {
let items = this._cardLayout.children;
let item = items.filter(it => {
return it.data.cardId == 0
})[0];
this._cantouch = true;
this.onTouchItem({ target: item }).then(() => {
resolve('');
})
});
});
},
catFinish() {
return new Promise((resolve, reject) => {
let cat = pg.view.find(this, "cat");
pg.view.playDragonBone(cat, "finish");
this.playSFX("mao_right").then(() => {
});
});
},
catRight() {
let cat = pg.view.find(this, "cat");
pg.view.playDragonBone(cat, "right");
},
catError() {
let cat = pg.view.find(this, "cat");
pg.view.playDragonBone(cat, "wrong");
},
catNormal() {
let cat = pg.view.find(this, "cat");
pg.view.playDragonBone(cat, "normal");
}
}); });
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