Commit 5880e010 authored by Tt's avatar Tt

修改效果

parent 9d26ddce
...@@ -19,6 +19,7 @@ export default class Game { ...@@ -19,6 +19,7 @@ export default class Game {
public playerScore: number; public playerScore: number;
public robotScore: number; public robotScore: number;
public robotLevel: number; public robotLevel: number;
public audioing: boolean;
constructor() { constructor() {
// //
this.start = false; this.start = false;
...@@ -34,6 +35,7 @@ export default class Game { ...@@ -34,6 +35,7 @@ export default class Game {
this.playerScore = null; this.playerScore = null;
this.robotScore = null; this.robotScore = null;
this.robotLevel = null; this.robotLevel = null;
this.audioing = false;
} }
public start: boolean; public start: boolean;
reset() { reset() {
...@@ -41,6 +43,7 @@ export default class Game { ...@@ -41,6 +43,7 @@ export default class Game {
this.lists = JSON.parse(JSON.stringify(this.data.list)); this.lists = JSON.parse(JSON.stringify(this.data.list));
this.pause = false; this.pause = false;
this.isRobot = false; this.isRobot = false;
this.audioing = false;
this.playerScore = 0; this.playerScore = 0;
this.robotScore = 0; this.robotScore = 0;
let rand = Math.random(); let rand = Math.random();
...@@ -57,11 +60,29 @@ export default class Game { ...@@ -57,11 +60,29 @@ export default class Game {
this.robotScore++; this.robotScore++;
} else { } else {
this.playerScore++; this.playerScore++;
}
this.nowStem.stem.times--; this.nowStem.stem.times--;
}
// if (this.nowStem.stem.times == 0) {
// return false;
// }
this.nowStem = null; this.nowStem = null;
return true;
}
get nowAudio() {
if (!this.start) return null;
if (this.nowStem) {
return this.nowStem.stem.audio_url;
}
//每一个企鹅是什么应该在这边获取。
let items: any = this.lists.filter(li => {
return li.stem.times > 0;
});
let item = items[Math.floor(Math.random() * items.length)]
this.nowStem = item;
return item.stem.audio_url;
} }
get nowList() { get nowList() {
if (!this.start) return null;
if (this.nowStem) { if (this.nowStem) {
return this.nowStem.list; return this.nowStem.list;
} }
......
...@@ -99,19 +99,22 @@ ...@@ -99,19 +99,22 @@
"__id__": 118 "__id__": 118
}, },
{ {
"__id__": 133 "__id__": 128
},
{
"__id__": 143
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 146 "__id__": 156
}, },
{ {
"__id__": 147 "__id__": 157
}, },
{ {
"__id__": 148 "__id__": 158
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2788,7 +2791,7 @@ ...@@ -2788,7 +2791,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-440.099, -440.099,
371.11, 454.34,
0, 0,
0, 0,
0, 0,
...@@ -3077,7 +3080,7 @@ ...@@ -3077,7 +3080,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
440.098, 440.098,
366.352, 449.582,
0, 0,
0, 0,
0, 0,
...@@ -3362,7 +3365,7 @@ ...@@ -3362,7 +3365,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
378.111, 461.341,
0, 0,
0, 0,
0, 0,
...@@ -5590,7 +5593,7 @@ ...@@ -5590,7 +5593,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "start", "_name": "btn_laba",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
...@@ -5600,22 +5603,22 @@ ...@@ -5600,22 +5603,22 @@
"__id__": 119 "__id__": 119
}, },
{ {
"__id__": 122 "__id__": 121
},
{
"__id__": 125
}, },
{ {
"__id__": 128 "__id__": 123
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 131 "__id__": 125
}, },
{ {
"__id__": 132 "__id__": 126
},
{
"__id__": 127
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5629,8 +5632,8 @@ ...@@ -5629,8 +5632,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1920, "width": 86,
"height": 1200 "height": 92
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5641,8 +5644,8 @@ ...@@ -5641,8 +5644,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 843.341,
0, -501.895,
0, 0,
0, 0,
0, 0,
...@@ -5664,11 +5667,11 @@ ...@@ -5664,11 +5667,11 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "bciJZwgN9McL3SW6uDD3ur" "_id": "aeN4qHCIJA+4fnizPyLZkv"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "panel_gray", "_name": "btn_laba2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 118 "__id__": 118
...@@ -5678,24 +5681,21 @@ ...@@ -5678,24 +5681,21 @@
"_components": [ "_components": [
{ {
"__id__": 120 "__id__": 120
},
{
"__id__": 121
} }
], ],
"_prefab": null, "_prefab": null,
"_opacity": 150, "_opacity": 255,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 0, "r": 255,
"g": 0, "g": 255,
"b": 0, "b": 255,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 5500, "width": 86,
"height": 5500 "height": 92
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5729,7 +5729,7 @@ ...@@ -5729,7 +5729,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "94g2oQF8RFU4gQYnpj/+kX" "_id": "5d4q6muZ9G7JQWjG87sezz"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -5747,10 +5747,10 @@ ...@@ -5747,10 +5747,10 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" "__uuid__": "fda205f8-4abd-4ce6-b9ac-4b6736f1296b"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 0, "_sizeMode": 1,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5761,21 +5761,11 @@ ...@@ -5761,21 +5761,11 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "1eqQv9cwhIG5uSVdoTklf8" "_id": "55xPWUh7pP1rQkVrN2Vb/g"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 119
},
"_enabled": true,
"_id": "62GJ00ACNO+oRV9v3v/AoP"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bg_vs", "_name": "btn_laba3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 118 "__id__": 118
...@@ -5784,10 +5774,7 @@ ...@@ -5784,10 +5774,7 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 123 "__id__": 122
},
{
"__id__": 124
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5801,8 +5788,8 @@ ...@@ -5801,8 +5788,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1920, "width": 86,
"height": 415 "height": 92
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5814,7 +5801,7 @@ ...@@ -5814,7 +5801,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
17.912, 0,
0, 0,
0, 0,
0, 0,
...@@ -5836,14 +5823,14 @@ ...@@ -5836,14 +5823,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "6c5UXVY7BE14qx43Is/d60" "_id": "1fOTDzHJhIB6sbmdLj4Mgz"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 122 "__id__": 121
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -5854,10 +5841,10 @@ ...@@ -5854,10 +5841,10 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "15931dc2-2400-4794-9b4b-629eb9087922" "__uuid__": "303081dc-74dd-4e51-8e5a-fe9c5f8ada9b"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 0, "_sizeMode": 1,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5868,38 +5855,11 @@ ...@@ -5868,38 +5855,11 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "b0Snkarl1N8JsD232dqD1Z" "_id": "6ekH9qHVNAwa+JudvhN9J3"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 122
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 40,
"_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": 1920,
"_originalHeight": 0,
"_id": "87cDNwoMlEjaMmYIyRRnKh"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_restart", "_name": "btn_laba4",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 118 "__id__": 118
...@@ -5908,10 +5868,7 @@ ...@@ -5908,10 +5868,7 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 126 "__id__": 124
},
{
"__id__": 127
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5925,8 +5882,8 @@ ...@@ -5925,8 +5882,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 568, "width": 86,
"height": 361 "height": 92
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -5937,8 +5894,8 @@ ...@@ -5937,8 +5894,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
7.492, 0,
42.454, 0,
0, 0,
0, 0,
0, 0,
...@@ -5960,14 +5917,14 @@ ...@@ -5960,14 +5917,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "ecxZsv1wVOmKOH7RD0nKWs" "_id": "92YElUOqRE864t9meL7gG5"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 125 "__id__": 123
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -5978,7 +5935,7 @@ ...@@ -5978,7 +5935,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "cab90ff2-4873-44a5-807d-d024c2b15d10" "__uuid__": "c42e93ab-cedd-42b6-b2ae-21ee1fec673f"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -5992,14 +5949,56 @@ ...@@ -5992,14 +5949,56 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "f4B4bc1cRK6r/aX5uOfPra" "_id": "8fHRv1wllLSJUMgKrz9Glq"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 118
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5271a7b2-583c-41cc-b714-0876bb83ffb1"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c3c2fvu3VI0LqK0O2pFar5"
},
{
"__type__": "c069dFpsA1GGqEcveV6tsSf",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 118
},
"_enabled": true,
"_id": "35v9fQwSJBlrQ+PHaOFzn7"
}, },
{ {
"__type__": "cc.Button", "__type__": "cc.Button",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 125 "__id__": 118
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -6060,25 +6059,38 @@ ...@@ -6060,25 +6059,38 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 125 "__id__": 118
}, },
"_id": "c3xMGcQ7tMQbslVP/3vxhi" "_id": "9atp9HiRdMKLVwYAMBN7B3"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_start", "_name": "start",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 118 "__id__": 2
}, },
"_children": [], "_children": [
"_active": false,
"_components": [
{ {
"__id__": 129 "__id__": 129
}, },
{ {
"__id__": 130 "__id__": 132
},
{
"__id__": 135
},
{
"__id__": 138
}
],
"_active": true,
"_components": [
{
"__id__": 141
},
{
"__id__": 142
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -6092,8 +6104,8 @@ ...@@ -6092,8 +6104,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 568, "width": 1920,
"height": 361 "height": 1200
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -6104,8 +6116,8 @@ ...@@ -6104,8 +6116,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
7.567, 0,
43.583, 0,
0, 0,
0, 0,
0, 0,
...@@ -6127,52 +6139,515 @@ ...@@ -6127,52 +6139,515 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "54LjD8yitPIJiyyU+++gVn" "_id": "bciJZwgN9McL3SW6uDD3ur"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Node",
"_name": "", "_name": "panel_gray",
"_objFlags": 0, "_objFlags": 0,
"node": { "_parent": {
"__id__": 128 "__id__": 128
}, },
"_enabled": true, "_children": [],
"_materials": [ "_active": false,
"_components": [
{ {
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" "__id__": 130
},
{
"__id__": 131
} }
], ],
"_srcBlendFactor": 770, "_prefab": null,
"_dstBlendFactor": 771, "_opacity": 150,
"_spriteFrame": { "_color": {
"__uuid__": "1ef15b6f-5b61-41fd-bd98-1053b236e38b" "__type__": "cc.Color",
}, "r": 0,
"_type": 0, "g": 0,
"_sizeMode": 1, "b": 0,
"_fillType": 0, "a": 255
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
}, },
"_fillStart": 0, "_contentSize": {
"_fillRange": 0, "__type__": "cc.Size",
"_isTrimmedMode": true, "width": 5500,
"_atlas": null, "height": 5500
"_id": "7dYzDpAcRG9JFwyw9r6gqW"
}, },
{ "_anchorPoint": {
"__type__": "cc.Button", "__type__": "cc.Vec2",
"_name": "", "x": 0.5,
"_objFlags": 0, "y": 0.5
"node": {
"__id__": 128
}, },
"_enabled": true, "_trs": {
"_normalMaterial": null, "__type__": "TypedArray",
"_grayMaterial": null, "ctor": "Float64Array",
"duration": 0.1, "array": [
"zoomScale": 1.2, 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": "94g2oQF8RFU4gQYnpj/+kX"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 129
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1eqQv9cwhIG5uSVdoTklf8"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 129
},
"_enabled": true,
"_id": "62GJ00ACNO+oRV9v3v/AoP"
},
{
"__type__": "cc.Node",
"_name": "bg_vs",
"_objFlags": 0,
"_parent": {
"__id__": 128
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 133
},
{
"__id__": 134
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 415
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
17.912,
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": "6c5UXVY7BE14qx43Is/d60"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 132
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "15931dc2-2400-4794-9b4b-629eb9087922"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b0Snkarl1N8JsD232dqD1Z"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 132
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 40,
"_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": 1920,
"_originalHeight": 0,
"_id": "87cDNwoMlEjaMmYIyRRnKh"
},
{
"__type__": "cc.Node",
"_name": "btn_restart",
"_objFlags": 0,
"_parent": {
"__id__": 128
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 136
},
{
"__id__": 137
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 568,
"height": 361
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
7.492,
42.454,
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": "ecxZsv1wVOmKOH7RD0nKWs"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 135
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "cab90ff2-4873-44a5-807d-d024c2b15d10"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f4B4bc1cRK6r/aX5uOfPra"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 135
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 135
},
"_id": "c3xMGcQ7tMQbslVP/3vxhi"
},
{
"__type__": "cc.Node",
"_name": "btn_start",
"_objFlags": 0,
"_parent": {
"__id__": 128
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 139
},
{
"__id__": 140
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 568,
"height": 361
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
7.567,
43.583,
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": "54LjD8yitPIJiyyU+++gVn"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 138
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1ef15b6f-5b61-41fd-bd98-1053b236e38b"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7dYzDpAcRG9JFwyw9r6gqW"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 138
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [], "clickEvents": [],
"_N$interactable": true, "_N$interactable": true,
"_N$enableAutoGrayEffect": false, "_N$enableAutoGrayEffect": false,
...@@ -6234,7 +6709,7 @@ ...@@ -6234,7 +6709,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 118 "__id__": 128
}, },
"_enabled": true, "_enabled": true,
"_id": "8dnGyEHlNHdq1T5QVoLE/I" "_id": "8dnGyEHlNHdq1T5QVoLE/I"
...@@ -6244,7 +6719,7 @@ ...@@ -6244,7 +6719,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 118 "__id__": 128
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -6275,22 +6750,22 @@ ...@@ -6275,22 +6750,22 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 134 "__id__": 144
}, },
{ {
"__id__": 136 "__id__": 146
}, },
{ {
"__id__": 138 "__id__": 148
}, },
{ {
"__id__": 140 "__id__": 150
}, },
{ {
"__id__": 142 "__id__": 152
}, },
{ {
"__id__": 144 "__id__": 154
} }
], ],
"_active": true, "_active": true,
...@@ -6348,13 +6823,13 @@ ...@@ -6348,13 +6823,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 133 "__id__": 143
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 135 "__id__": 145
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -6410,7 +6885,7 @@ ...@@ -6410,7 +6885,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 134 "__id__": 144
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -6442,13 +6917,13 @@ ...@@ -6442,13 +6917,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 133 "__id__": 143
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 137 "__id__": 147
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -6504,7 +6979,7 @@ ...@@ -6504,7 +6979,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 136 "__id__": 146
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -6536,13 +7011,13 @@ ...@@ -6536,13 +7011,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 133 "__id__": 143
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 139 "__id__": 149
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -6598,7 +7073,7 @@ ...@@ -6598,7 +7073,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 138 "__id__": 148
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -6630,13 +7105,13 @@ ...@@ -6630,13 +7105,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 133 "__id__": 143
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 141 "__id__": 151
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -6692,7 +7167,7 @@ ...@@ -6692,7 +7167,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 140 "__id__": 150
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -6724,13 +7199,13 @@ ...@@ -6724,13 +7199,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 133 "__id__": 143
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 143 "__id__": 153
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -6786,7 +7261,7 @@ ...@@ -6786,7 +7261,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 142 "__id__": 152
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -6818,13 +7293,13 @@ ...@@ -6818,13 +7293,13 @@
"_name": "bg_sahua", "_name": "bg_sahua",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 133 "__id__": 143
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 145 "__id__": 155
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -6880,7 +7355,7 @@ ...@@ -6880,7 +7355,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 144 "__id__": 154
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
......
...@@ -67,9 +67,15 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -67,9 +67,15 @@ export default class NewClass extends MyCocosSceneComponent {
this.log("test onGameStart") this.log("test onGameStart")
Game.getIns().reset(); Game.getIns().reset();
this.scheduleOnce(() => { this.scheduleOnce(() => {
pg.event.emit("game_start_loop") // pg.event.emit("game_start_loop")
pg.event.emit("play_stem");
}, 2) }, 2)
this.schedule(this.updatePlayer, 1);
} }
updatePlayer() {
pg.event.emit("player_point_update");
}
private touchData: any; private touchData: any;
onTouchRight(data) { onTouchRight(data) {
pg.event.emit("player_point_update"); pg.event.emit("player_point_update");
...@@ -83,10 +89,18 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -83,10 +89,18 @@ export default class NewClass extends MyCocosSceneComponent {
onSpeakScueess() { onSpeakScueess() {
//执行后续的动作。 //执行后续的动作。
this.touchData && this.touchData.cbSuccess && this.touchData.cbSuccess(); this.touchData && this.touchData.cbSuccess && this.touchData.cbSuccess();
Game.getIns().addScore() Game.getIns().addScore();
pg.event.emit("player_point_update"); pg.event.emit("player_point_update");
//跳转下一个或者结束了。
if (Game.getIns().isOver) { if (Game.getIns().isOver) {
this.gameOver(); this.gameOver();
} else {
//播放题干后继续
pg.event.emit("game_stop_loop");
this.scheduleOnce(() => {
//播放题干然后继续
pg.event.emit("play_stem");
}, 0.4)
} }
} }
onSpeakFail() { onSpeakFail() {
......
...@@ -61,10 +61,9 @@ export default class NewClass extends cc.Component { ...@@ -61,10 +61,9 @@ export default class NewClass extends cc.Component {
}).start(); }).start();
cc.tween(this.panel_text).to(0.2, { opacity: 255 }).delay(2.4).to(0.2, { opacity: 0 }).start(); cc.tween(this.panel_text).to(0.2, { opacity: 255 }).delay(2.4).to(0.2, { opacity: 0 }).start();
let point = 6 - Game.getIns().robotLevel;// let wait = Game.getIns().robotLevel * 0.65;//
if (data.right == "1") { if (data.right == "1") {
if (Math.random() * point >= 3) { let time = 0.4 + wait + Math.random() * 2;
let time = 0.4 + Math.random() * 2 + Game.getIns().robotLevel * 0.65;
this.scheduleOnce(() => { this.scheduleOnce(() => {
if (this.touched) return; if (this.touched) return;
Game.getIns().isRobot = true; Game.getIns().isRobot = true;
...@@ -72,7 +71,6 @@ export default class NewClass extends cc.Component { ...@@ -72,7 +71,6 @@ export default class NewClass extends cc.Component {
}, time); }, time);
} }
} }
}
showSuccessAni() { showSuccessAni() {
Game.getIns().pause = false; Game.getIns().pause = false;
pg.hw.playLocalAudio("right"); pg.hw.playLocalAudio("right");
...@@ -111,7 +109,10 @@ export default class NewClass extends cc.Component { ...@@ -111,7 +109,10 @@ export default class NewClass extends cc.Component {
if (Game.getIns().isRobot) { if (Game.getIns().isRobot) {
if (data.right == "1") { if (data.right == "1") {
pg.view.visible(this.right, true); pg.view.visible(this.right, true);
pg.hw.playLocalAudio("right"); Game.getIns().audioing = true;
pg.hw.playLocalAudio("right").then(() => {
Game.getIns().audioing = false;
})
pg.view.playDBAnimation(this.right, "newAnimation", 1); pg.view.playDBAnimation(this.right, "newAnimation", 1);
pg.event.emit("item_touch_right", data); pg.event.emit("item_touch_right", data);
} }
...@@ -122,13 +123,17 @@ export default class NewClass extends cc.Component { ...@@ -122,13 +123,17 @@ export default class NewClass extends cc.Component {
Game.getIns().pause = true; Game.getIns().pause = true;
//正确 //正确
pg.view.visible(this.right, true); pg.view.visible(this.right, true);
pg.hw.playLocalAudio("right"); Game.getIns().audioing = true;
pg.hw.playLocalAudio("right").then(() => {
Game.getIns().audioing = false;
})
pg.view.playDBAnimation(this.right, "newAnimation", 1); pg.view.playDBAnimation(this.right, "newAnimation", 1);
data.cbSuccess = () => { data.cbSuccess = () => {
//执行 //执行
this.showSuccessAni(); this.showSuccessAni();
} }
data.cbFailed = () => { data.cbFailed = () => {
Game.getIns().pause = false;
this.showErrorAni(); this.showErrorAni();
} }
pg.event.emit("item_touch_right", data); pg.event.emit("item_touch_right", data);
......
...@@ -24,11 +24,15 @@ export default class NewClass extends cc.Component { ...@@ -24,11 +24,15 @@ export default class NewClass extends cc.Component {
onLoad() { onLoad() {
pg.event.on("game_start_loop", () => { this.startLoop() }) pg.event.on("game_start_loop", () => { this.startLoop() })
pg.event.on("game_stop_loop", () => { this.stopLoop() })
} }
protected onDestroy(): void { protected onDestroy(): void {
pg.event.off("game_start_loop"); pg.event.off("game_start_loop");
pg.event.off("game_stop_loop");
this.unschedule(this.createItem);
} }
startLoop() { startLoop() {
//播放一次题干后继续
this.lastId = []; this.lastId = [];
this.unschedule(this.createItem); this.unschedule(this.createItem);
this.schedule(this.createItem, 1); this.schedule(this.createItem, 1);
...@@ -36,6 +40,7 @@ export default class NewClass extends cc.Component { ...@@ -36,6 +40,7 @@ export default class NewClass extends cc.Component {
pauseLoop() { pauseLoop() {
} }
stopLoop() { stopLoop() {
this.unschedule(this.createItem);
} }
private lastId: Array<number>; private lastId: Array<number>;
createItem() { createItem() {
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.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
import Game from "./Game";
import pg from "./pg";
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
// LIFE-CYCLE CALLBACKS:
onLoad() {
pg.view.touchOn(this.node, this.onTouchLaba, this);
pg.event.on("play_stem", () => {
this.onTouchLaba().then(() => {
pg.event.emit("game_start_loop")
})
});
}
protected onDestroy(): void {
this.unschedule(this.labaAni);
pg.event.off("play_stem");
}
onTouchLaba() {
return new Promise((resolve, reject) => {
this.showAni();
pg.audio.playAudioByUrl(Game.getIns().nowAudio).then(() => {
this.stopAni();
resolve('');
})
});
}
private count: number;
showAni() {
this.count = 0;
this.schedule(this.labaAni, 0.1);
}
stopAni() {
this.unschedule(this.labaAni);
this.count = 2;
this.labaAni();
}
labaAni() {
this.count++;
switch (this.count) {
case 0:
pg.view.visible(pg.view.find(this, "btn_laba2"), true);
pg.view.visible(pg.view.find(this, "btn_laba3"), false);
pg.view.visible(pg.view.find(this, "btn_laba4"), false);
break;
case 1:
pg.view.visible(pg.view.find(this, "btn_laba2"), false);
pg.view.visible(pg.view.find(this, "btn_laba3"), true);
pg.view.visible(pg.view.find(this, "btn_laba4"), false);
break;
case 2:
pg.view.visible(pg.view.find(this, "btn_laba2"), false);
pg.view.visible(pg.view.find(this, "btn_laba3"), false);
pg.view.visible(pg.view.find(this, "btn_laba4"), true);
break;
case 3:
pg.view.visible(pg.view.find(this, "btn_laba2"), false);
pg.view.visible(pg.view.find(this, "btn_laba3"), false);
pg.view.visible(pg.view.find(this, "btn_laba4"), false);
this.count = -1;
break;
}
}
// update (dt) {}
}
{
"ver": "1.0.8",
"uuid": "c069d169-b00d-461a-a11c-bde57ab6c49f",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -431,6 +431,17 @@ let pg = { ...@@ -431,6 +431,17 @@ let pg = {
} }
}, },
audio: { audio: {
playAudioByUrl(audio_url) {
return new Promise((resolve, reject) => {
if (!audio_url) return resolve(null);
cc.assetManager.loadRemote(audio_url, (err, audioClip: any) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(audioId, () => {
resolve(audioClip);
});
});
});
},
stopAudio(audioId) { stopAudio(audioId) {
if (!audioId) return; if (!audioId) return;
cc.audioEngine.stopEffect(audioId); cc.audioEngine.stopEffect(audioId);
......
...@@ -31,13 +31,13 @@ export default class NewClass extends cc.Component { ...@@ -31,13 +31,13 @@ export default class NewClass extends cc.Component {
let icon_player = pg.view.find(this.player, "icon_player"); let icon_player = pg.view.find(this.player, "icon_player");
let icon_player_dice = pg.view.find(this.player, "icon_player_dice"); let icon_player_dice = pg.view.find(this.player, "icon_player_dice");
pg.view.visible(icon_player, Game.getIns().isRobot); pg.view.visible(icon_player, Game.getIns().isRobot);
pg.view.visible(icon_player_dice, !Game.getIns().isRobot); pg.view.visible(icon_player_dice, !Game.getIns().isRobot && Game.getIns().audioing);
} }
updateRobot() { updateRobot() {
let icon_robot = pg.view.find(this.robot, "icon_robot"); let icon_robot = pg.view.find(this.robot, "icon_robot");
let icon_robot_dice = pg.view.find(this.robot, "icon_robot_dice"); let icon_robot_dice = pg.view.find(this.robot, "icon_robot_dice");
pg.view.visible(icon_robot, !Game.getIns().isRobot); pg.view.visible(icon_robot, !Game.getIns().isRobot);
pg.view.visible(icon_robot_dice, Game.getIns().isRobot); pg.view.visible(icon_robot_dice, Game.getIns().isRobot && Game.getIns().audioing);
} }
updateScore() { updateScore() {
let score = pg.view.find(this, "score"); let score = pg.view.find(this, "score");
......
...@@ -55,7 +55,11 @@ export default class NewClass extends cc.Component { ...@@ -55,7 +55,11 @@ export default class NewClass extends cc.Component {
} }
private tryCount: number; private tryCount: number;
private val: string; private val: string;
private tipId: any;
open(value) { open(value) {
pg.hw.playLocalAudio("tips").then(id => {
this.tipId = id;
})
this.val = value; this.val = value;
pg.view.visible(this.btn_audio_start, true); pg.view.visible(this.btn_audio_start, true);
pg.view.visible(this.btn_audio_stop, false); pg.view.visible(this.btn_audio_stop, false);
...@@ -72,6 +76,10 @@ export default class NewClass extends cc.Component { ...@@ -72,6 +76,10 @@ export default class NewClass extends cc.Component {
} }
onTouchStart() { onTouchStart() {
if (this.tipId) {
pg.audio.stopAudio(this.tipId);
this.tipId = null;
}
pg.view.playDBAnimation(this.speak_ske, "newAnimation", 0); pg.view.playDBAnimation(this.speak_ske, "newAnimation", 0);
pg.view.visible(this.btn_audio_start, false); pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, true); pg.view.visible(this.btn_audio_stop, true);
...@@ -96,7 +104,7 @@ export default class NewClass extends cc.Component { ...@@ -96,7 +104,7 @@ export default class NewClass extends cc.Component {
"fluency": 60, "fluency": 60,
"rhythm": 90, "rhythm": 90,
"kernel_version": "5.2.4", "kernel_version": "5.2.4",
"overall": 75, "overall": 75,//75
"integrity": 100, "integrity": 100,
"duration": "6.779", "duration": "6.779",
"rear_tone": "fall", "rear_tone": "fall",
......
export const defaultData = { export const defaultData = { "list": [{ "id": 0, "stem": { "times": 5, "audio_url": "http://staging-teach.cdn.ireadabc.com/a5fb06cfafd5c74d143d00b8cafbed2e.mp3" }, "list": [{ "id": 2001, "text": "door", "pic": "", "type": "text", "right": "1" }, { "id": 2002, "text": "ijfs", "pic": "", "type": "text", "right": "1" }, { "id": 2003, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/d0414e91f8519ece2909b15cedf23f08.png", "type": "pic", "right": "0" }, { "id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/ae28013163687fee4124a85261a7b48f.png", "type": "pic", "right": "0" }] }, { "id": 1, "stem": { "times": 4, "audio_url": "http://staging-teach.cdn.ireadabc.com/b6400b57190622a34f1320d3e118db60.mp3" }, "list": [{ "id": 2001, "text": "window", "pic": "", "type": "text", "right": "1" }, { "id": 2002, "text": "winxa", "pic": "", "type": "text", "right": "0" }, { "id": 2003, "text": "indowa", "pic": "", "type": "text", "right": "0" }, { "id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/444d37818d6075febadc6052af5f995b.png", "type": "pic", "right": "0" }] }] }
"list": \ No newline at end of file
[
{
"id": 0,
"stem": {
"times": 3
},
"list": [
{
"id": 2001, "text": "door", "pic": "", "type": "text", "right": "1"
},
{
"id": 2002, "text": "ijfs", "pic": "", "type": "text", "right": "0"
},
{
"id": 2003, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/d0414e91f8519ece2909b15cedf23f08.png", "type": "pic", "right": "0"
},
{
"id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/ae28013163687fee4124a85261a7b48f.png", "type": "pic", "right": "0"
}
]
},
{
"id": 1,
"stem": {
"times": 2
},
"list":
[
{
"id": 2001, "text": "window", "pic": "", "type": "text", "right": "1"
},
{
"id": 2002, "text": "winxa", "pic": "", "type": "text", "right": "0"
},
{
"id": 2003, "text": "indowa", "pic": "", "type": "text", "right": "0"
},
{
"id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/444d37818d6075febadc6052af5f995b.png", "type": "pic", "right": "0"
}
]
}]
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "0ae9eec8-3fe1-4a85-9c87-08d5a796a207",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1e095c56-46f0-4e2a-85fa-ef8bdc7b21ff",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 86,
"height": 92,
"platformSettings": {},
"subMetas": {
"btn_laba": {
"ver": "1.0.4",
"uuid": "5271a7b2-583c-41cc-b714-0876bb83ffb1",
"rawTextureUuid": "1e095c56-46f0-4e2a-85fa-ef8bdc7b21ff",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 86,
"height": 92,
"rawWidth": 86,
"rawHeight": 92,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a4f62460-7b97-4d17-8887-f5c04a2dd3d5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 86,
"height": 92,
"platformSettings": {},
"subMetas": {
"btn_laba2": {
"ver": "1.0.4",
"uuid": "fda205f8-4abd-4ce6-b9ac-4b6736f1296b",
"rawTextureUuid": "a4f62460-7b97-4d17-8887-f5c04a2dd3d5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 86,
"height": 92,
"rawWidth": 86,
"rawHeight": 92,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9685ac68-3d7e-4df9-b9df-57f53ed31d76",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 86,
"height": 92,
"platformSettings": {},
"subMetas": {
"btn_laba3": {
"ver": "1.0.4",
"uuid": "303081dc-74dd-4e51-8e5a-fe9c5f8ada9b",
"rawTextureUuid": "9685ac68-3d7e-4df9-b9df-57f53ed31d76",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 86,
"height": 92,
"rawWidth": 86,
"rawHeight": 92,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1b2204f0-d0b2-4895-9e1c-60aed6ccece2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 86,
"height": 92,
"platformSettings": {},
"subMetas": {
"btn_laba4": {
"ver": "1.0.4",
"uuid": "c42e93ab-cedd-42b6-b2ae-21ee1fec673f",
"rawTextureUuid": "1b2204f0-d0b2-4895-9e1c-60aed6ccece2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 86,
"height": 92,
"rawWidth": 86,
"rawHeight": 92,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "laba",
"_objFlags": 0,
"_native": "",
"_duration": 0.7,
"sample": 30,
"speed": 1,
"wrapMode": 2,
"curveData": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "ba7e8674-648a-49ee-9f6f-2903e1beac33"
}
},
{
"frame": 0.16666666666666666,
"value": {
"__uuid__": "3edc4858-a88c-40ec-8e42-b8c2fb8f96c6"
}
},
{
"frame": 0.3333333333333333,
"value": {
"__uuid__": "eec66180-f070-4a45-a310-084145e34d85"
}
},
{
"frame": 0.5,
"value": {
"__uuid__": "1e09c00a-5260-4099-bbae-b9c6340aeb3f"
}
},
{
"frame": 0.6666666666666666,
"value": {
"__uuid__": "ba7e8674-648a-49ee-9f6f-2903e1beac33"
}
}
]
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "37674e36-47b4-45c9-b5f4-a7ac1205bcac",
"subMetas": {}
}
\ No newline at end of file
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
<div style="border: 1px solid #000;margin:10px;padding:20px"> <div style="border: 1px solid #000;margin:10px;padding:20px">
<h1>第 {{ i+1 }}题</h1> <h1>第 {{ i+1 }}题</h1>
<hr /> <hr />
<h2>回答正确次数【小朋友和机器人回答正确均消耗次数】</h2> <h2>题干音频</h2>
<app-audio-recorder [audioUrl]="li.stem.audio_url" (audioUploaded)="onAudioUploadSuccess($event, li)">
</app-audio-recorder>
<h2>回答正确次数</h2>
<input type="number" nz-input [(ngModel)]="li.stem.times" (blur)="save()"> <input type="number" nz-input [(ngModel)]="li.stem.times" (blur)="save()">
<hr /> <hr />
<div style="display: flex;flex-wrap: wrap;"> <div style="display: flex;flex-wrap: wrap;">
......
...@@ -84,6 +84,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -84,6 +84,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
return { return {
id: this.item.list.length, id: this.item.list.length,
stem: { stem: {
audio_url: "",
times: 1, times: 1,
}, },
list: [{ list: [{
...@@ -149,8 +150,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -149,8 +150,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存音频数据 * 储存音频数据
* @param e * @param e
*/ */
onAudioUploadSuccess(e, key) { onAudioUploadSuccess(e, li) {
this.item[key] = e.url; li.stem.audio_url = e.url;
// this.item[key] = e.url;
this.save(); this.save();
} }
......
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