Commit 28a68d4b authored by 李维's avatar 李维

Bug fix

parent 8fa6c8cc
......@@ -77,7 +77,7 @@
<div class="section-title" >
正确选项
<div style="text-align: center; float: right;">
<button nz-button nzType="primary" (click)="addChoice(item.correct)" [disabled]="(item.correct.length + item.incorrect.length)>=25" >
<button nz-button nzType="primary" (click)="addChoice(item.correct)" [disabled]="(item.correct.length + item.incorrect.length)>=30" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加
</button>
......@@ -96,6 +96,14 @@
</nz-radio-group>
</div>
</div>
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
音频
</div>
<div style="flex:5">
<app-audio-recorder [audioUrl]="choiceItem.audio_url" (audioUploaded)="onUploadSuccessByItem($event, choiceItem, 'audio_url')" ></app-audio-recorder>
</div>
</div>
<div *ngIf="choiceItem.type=='Text'" style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
文字
......@@ -114,14 +122,6 @@
</div>
</div>
</div>
<!-- <div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
音频
</div>
<div style="flex:5">
<app-audio-recorder [audioUrl]="choiceItem.audio_url" (audioUploaded)="onUploadSuccessByItem($event, choiceItem, 'audio_url')" ></app-audio-recorder>
</div>
</div> -->
<button *ngIf="item.correct.length>1" style="margin-top: 10px; position: absolute; bottom: 10px; right: 10px;;" nz-button nzType="danger" (click)="deleteChoice(item.correct, choiceIndex)" >
<span>删除此选项</span>
</button>
......@@ -133,7 +133,7 @@
<div class="section-title" >
错误选项
<div style="text-align: center; float: right;">
<button nz-button nzType="primary" (click)="addChoice(item.incorrect)" [disabled]="(item.correct.length + item.incorrect.length)>=25" >
<button nz-button nzType="primary" (click)="addChoice(item.incorrect)" [disabled]="(item.correct.length + item.incorrect.length)>=30" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加
</button>
......
......@@ -243,8 +243,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
"width": 160,
"height": 80
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -348,8 +348,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 180,
"height": 50.4
"width": 165,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -360,7 +360,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
1,
0,
0,
0,
......
......@@ -15,6 +15,9 @@
"_children": [
{
"__id__": 2
},
{
"__id__": 76
}
],
"_active": false,
......@@ -90,28 +93,34 @@
"__id__": 29
},
{
"__id__": 30
"__id__": 32
},
{
"__id__": 31
"__id__": 33
},
{
"__id__": 32
"__id__": 34
},
{
"__id__": 45
"__id__": 35
},
{
"__id__": 38
},
{
"__id__": 51
}
],
"_active": true,
"_components": [
{
"__id__": 67
"__id__": 73
},
{
"__id__": 68
"__id__": 74
},
{
"__id__": 69
"__id__": 75
}
],
"_prefab": null,
......@@ -201,7 +210,7 @@
"array": [
0,
0,
268.7709893503001,
497.96460717605225,
0,
0,
0,
......@@ -1356,7 +1365,7 @@
},
{
"__type__": "cc.Node",
"_name": "btn_back",
"_name": "btn_start",
"_objFlags": 0,
"_parent": {
"__id__": 2
......@@ -1366,7 +1375,7 @@
"__id__": 27
}
],
"_active": false,
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
......@@ -1379,8 +1388,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 73,
"height": 77
"width": 366,
"height": 256
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1391,8 +1400,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-579.157,
306.802,
0,
46.761,
0,
0,
0,
......@@ -1414,11 +1423,11 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "5cAnBTFXhPU7oIB44aVStp"
"_id": "358dwWbvlJHZb527oRm1Kn"
},
{
"__type__": "cc.Node",
"_name": "btn_back",
"_name": "btn_start",
"_objFlags": 0,
"_parent": {
"__id__": 26
......@@ -1441,8 +1450,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 73,
"height": 77
"width": 366,
"height": 256
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1476,7 +1485,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d7XCBOEh9L4Y4YJkiLgTb6"
"_id": "acxUZGcnRI4LYg51BH+HDV"
},
{
"__type__": "cc.Sprite",
......@@ -1494,7 +1503,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "eb12dc27-5940-4032-990f-25286dd0a8e0"
"__uuid__": "0ddfe260-a85c-425a-9cca-5e6e5c516d31"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1508,17 +1517,21 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "07xz/l54xOPJlrregfnv2w"
"_id": "15xd2XiyVJ7IcZAx0uR1ct"
},
{
"__type__": "cc.Node",
"_name": "bubble_group",
"_name": "btn_back",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_children": [
{
"__id__": 30
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
......@@ -1531,8 +1544,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"width": 73,
"height": 77
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1543,8 +1556,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
-579.157,
306.802,
0,
0,
0,
......@@ -1566,18 +1579,22 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "46xoK5kedLqrzwmjoCmiDn"
"_id": "5cAnBTFXhPU7oIB44aVStp"
},
{
"__type__": "cc.Node",
"_name": "star_group",
"_name": "btn_back",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 31
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -1589,8 +1606,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 73,
"height": 77
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1602,7 +1619,7 @@
"ctor": "Float64Array",
"array": [
0,
-500,
0,
0,
0,
0,
......@@ -1624,11 +1641,43 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "86ZqOQZkxD5L0y9H+unQec"
"_id": "d7XCBOEh9L4Y4YJkiLgTb6"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "eb12dc27-5940-4032-990f-25286dd0a8e0"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "07xz/l54xOPJlrregfnv2w"
},
{
"__type__": "cc.Node",
"_name": "score_group",
"_name": "bubble_group",
"_objFlags": 0,
"_parent": {
"__id__": 2
......@@ -1647,8 +1696,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1659,7 +1708,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
600,
0,
0,
0,
0,
......@@ -1682,35 +1731,16 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "98siPBSYBPIre9IkAmH4s4"
"_id": "46xoK5kedLqrzwmjoCmiDn"
},
{
"__type__": "cc.Node",
"_name": "RibbonNodeBase",
"_name": "star_group",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 33
},
{
"__id__": 35
},
{
"__id__": 37
},
{
"__id__": 39
},
{
"__id__": 41
},
{
"__id__": 43
}
],
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
......@@ -1736,8 +1766,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1161.91,
-743.57,
0,
-500,
0,
0,
0,
......@@ -1759,35 +1789,31 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "ccyu+/5JVCCrcCSiC2bxgc"
"_id": "86ZqOQZkxD5L0y9H+unQec"
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_name": "score_group",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 34
}
],
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 251,
"g": 197,
"b": 13,
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36,
"height": 24
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1798,8 +1824,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
600,
0,
100,
0,
0,
0,
......@@ -1821,52 +1847,23 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "275666BphI7Ii5/DyIE/3T"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a3cc433a-f6df-4267-a442-c0ac476ebaae"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b0iTaTuF5Aibax6SWByeSw"
"_id": "98siPBSYBPIre9IkAmH4s4"
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_name": "layout",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 36
},
{
"__id__": 37
}
],
"_prefab": null,
......@@ -1874,26 +1871,26 @@
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 82,
"b": 82,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36,
"height": 24
"width": 50,
"height": 500
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"x": 1,
"y": 1
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
59.33,
620,
280,
0,
0,
0,
......@@ -1915,67 +1912,109 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "5cyn1Q9IdMLa3Rdd7op5/F"
"_id": "19vRdBex9BAb93G0pBtXmm"
},
{
"__type__": "cc.Sprite",
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a3cc433a-f6df-4267-a442-c0ac476ebaae"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
"_layoutSize": {
"__type__": "cc.Size",
"width": 300,
"height": 200
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d8hsv8doBNqogJznvFDeVD"
"_resize": 0,
"_N$layoutType": 3,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 1,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 10,
"_N$spacingY": 10,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 1,
"_N$affectedByScale": true,
"_id": "d7qfw/i0NJ9pB/snc366FC"
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"_parent": {
"__id__": 32
"node": {
"__id__": 35
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 38
}
],
"_prefab": null,
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 0,
"_right": 20,
"_top": 80,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "91DO4r9z9MhKN2RWrnT2WM"
},
{
"__type__": "cc.Node",
"_name": "RibbonNodeBase",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 39
},
{
"__id__": 41
},
{
"__id__": 43
},
{
"__id__": 45
},
{
"__id__": 47
},
{
"__id__": 49
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 83,
"g": 212,
"b": 244,
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36,
"height": 24
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1986,8 +2025,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
19.413,
-1161.91,
-743.57,
0,
0,
0,
......@@ -2009,46 +2048,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "aayLz++7FMOKDAsGfNq+Hv"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a3cc433a-f6df-4267-a442-c0ac476ebaae"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "24HJp8wMRK6Je6dFbBcyeU"
"_id": "ccyu+/5JVCCrcCSiC2bxgc"
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
......@@ -2061,9 +2068,9 @@
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 157,
"g": 250,
"b": 36,
"r": 251,
"g": 197,
"b": 13,
"a": 255
},
"_contentSize": {
......@@ -2081,7 +2088,7 @@
"ctor": "Float64Array",
"array": [
0,
-18.998,
100,
0,
0,
0,
......@@ -2103,7 +2110,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "19jFGBul5MeK3v8fxb/ReX"
"_id": "275666BphI7Ii5/DyIE/3T"
},
{
"__type__": "cc.Sprite",
......@@ -2135,14 +2142,14 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a7ATPjIw1GFak6DVsyv8mi"
"_id": "b0iTaTuF5Aibax6SWByeSw"
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
......@@ -2175,7 +2182,7 @@
"ctor": "Float64Array",
"array": [
0,
-50.63,
59.33,
0,
0,
0,
......@@ -2197,7 +2204,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c7py2bHzRKYauGI2c9CICw"
"_id": "5cyn1Q9IdMLa3Rdd7op5/F"
},
{
"__type__": "cc.Sprite",
......@@ -2229,14 +2236,14 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "faSGrYOCpG04UkXP0txKaQ"
"_id": "d8hsv8doBNqogJznvFDeVD"
},
{
"__type__": "cc.Node",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 32
"__id__": 38
},
"_children": [],
"_active": true,
......@@ -2269,7 +2276,7 @@
"ctor": "Float64Array",
"array": [
0,
-86.782,
19.413,
0,
0,
0,
......@@ -2291,7 +2298,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "ba5x2+ECZEFbh5y0GOyem5"
"_id": "aayLz++7FMOKDAsGfNq+Hv"
},
{
"__type__": "cc.Sprite",
......@@ -2323,41 +2330,35 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "0acDv6o9tIxKMFRqOZf/Ca"
"_id": "24HJp8wMRK6Je6dFbBcyeU"
},
{
"__type__": "cc.Node",
"_name": "res",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 38
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 46
},
{
"__id__": 47
},
{
"__id__": 50
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"r": 157,
"g": 250,
"b": 36,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 36,
"height": 24
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2369,7 +2370,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
-18.998,
0,
0,
0,
......@@ -2391,31 +2392,67 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "0aAzbH6R1E+6AmGRrkKa5O"
"_id": "19jFGBul5MeK3v8fxb/ReX"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a3cc433a-f6df-4267-a442-c0ac476ebaae"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a7ATPjIw1GFak6DVsyv8mi"
},
{
"__type__": "cc.Node",
"_name": "font",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 45
"__id__": 38
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 48
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"g": 82,
"b": 82,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 36,
"height": 24
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2427,7 +2464,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
-50.63,
0,
0,
0,
......@@ -2449,35 +2486,67 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "9bLfcYeeNKrr524vzWchiM"
"_id": "c7py2bHzRKYauGI2c9CICw"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a3cc433a-f6df-4267-a442-c0ac476ebaae"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "faSGrYOCpG04UkXP0txKaQ"
},
{
"__type__": "cc.Node",
"_name": "img",
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 45
"__id__": 38
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 48
"__id__": 50
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"r": 83,
"g": 212,
"b": 244,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 36,
"height": 24
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2489,7 +2558,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
-86.782,
0,
0,
0,
......@@ -2511,22 +2580,60 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "53LUHHG2pEr79fyrvazXJs"
"_id": "ba5x2+ECZEFbh5y0GOyem5"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a3cc433a-f6df-4267-a442-c0ac476ebaae"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "0acDv6o9tIxKMFRqOZf/Ca"
},
{
"__type__": "cc.Node",
"_name": "icon",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 47
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
"_children": [
{
"__id__": 49
"__id__": 52
},
{
"__id__": 53
},
{
"__id__": 56
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -2538,8 +2645,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 138,
"height": 141
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2573,69 +2680,16 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "1blU2OArJIfoC9XfupGxJG"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 48
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM"
"_id": "0aAzbH6R1E+6AmGRrkKa5O"
},
{
"__type__": "cc.Node",
"_name": "audio",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 45
"__id__": 51
},
"_children": [
{
"__id__": 51
},
{
"__id__": 53
},
{
"__id__": 55
},
{
"__id__": 57
},
{
"__id__": 59
},
{
"__id__": 61
},
{
"__id__": 63
},
{
"__id__": 65
}
],
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
......@@ -2684,22 +2738,22 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b823DIVC9L+Ihc3T9Bt7m3"
"_id": "9bLfcYeeNKrr524vzWchiM"
},
{
"__type__": "cc.Node",
"_name": "btn",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 51
},
"_children": [],
"_active": true,
"_components": [
"_children": [
{
"__id__": 52
"__id__": 54
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -2746,38 +2800,20 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3d0p0/uJZJIoRva5Br2iqv"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
},
"_enabled": true,
"_clip": {
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "0adN50f61DlbmppsPkOnjX"
"_id": "53LUHHG2pEr79fyrvazXJs"
},
{
"__type__": "cc.Node",
"_name": "出现",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 53
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 54
"__id__": 55
}
],
"_prefab": null,
......@@ -2791,8 +2827,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 138,
"height": 141
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2826,40 +2862,71 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "deg4shwwBHAYgAuxgXnEaG"
"_id": "1blU2OArJIfoC9XfupGxJG"
},
{
"__type__": "cc.AudioSource",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 53
"__id__": 54
},
"_enabled": true,
"_clip": {
"__uuid__": "2c94b99a-83f0-4445-85d6-90033de17743"
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "8eYfvHm7lGSoHEq1lPIITv"
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM"
},
{
"__type__": "cc.Node",
"_name": "正确",
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 51
},
"_children": [],
"_active": true,
"_components": [
"_children": [
{
"__id__": 56
"__id__": 57
},
{
"__id__": 59
},
{
"__id__": 61
},
{
"__id__": 63
},
{
"__id__": 65
},
{
"__id__": 67
},
{
"__id__": 69
},
{
"__id__": 71
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -2906,32 +2973,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d4DR4D2kRCtYS61JHz16On"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
},
"_enabled": true,
"_clip": {
"__uuid__": "c9219c80-862c-4336-adfb-b7853a2edec4"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "19cbOsmtxMN6RCLWX4N6zc"
"_id": "b823DIVC9L+Ihc3T9Bt7m3"
},
{
"__type__": "cc.Node",
"_name": "错误泡泡爆炸",
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 56
},
"_children": [],
"_active": true,
......@@ -2986,7 +3035,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "34v1iA+MpBBpPamhDzkIKZ"
"_id": "3d0p0/uJZJIoRva5Br2iqv"
},
{
"__type__": "cc.AudioSource",
......@@ -2997,21 +3046,21 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "5a9ddd25-4e45-485d-b859-75225b66a5f3"
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "b8wGFT089FlL6taclNT/sm"
"_id": "0adN50f61DlbmppsPkOnjX"
},
{
"__type__": "cc.Node",
"_name": "按钮",
"_name": "出现",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 56
},
"_children": [],
"_active": true,
......@@ -3066,7 +3115,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "554D1gTPZCsKFgjQaeuxPV"
"_id": "deg4shwwBHAYgAuxgXnEaG"
},
{
"__type__": "cc.AudioSource",
......@@ -3077,21 +3126,21 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "8b0de757-146b-48c6-9bbe-c9d2e8a82d62"
"__uuid__": "2c94b99a-83f0-4445-85d6-90033de17743"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "4fdIjYCWtGQ4ClpxyODru+"
"_id": "8eYfvHm7lGSoHEq1lPIITv"
},
{
"__type__": "cc.Node",
"_name": "大星",
"_name": "正确",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 56
},
"_children": [],
"_active": true,
......@@ -3146,7 +3195,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "10u9lPXRJKgpfQv5jljZUC"
"_id": "d4DR4D2kRCtYS61JHz16On"
},
{
"__type__": "cc.AudioSource",
......@@ -3156,6 +3205,246 @@
"__id__": 61
},
"_enabled": true,
"_clip": {
"__uuid__": "c9219c80-862c-4336-adfb-b7853a2edec4"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "19cbOsmtxMN6RCLWX4N6zc"
},
{
"__type__": "cc.Node",
"_name": "错误泡泡爆炸",
"_objFlags": 0,
"_parent": {
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 64
}
],
"_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": "34v1iA+MpBBpPamhDzkIKZ"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
},
"_enabled": true,
"_clip": {
"__uuid__": "5a9ddd25-4e45-485d-b859-75225b66a5f3"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "b8wGFT089FlL6taclNT/sm"
},
{
"__type__": "cc.Node",
"_name": "按钮",
"_objFlags": 0,
"_parent": {
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 66
}
],
"_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": "554D1gTPZCsKFgjQaeuxPV"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
},
"_enabled": true,
"_clip": {
"__uuid__": "8b0de757-146b-48c6-9bbe-c9d2e8a82d62"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "4fdIjYCWtGQ4ClpxyODru+"
},
{
"__type__": "cc.Node",
"_name": "大星",
"_objFlags": 0,
"_parent": {
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 68
}
],
"_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": "10u9lPXRJKgpfQv5jljZUC"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
},
"_enabled": true,
"_clip": {
"__uuid__": "f50e6692-cafe-4ae1-8020-82d9e17ee7cc"
},
......@@ -3171,13 +3460,13 @@
"_name": "题数",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 64
"__id__": 70
}
],
"_prefab": null,
......@@ -3233,7 +3522,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
"__id__": 69
},
"_enabled": true,
"_clip": {
......@@ -3251,13 +3540,13 @@
"_name": "撒花",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 66
"__id__": 72
}
],
"_prefab": null,
......@@ -3313,7 +3602,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
"__id__": 71
},
"_enabled": true,
"_clip": {
......@@ -3388,5 +3677,295 @@
"__uuid__": "22b14cf4-f840-4245-b8f0-191b685e7250"
},
"_id": "e687yyoRBIzZAOVRL8Sseh"
},
{
"__type__": "cc.Node",
"_name": "StarBase",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 77
}
],
"_active": true,
"_components": [
{
"__id__": 81
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 62,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
193.71,
-148.73,
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": "7c7vV3Y6VDlKP3k7Y9od5M"
},
{
"__type__": "cc.Node",
"_name": "Star",
"_objFlags": 0,
"_parent": {
"__id__": 76
},
"_children": [
{
"__id__": 78
}
],
"_active": false,
"_components": [
{
"__id__": 80
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 62,
"height": 69
},
"_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": "aaEgeEy/9Le58AY6Irj3ZF"
},
{
"__type__": "cc.Node",
"_name": "StarBig",
"_objFlags": 0,
"_parent": {
"__id__": 77
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 79
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 278,
"height": 275
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
-0.7071067811865475,
0.7071067811865476,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": -90
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "13WVHWbn5KGo6FWT/3IaSq"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0d4e8ab5-1e48-4a70-b5f3-41ac05264cbf"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "82y0cTRFxIHprqwai0VjA1"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "87136bc7-13f1-4c93-a705-396b8d9281b2"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "21pnYJi1lMw55l+sv/NSKx"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 76
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e3fc5cc3-7007-4f39-a4f7-854a16e06883"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "4bZ7kz+q9EPLyAhsej3lwe"
}
]
\ No newline at end of file
......@@ -24,6 +24,7 @@ export default class GameLogic {
m_stopMoving = false;
m_maxScale = 1;
m_isPlayingAudio = false;
m_sysIntervalId = null;
constructor(formData, systemOption) {
this.g_systemOption = systemOption;
......@@ -53,17 +54,9 @@ export default class GameLogic {
this.resetPosition();
this.addEventLinstener();
if(this.nextQuestion()) {
if(this.g_formData.dataArray.length>1) {
this.initStar()
}
this.g_cartoon.initDragEvent()
this.enableClick("Sysyem_init");
// this.hideAir();
this.systemTick();
this.releaseBubbles()
}
this.g_cartoon.initDragEvent()
this.enableClick("Sysyem_init");
cc.view.setResizeCallback(() => {
this.initBg();
this.resetPosition();
......@@ -75,6 +68,7 @@ export default class GameLogic {
this.g_cartoon.initCartoonElement("audio", this.g_cartoon.getNodeByPath(`Canvas/speaker`));
this.g_cartoon.initCartoonElement("back", this.g_cartoon.getNodeByPath(`Canvas/btn_back/btn_back`));
this.g_cartoon.initCartoonElement("restart", this.g_cartoon.getNodeByPath(`Canvas/btn_restart/btn_restart`));
this.g_cartoon.initCartoonElement("start", this.g_cartoon.getNodeByPath(`Canvas/btn_start/btn_start`));
this.g_cartoon.initCartoonElement("lion", this.g_cartoon.getNodeByPath(`Canvas/lion/DB`));
}
......@@ -129,12 +123,34 @@ export default class GameLogic {
})
})
const btn_start = this.g_cartoon.getCartoonElement("start")
this.g_cartoon.subscribeTouchEvent("start", _=>{
if(!this.g_enableClick) {
return
}
this.g_cartoon.tweenChange(btn_start.node, {scaleX: 0, scaleY: 0}, 0.2, _=>{
this.enableClick("start")
if(this.nextQuestion()) {
if(this.g_formData.dataArray.length>1) {
this.initStar()
}
this.releaseBubbles()
}
})
})
const btn_lion = this.g_cartoon.getCartoonElement("lion")
btn_lion.play = () => {
btn_lion.play = (aniName) => {
if(aniName) {
aniName = "play"
} else {
aniName = "normal"
}
let a = btn_lion.node.getComponent(dragonBones.ArmatureDisplay)
a.playAnimation('play', 1);
a.playAnimation(aniName, 1);
setTimeout(() => {
a.playAnimation('normal', -1);
a.playAnimation(aniName, -1);
}, 3200);
}
......@@ -185,6 +201,16 @@ export default class GameLogic {
}
}
btn_speaker.playAudio = () => {
if(btn_speaker.node.active) {
btn_speaker.startAni()
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestionIndex].audio_url1, ()=>{
this.m_isPlayingAudio = false;
btn_speaker.stopAni();
})
}
}
this.g_cartoon.subscribeTouchEvent("audio", _=>{
if(!this.g_enableClick) {
return
......@@ -195,11 +221,7 @@ export default class GameLogic {
this.g_cartoon.stopAllAudio()
} else {
this.m_isPlayingAudio = true;
btn_speaker.startAni()
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestionIndex].audio_url1, ()=>{
this.m_isPlayingAudio = false;
btn_speaker.stopAni();
})
btn_speaker.playAudio();
}
})
}
......@@ -221,18 +243,25 @@ export default class GameLogic {
this.m_rightAns = 0;
this.m_stopMoving = false;
if(this.g_formData.dataArray.length>1) {
this.cleanScore();
this.initStar();
}
this.nextQuestion()
this.releaseBubbles();
}
resetSystemTick() {
if(this.m_sysIntervalId) {
clearInterval(this.m_sysIntervalId);
this.m_sysIntervalId = null;
}
this.systemTick()
}
systemTick() {
let maxNum = this.m_bubblesAll.length;
let maxX = cc.winSize.width / 2;
let maxY = cc.winSize.height / 2;
setInterval(()=>{
this.m_sysIntervalId = setInterval(()=>{
this.m_bubblesAll.forEach((bubble, index_x)=>{
if(!this.m_stopMoving && bubble.move.enable && !bubble.move.fix) {
bubble.move.x += bubble.move.vX
......@@ -292,70 +321,72 @@ export default class GameLogic {
}
initStar() {
const starGroup = this.g_cartoon.getNodeByPath(`Canvas/star_group`)
const scoreGroup = this.g_cartoon.getNodeByPath(`Canvas/score_group`)
const scoreAll = []
// const starGroup = this.g_cartoon.getNodeByPath(`Canvas/star_group`)
// const scoreGroup = this.g_cartoon.getNodeByPath(`Canvas/score_group`)
// const scoreAll = []
const num = this.g_formData.dataArray.length;
if(num>9) {
scoreGroup.scale = 0.6
}
for(let i=0; i<this.g_formData.dataArray.length; i++) {
const star = cc.instantiate(this.g_systemOption.prefabs.star);
star.parent = starGroup;
this.g_cartoon.setCartoonElement(`star_${i}`, star)
const score = cc.instantiate(this.g_systemOption.prefabs.score);
score.parent = scoreGroup;
this.g_cartoon.setCartoonElement(`score_${i}`, score)
scoreAll.push(score)
}
let startY = (scoreAll.length * 66) / 2;
scoreAll.forEach((score, index)=>{
score.y = startY
startY -= 66 + 10
})
// if(num>9) {
// scoreGroup.scale = 0.6
// }
// for(let i=0; i<this.g_formData.dataArray.length; i++) {
// const star = cc.instantiate(this.g_systemOption.prefabs.star);
// star.parent = starGroup;
// this.g_cartoon.setCartoonElement(`star_${i}`, star)
// const score = cc.instantiate(this.g_systemOption.prefabs.score);
// score.parent = scoreGroup;
// this.g_cartoon.setCartoonElement(`score_${i}`, score)
// scoreAll.push(score)
// }
// let startY = (scoreAll.length * 66) / 2;
// scoreAll.forEach((score, index)=>{
// score.y = startY
// startY -= 66 + 10
// })
this.setStart(num)
}
addStar(callback) {
if(this.g_formData.dataArray.length<=1) {
if(callback) {
callback()
}
return;
}
const star = this.g_cartoon.getCartoonElement(`star_${this.m_currentQuestionIndex}`);
const score = this.g_cartoon.getCartoonElement(`score_${this.m_currentQuestionIndex}`);
const score_b = score.node.getChildByName("b")
const starGroup = this.g_cartoon.getNodeByPath(`Canvas/star_group`);
const scoreGroup = this.g_cartoon.getNodeByPath(`Canvas/score_group`);
this.g_cartoon.playAudio("大星")
this.g_cartoon.tweenChange(star.node, {y: 380}, 1, ()=>{
setTimeout(() => {
const worldPos = starGroup.convertToWorldSpaceAR(cc.v2(star.node.x, star.node.y));
const localPos = scoreGroup.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
star.node.parent = scoreGroup;
star.node.x = localPos.x;
star.node.y = localPos.y;
this.g_cartoon.tweenChange(star.node, {x: score.node.x, y: score.node.y, scale: 0.2}, 0.8, _=>{
score_b.active = true;
score_b.scaleX = 0;
score_b.scaleY = 0;
star.node.destroy();
this.g_cartoon.tweenChange(score_b, {scale: 1}, 0.1, _=>{
if(callback) {
callback()
}
})
})
}, 1000);
})
}
// addStar(callback) {
// if(this.g_formData.dataArray.length<=1) {
// if(callback) {
// callback()
// }
// return;
// }
// const star = this.g_cartoon.getCartoonElement(`star_${this.m_currentQuestionIndex}`);
// const score = this.g_cartoon.getCartoonElement(`score_${this.m_currentQuestionIndex}`);
// const score_b = score.node.getChildByName("b")
// const starGroup = this.g_cartoon.getNodeByPath(`Canvas/star_group`);
// const scoreGroup = this.g_cartoon.getNodeByPath(`Canvas/score_group`);
// this.g_cartoon.playAudio("大星")
// this.g_cartoon.tweenChange(star.node, {y: 380}, 1, ()=>{
// setTimeout(() => {
// const worldPos = starGroup.convertToWorldSpaceAR(cc.v2(star.node.x, star.node.y));
// const localPos = scoreGroup.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
// star.node.parent = scoreGroup;
// star.node.x = localPos.x;
// star.node.y = localPos.y;
// this.g_cartoon.tweenChange(star.node, {x: score.node.x, y: score.node.y, scale: 0.2}, 0.8, _=>{
// score_b.active = true;
// score_b.scaleX = 0;
// score_b.scaleY = 0;
// star.node.destroy();
// this.g_cartoon.tweenChange(score_b, {scale: 1}, 0.1, _=>{
// if(callback) {
// callback()
// }
// })
// })
// }, 1000);
// })
// }
nextQuestion() {
this.m_currentQuestionIndex++;
......@@ -373,12 +404,14 @@ export default class GameLogic {
}
const btn_lion = this.g_cartoon.getCartoonElement("lion")
btn_lion.play();
btn_lion.play(false);
const rightNum = this.g_formData.dataArray[this.m_currentQuestionIndex].correct.length;
const wrongNum = this.g_formData.dataArray[this.m_currentQuestionIndex].incorrect.length;
const bubbleNum = rightNum + wrongNum;
const bubbleParent = this.g_cartoon.getNodeByPath(`Canvas/bubble_group`)
this.m_bubblesAll = JSON.parse(JSON.stringify([]));
this.m_rightAns = 0;
const scale = bubbleNum<=15?1:0.7;
for(let i=0; i<bubbleNum; i++) {
......@@ -434,7 +467,7 @@ export default class GameLogic {
if(item.type == 'Image') {
let image = bubble.node.getChildByName("image_container")
image.active = true;
this.g_cartoon.mountImageToNode(item.image_url, image, 120, 120)
this.g_cartoon.mountImageToNode(item.image_url, image, 160, 80)
} else {
let text = bubble.node.getChildByName("text_container")
text.active = true;
......@@ -457,31 +490,51 @@ export default class GameLogic {
const btn_speaker = this.g_cartoon.getCartoonElement("audio");
this.g_cartoon.stopAllAudio();
btn_speaker.stopAni();
if(bubble.isRight) {
this.g_cartoon.playAudio("正确");
this.g_cartoon.playAudio("正确")
clickBubble.boom().then(_=>{
bubble.node.active = false;
this.m_rightAns++;
if(this.m_rightAns>=rightNum) {
this.m_stopMoving = true;
this.addStar(_=>{
this.destroyBubbles().then(_=>{
if(!this.nextQuestion()) {
this.endGame()
} else {
this.releaseBubbles();
}
})
if(item.audio_url) {
this.g_cartoon.playAudio(item.audio_url, _=>{
this.m_rightAns++;
if(this.m_rightAns>=rightNum) {
this.m_stopMoving = true;
this.showStar(this.m_currentQuestionIndex, _=>{
this.destroyBubbles().then(_=>{
if(!this.nextQuestion()) {
this.endGame()
} else {
this.releaseBubbles();
}
})
})
} else {
this.enableClick("Destroy")
}
})
} else {
this.enableClick("Destroy")
this.m_rightAns++;
if(this.m_rightAns>=rightNum) {
this.m_stopMoving = true;
this.showStar(this.m_currentQuestionIndex, _=>{
this.destroyBubbles().then(_=>{
if(!this.nextQuestion()) {
this.endGame()
} else {
this.releaseBubbles();
}
})
})
} else {
this.enableClick("Destroy")
}
}
})
} else {
this.m_stopMoving = true;
clickBubble.shake(_=>{
this.m_stopMoving = false;
this.resetSystemTick();
this.enableClick(`bubble_${i}`)
})
this.g_cartoon.playAudio("错误泡泡爆炸");
......@@ -532,8 +585,8 @@ export default class GameLogic {
]
let scaleIndex = this.m_bubblesAll.length<=15?0:1;
let startx = cc.winSize.width / 2
let starty = -cc.winSize.height / 2
let startx = cc.winSize.width / 2 - 220
let starty = -cc.winSize.height / 2 + 200
const vArr = [
{vX: -0.5, vY: 0.5 }, {vX: 0.5, vY: -0.5 }, {vX: -0.5, vY: -0.5 }, {vX: 0.5, vY: 0.5 }
]
......@@ -560,25 +613,25 @@ export default class GameLogic {
pAll.push(_p)
}
})
const btn_lion = this.g_cartoon.getCartoonElement("lion")
btn_lion.play(true);
const btn_speaker = this.g_cartoon.getCartoonElement("audio");
Promise.all(pAll).then(_=>{
this.m_stopMoving = false;
btn_lion.play(false);
btn_speaker.playAudio();
this.m_bubblesAll.forEach(bubble=>{
if(!bubble.move.fix) {
bubble.move.enable = true;
}
})
this.resetSystemTick();
})
}
cleanScore() {
const scoreGroup = this.g_cartoon.getNodeByPath(`Canvas/score_group`);
const scoreAll = []
for(let i=0; i<this.g_formData.dataArray.length; i++) {
const _score = this.g_cartoon.getCartoonElement(`score_${i}`)
_score.node.destroy();
}
}
fireworks() {
this.showFireworks(
cc.find('Canvas/background/background'),
......@@ -688,6 +741,108 @@ export default class GameLogic {
setStart(number) {
if (!number) {
number = 0;
}
let length = number;
const starLayout = cc.find('Canvas/layout');
starLayout.removeAllChildren();
const paddingY = starLayout.getComponent(cc.Layout).spacingY;
for (let i = 0; i < length; i++) {
const starBase = cc.instantiate(cc.find('StarBase'));
starBase.name = `starBase_${i}`;
starBase.scale = this.Between(0.5, (starLayout.height / length - paddingY) / starBase.height, 1);
starBase.parent = starLayout;
}
}
showStar(currentStarIdx, callback) {
if (!currentStarIdx) {
currentStarIdx = 0;
}
const starBase = cc.find(`Canvas/layout/starBase_${currentStarIdx}`);
if (!starBase) {
return;
}
const star = starBase.getChildByName('Star');
const starBig = star.getChildByName('StarBig');
starBig.scale = 1;
star.active = true;
star.scaleX = 0.7 / starBase.scale;
star.scaleY = 1 / starBase.scale;
star.angle = 90;
const canvas = cc.find('Canvas');
const startPos = this.exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 2));
const middlePos = this.exchangeNodePos(star.parent, canvas, cc.v2(0, -canvas.height / 4));
star.x = startPos.x;
star.y = startPos.y - starBig.height;
console.log('middlePos = ' + JSON.stringify(middlePos));
const time = 1;
cc.tween(star)
.to(0.3, { y: middlePos.y + 80 }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y + 40, scaleX: 1.2 / starBase.scale, scaleY: 0.8 / starBase.scale }, { easing: 'quadOut' })
.to(0.1, { y: middlePos.y, scaleX: 1 / starBase.scale, scaleY: 1 / starBase.scale }, { easing: 'quadOut' })
.delay(0.1)
.to(0.8, { angle: -720, scale: 1 })
.start();
cc.tween(star)
.delay(0.6)
.to(0.8, { x: 0 }, { easing: 'quadIn' })
.start();
cc.tween(star)
.delay(0.6)
.to(0.8, { y: 0 }, { easing: 'quadOut' })
.start();
cc.tween(starBig)
.delay(0.6)
.to(0.8, { scale: 0 }, { easing: 'quadOut' })
.call(() => {
// this.checkGameEnd();
if(callback) {
callback()
}
})
.start();
}
Between(a, b, c) {
return [a, b, c].sort()[1];
}
exchangeNodePos(targetNode, baseNode, basePos) {
return targetNode.convertToNodeSpaceAR(baseNode.convertToWorldSpaceAR(cc.v2(basePos.x, basePos.y)));
}
// Common function
maskLayer = null;
initMaskLayer() {
......
......@@ -112,17 +112,17 @@ cc.Class({
getData(cb) {
cb(this.getDefaultData());
// cc.loader.load( "http://www.datalist.com.cn:8060/json/DataKey_dfzx_ppp", function( err, res) {
// if(err) {
// cb(this.getDefaultData());
// } else {
// cb(JSON.parse(res));
// }
// console.log(res)
// if(err) {
// cb(this.getDefaultData());
// } else {
// cb(JSON.parse(res));
// }
// });
},
getDefaultData() {
const dataJson = '{"pic_url":"http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png","pic_url_2":"http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png","text":"This is a test label.","audio_url":"http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"}'
const dataJson = '{ "contentObj": { "version": "1.0", "key": "DataKey_dfzx_ppp", "question": {}, "dataArray": [ { "correct": [ { "type": "Text", "text": "Demo", "audio_url": "", "image_url": "" } ], "incorrect": [], "audio_url1": "" } ] } }'
const data = JSON.parse(dataJson);
return data;
},
......
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