Commit 2bd86de7 authored by 李维's avatar 李维

dev commit

parent 5735033e
......@@ -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)>=5" >
<button nz-button nzType="primary" (click)="addChoice(item.correct)" [disabled]="(item.correct.length + item.incorrect.length)>=25" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加
</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)>=5" >
<button nz-button nzType="primary" (click)="addChoice(item.incorrect)" [disabled]="(item.correct.length + item.incorrect.length)>=25" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加
</button>
......
{
"ver": "2.0.1",
"uuid": "2c94b99a-83f0-4445-85d6-90033de17743",
"downloadMode": 0,
"duration": 1.28,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f50e6692-cafe-4ae1-8020-82d9e17ee7cc",
"downloadMode": 0,
"duration": 1.776327,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "8b0de757-146b-48c6-9bbe-c9d2e8a82d62",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "0eb532a7-392b-480e-b1dc-95f9d1ec3d43",
"downloadMode": 0,
"duration": 4.04898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "c9219c80-862c-4336-adfb-b7853a2edec4",
"downloadMode": 0,
"duration": 0.470204,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "5a9ddd25-4e45-485d-b859-75225b66a5f3",
"downloadMode": 0,
"duration": 0.261224,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "16f053c4-cd27-439d-a7f7-beb6812f238d",
"downloadMode": 0,
"duration": 2.115917,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1",
"uuid": "b7fe7dd8-88c4-4197-a5fd-c255b47ce270",
"subMetas": {}
}
\ No newline at end of file
......@@ -16,15 +16,22 @@
"_name": "bubble_0",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_children": [
{
"__id__": 2
},
{
"__id__": 5
}
],
"_active": true,
"_components": [
{
"__id__": 2
"__id__": 8
}
],
"_prefab": {
"__id__": 3
"__id__": 9
},
"_opacity": 255,
"_color": {
......@@ -73,6 +80,222 @@
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "image_container",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "ff427172-05bc-4907-a9d6-859d14218f60"
},
"fileId": "3eDLNiCRNNZJMm5RAEFHhO",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "text_container",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 29,
"b": 140,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 180,
"height": 50.4
},
"_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": ""
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": false,
"_string": "",
"_N$string": "",
"_fontSize": 56,
"_lineHeight": 56,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "b7fe7dd8-88c4-4197-a5fd-c255b47ce270"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "ff427172-05bc-4907-a9d6-859d14218f60"
},
"fileId": "2akJJN5Z5PBojIxLlwAnDB",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
......@@ -111,7 +334,7 @@
"__id__": 1
},
"asset": {
"__id__": 0
"__uuid__": "ff427172-05bc-4907-a9d6-859d14218f60"
},
"fileId": "54TnCPh51Nt4I/6fuKOZwD",
"sync": false
......
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "score",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 5
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 8
},
"_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": ""
},
{
"__type__": "cc.Node",
"_name": "a",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_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": [
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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_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": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "2ehQ1DzLhCRJdyBzgQ88Aj",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "b",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_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": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "41kL1szANO2ouMr08mlJoi",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "a44F9OiL5Eo6Ir9dAPn8RP",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "22b14cf4-f840-4245-b8f0-191b685e7250",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "star",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 3
},
"_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,
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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_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": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c1jVDqsUJFhIGH8PNlPXNc",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "2592d02f-4ff3-4cd6-805b-c204271d4e87",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -81,28 +81,34 @@
"__id__": 11
},
{
"__id__": 14
"__id__": 15
},
{
"__id__": 17
"__id__": 18
},
{
"__id__": 20
"__id__": 21
},
{
"__id__": 21
"__id__": 22
},
{
"__id__": 23
},
{
"__id__": 24
}
],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 46
},
{
"__id__": 32
"__id__": 47
},
{
"__id__": 33
"__id__": 48
}
],
"_prefab": null,
......@@ -192,7 +198,7 @@
"array": [
0,
0,
269.27790755516406,
342.18828767032636,
0,
0,
0,
......@@ -545,10 +551,10 @@
}
],
"_armatureName": "Armature",
"_animationName": "",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": 1,
"premultipliedAlpha": false,
"_armatureKey": "e3d39ead-9ae5-45df-a908-d9fee96d1c97#8b7f8e75-240d-4acb-9738-aa9bcc9e582e",
"_accTime": 0,
......@@ -564,7 +570,7 @@
"__uuid__": "8b7f8e75-240d-4acb-9738-aa9bcc9e582e"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
......@@ -584,7 +590,11 @@
}
],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 14
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -727,6 +737,76 @@
"_atlas": null,
"_id": "51bEV4gBJCSKFOzH4S+tEC"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_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__": 11
},
"_id": "84H6w8D3FJB6TcFxn9bsAh"
},
{
"__type__": "cc.Node",
"_name": "btn_restart",
......@@ -736,10 +816,10 @@
},
"_children": [
{
"__id__": 15
"__id__": 16
}
],
"_active": false,
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
......@@ -791,16 +871,16 @@
},
{
"__type__": "cc.Node",
"_name": "btn_start",
"_name": "btn_restart",
"_objFlags": 0,
"_parent": {
"__id__": 14
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
"__id__": 17
}
],
"_prefab": null,
......@@ -814,7 +894,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 366,
"width": 436,
"height": 256
},
"_anchorPoint": {
......@@ -833,8 +913,8 @@
0,
0,
1,
1,
1,
0,
0,
1
]
},
......@@ -849,14 +929,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "79ijcN3CJHyJNwMMxbhJms"
"_id": "8ejTUT7DRLlL2aqC5HZXQL"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 16
},
"_enabled": true,
"_materials": [
......@@ -867,7 +947,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0ddfe260-a85c-425a-9cca-5e6e5c516d31"
"__uuid__": "955b7ad5-9107-4588-8235-d652be51ace1"
},
"_type": 0,
"_sizeMode": 1,
......@@ -881,7 +961,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7bL+rdwa9DbYCZEydqi0T+"
"_id": "73Wsd+3YRI8KwX/EhEiCH3"
},
{
"__type__": "cc.Node",
......@@ -892,7 +972,7 @@
},
"_children": [
{
"__id__": 18
"__id__": 19
}
],
"_active": true,
......@@ -950,13 +1030,13 @@
"_name": "btn_back",
"_objFlags": 0,
"_parent": {
"__id__": 17
"__id__": 18
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 19
"__id__": 20
}
],
"_prefab": null,
......@@ -1012,7 +1092,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
"__id__": 19
},
"_enabled": true,
"_materials": [
......@@ -1072,8 +1152,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
2.661,
2.661,
0,
0,
0,
......@@ -1099,23 +1179,13 @@
},
{
"__type__": "cc.Node",
"_name": "res",
"_name": "star_group",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 22
},
{
"__id__": 25
},
{
"__id__": 28
}
],
"_active": false,
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
......@@ -1141,7 +1211,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
-500,
0,
0,
0,
......@@ -1163,20 +1233,16 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "0aAzbH6R1E+6AmGRrkKa5O"
"_id": "86ZqOQZkxD5L0y9H+unQec"
},
{
"__type__": "cc.Node",
"_name": "font",
"_name": "score_group",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 2
},
"_children": [
{
"__id__": 23
}
],
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
......@@ -1202,7 +1268,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
600,
0,
0,
0,
......@@ -1225,22 +1291,28 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "9bLfcYeeNKrr524vzWchiM"
"_id": "98siPBSYBPIre9IkAmH4s4"
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
"_children": [
{
"__id__": 24
"__id__": 25
},
{
"__id__": 26
},
{
"__id__": 29
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -1287,50 +1359,76 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cfMLGsq0BMhJARv+ySMAxS"
"_id": "0aAzbH6R1E+6AmGRrkKa5O"
},
{
"__type__": "cc.Label",
"_name": "",
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"node": {
"__id__": 23
"_parent": {
"__id__": 24
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": true,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY"
"_children": [],
"_active": true,
"_components": [],
"_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": "9bLfcYeeNKrr524vzWchiM"
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 24
},
"_children": [
{
"__id__": 26
"__id__": 27
}
],
"_active": true,
......@@ -1388,13 +1486,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 25
"__id__": 26
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 27
"__id__": 28
}
],
"_prefab": null,
......@@ -1450,7 +1548,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
"__id__": 27
},
"_enabled": true,
"_materials": [],
......@@ -1478,11 +1576,32 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 24
},
"_children": [
{
"__id__": 29
"__id__": 30
},
{
"__id__": 32
},
{
"__id__": 34
},
{
"__id__": 36
},
{
"__id__": 38
},
{
"__id__": 40
},
{
"__id__": 42
},
{
"__id__": 44
}
],
"_active": true,
......@@ -1540,13 +1659,13 @@
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 31
}
],
"_prefab": null,
......@@ -1602,7 +1721,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 30
},
"_enabled": true,
"_clip": {
......@@ -1616,28 +1735,588 @@
"_id": "0adN50f61DlbmppsPkOnjX"
},
{
"__type__": "cc.Canvas",
"_name": "",
"__type__": "cc.Node",
"_name": "出现",
"_objFlags": 0,
"node": {
"__id__": 2
"_parent": {
"__id__": 29
},
"_enabled": true,
"_designResolution": {
"_children": [],
"_active": true,
"_components": [
{
"__id__": 33
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"width": 0,
"height": 0
},
"_fitWidth": false,
"_fitHeight": false,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"_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": "deg4shwwBHAYgAuxgXnEaG"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
},
"_enabled": true,
"_clip": {
"__uuid__": "2c94b99a-83f0-4445-85d6-90033de17743"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "8eYfvHm7lGSoHEq1lPIITv"
},
{
"__type__": "cc.Node",
"_name": "正确",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 35
}
],
"_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": "d4DR4D2kRCtYS61JHz16On"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
},
"_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__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 37
}
],
"_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__": 36
},
"_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__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 39
}
],
"_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__": 38
},
"_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__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 41
}
],
"_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__": 40
},
"_enabled": true,
"_clip": {
"__uuid__": "f50e6692-cafe-4ae1-8020-82d9e17ee7cc"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "a2GALakfRDo4ok7uEXIl6F"
},
{
"__type__": "cc.Node",
"_name": "题数",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 43
}
],
"_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": "99PyaGeotHM6vFlz8tWzcD"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 42
},
"_enabled": true,
"_clip": {
"__uuid__": "16f053c4-cd27-439d-a7f7-beb6812f238d"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "0a6jNDnwpGBI0ZhTEM2vjX"
},
{
"__type__": "cc.Node",
"_name": "撒花",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 45
}
],
"_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": "b3uGA7LpFKWJO6JGul5g2N"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 44
},
"_enabled": true,
"_clip": {
"__uuid__": "0eb532a7-392b-480e-b1dc-95f9d1ec3d43"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "492N+vNEFK9Knu36wtDFJg"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": false,
"_fitHeight": false,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
......@@ -1670,6 +2349,12 @@
"bubble": {
"__uuid__": "ff427172-05bc-4907-a9d6-859d14218f60"
},
"star": {
"__uuid__": "2592d02f-4ff3-4cd6-805b-c204271d4e87"
},
"score": {
"__uuid__": "22b14cf4-f840-4245-b8f0-191b685e7250"
},
"_id": "e687yyoRBIzZAOVRL8Sseh"
}
]
\ No newline at end of file
......@@ -148,10 +148,10 @@ export default class Cartoon {
return node
}
subscribeTouchEvent(key, callBack) {
if(!this.touchEventCallback[key]) {
subscribeTouchEvent(key, callBack, newEvent) {
if(!this.touchEventCallback[key] || newEvent) {
this.touchEventCallback[key] = callBack
console.log("DVDVDV", this.elements[key].node)
this.elements[key].node.off(cc.Node.EventType.TOUCH_START)
this.elements[key].node.on(cc.Node.EventType.TOUCH_START, ()=>{
if(this.touchEventCallback[key]) {
......
......@@ -15,16 +15,13 @@ export default class GameLogic {
g_animaResList = [];
g_properties = {};
m_bubblesAll = [];
m_currentQuestion = -1;
m_gameEnd = false;
m_firstEnter = true;
m_options = []
m_avaliableAI = 0;
m_curLeftAnswerPoi = 0;
m_curMiddleAnswerPoi = 0;
m_curRightAnswerPoi = 0;
m_maxScale = 0.7;
m_currentQuestionIndex = -1;
m_rightAns = 0;
m_stopMoving = false;
m_maxScale = 1;
constructor(formData, systemOption) {
this.g_systemOption = systemOption;
this.g_imageResList = this.g_systemOption.imageResList;
......@@ -35,14 +32,14 @@ export default class GameLogic {
this.g_canvas = cc.find('Canvas');
this.g_cartoon = new Cartoon(cc);
// if(!formData.contentObj.options || formData.contentObj.options.length == 0) {
if(!formData.contentObj.dataArray || formData.contentObj.dataArray.length == 0) {
this.g_useDefaultData = true;
this.g_formData = defaultData
console.warn("User default data =>", this.g_formData)
// } else {
// this.g_formData = formData.contentObj;
// console.log("User saved data =>", this.g_formData)
// }
} else {
this.g_formData = formData.contentObj;
console.log("User saved data =>", this.g_formData)
}
this.disableClick("Sysyem_init")
this.g_cartoon.initLocalAudios([])
......@@ -51,32 +48,93 @@ export default class GameLogic {
this.initNodes();
this.initBg();
this.resetPosition();
this.initBubbles();
this.g_cartoon.initDragEvent()
this.enableClick("Sysyem_init");
this.hideAir();
this.systemTick();
setTimeout(() => {
this.addEventLinstener();
if(this.nextQuestion()) {
this.initStar()
this.g_cartoon.initDragEvent()
this.enableClick("Sysyem_init");
this.hideAir();
this.systemTick();
this.releaseBubbles()
}, 500);
}
cc.view.setResizeCallback(() => {
this.initBg();
this.resetPosition();
});
}
initNodes() {
this.g_cartoon.initCartoonElement("background", this.g_cartoon.getNodeByPath(`Canvas/background/background`));
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("lion", this.g_cartoon.getNodeByPath(`Canvas/lion/DB`));
}
initBg() {
const bgMain = this.g_cartoon.getCartoonElement("background")
bgMain.node.width = cc.winSize.width
bgMain.node.height = cc.winSize.height
}
resetPosition() {
let node = this.g_cartoon.getNodeByPath(`Canvas/speaker`)
node.x = -cc.winSize.width / 2 + 100
node.y = -cc.winSize.height / 2 + 100
this.m_bubblesAll.push({node: node, move: {
r: 50, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1, id: 999, lastId: null
}})
node = this.g_cartoon.getNodeByPath(`Canvas/btn_back`)
node.x = -cc.winSize.width / 2 + 60
node.y = cc.winSize.height / 2 - 50
this.m_bubblesAll.push({node: node, move: {
r: 40, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1, id: 998, lastId: null
}})
node = this.g_cartoon.getNodeByPath(`Canvas/btn_restart`)
node.x = 0
node.y = 20
// this.m_bubblesAll.push({node: node, move: {
// r: 90, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1
// }})
node = this.g_cartoon.getNodeByPath(`Canvas/lion`)
node.x = cc.winSize.width / 2 - 150
node.y = -cc.winSize.height / 2 + 170
this.m_bubblesAll.push({node: node, move: {
r: 90, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1, id: 997, lastId: null
}})
node = this.g_cartoon.getNodeByPath(`Canvas/star_group`)
node.y = -cc.winSize.height/2 - 140
}
addEventLinstener() {
const btn_restart = this.g_cartoon.getCartoonElement("restart")
this.g_cartoon.subscribeTouchEvent("restart", _=>{
this.g_cartoon.tweenChange(btn_restart.node, {scaleX: 0, scaleY: 0}, 0.2, _=>{
this.enableClick("Restart")
this.restartGame();
})
})
const btn_lion = this.g_cartoon.getCartoonElement("lion")
this.g_cartoon.subscribeTouchEvent("lion", _=>{
let a = btn_lion.node.getComponent(dragonBones.ArmatureDisplay)
a.playAnimation('Armature', 1);
})
}
systemTick() {
let maxNum = this.bubblesAll.length;
let maxNum = this.m_bubblesAll.length;
let maxX = cc.winSize.width / 2;
let maxY = cc.winSize.height / 2;
setInterval(()=>{
this.bubblesAll.forEach((bubble, index_x)=>{
if(bubble.move.enable && !bubble.move.fix) {
this.m_bubblesAll.forEach((bubble, index_x)=>{
if(!this.m_stopMoving && bubble.move.enable && !bubble.move.fix) {
bubble.move.x += bubble.move.vX
bubble.move.y += bubble.move.vY
if(bubble.move.scale<this.m_maxScale) {
......@@ -91,22 +149,22 @@ export default class GameLogic {
if (bubble.move.x >= maxX - bubble.move.r * bubble.move.scale) {
bubble.move.x = maxX - bubble.move.r * bubble.move.scale;
bubble.move.vX = -bubble.move.vX;
bubble.move.lastId = null;
// bubble.move.lastId = null;
}
if (bubble.move.x <= -maxX + bubble.move.r * bubble.move.scale) {
bubble.move.x = -maxX + bubble.move.r * bubble.move.scale;
bubble.move.vX = -bubble.move.vX;
bubble.move.lastId = null;
// bubble.move.lastId = null;
}
if (bubble.move.y >= maxY - bubble.move.r * bubble.move.scale) {
bubble.move.y = maxY - bubble.move.r * bubble.move.scale;
bubble.move.vY = -bubble.move.vY;
bubble.move.lastId = null;
// bubble.move.lastId = null;
}
if (bubble.move.y <= -maxY + bubble.move.r * bubble.move.scale) {
bubble.move.y = -maxY + bubble.move.r * bubble.move.scale;
bubble.move.vY = - bubble.move.vY;
bubble.move.lastId = null;
// bubble.move.lastId = null;
}
bubble.node.x = bubble.move.x
......@@ -114,22 +172,23 @@ export default class GameLogic {
for (var j = 0; j < maxNum; j++) {
if (j !== index_x) {
if (Math.round(Math.pow(this.bubblesAll[index_x].node.x - this.bubblesAll[j].node.x, 2) +
Math.pow(this.bubblesAll[index_x].node.y - this.bubblesAll[j].node.y, 2)) <=
Math.round(Math.pow(this.bubblesAll[index_x].move.r * this.bubblesAll[index_x].move.scale + this.bubblesAll[j].move.r * this.bubblesAll[j].move.scale, 2))) {
if (Math.round(Math.pow(this.m_bubblesAll[index_x].node.x - this.m_bubblesAll[j].node.x, 2) +
Math.pow(this.m_bubblesAll[index_x].node.y - this.m_bubblesAll[j].node.y, 2)) <=
Math.round(Math.pow(this.m_bubblesAll[index_x].move.r * this.m_bubblesAll[index_x].move.scale + this.m_bubblesAll[j].move.r * this.m_bubblesAll[j].move.scale, 2))) {
var tempX = this.bubblesAll[index_x].move.vX;
var tempY = this.bubblesAll[index_x].move.vY;
if(this.bubblesAll[index_x].move.lastId != this.bubblesAll[j].move.id) {
this.bubblesAll[index_x].move.lastId = this.bubblesAll[j].move.id
if(this.bubblesAll[j].move.fix) {
this.bubblesAll[index_x].move.vX = -this.bubblesAll[index_x].move.vX;
this.bubblesAll[index_x].move.vY = -this.bubblesAll[index_x].move.vY;
var tempX = this.m_bubblesAll[index_x].move.vX;
var tempY = this.m_bubblesAll[index_x].move.vY;
if(this.m_bubblesAll[index_x].move.lastId != this.m_bubblesAll[j].move.id) {
this.m_bubblesAll[index_x].move.lastId = this.m_bubblesAll[j].move.id;
this.m_bubblesAll[j].move.lastId = this.m_bubblesAll[index_x].move.id;
if(this.m_bubblesAll[j].move.fix) {
this.m_bubblesAll[index_x].move.vX = -this.m_bubblesAll[index_x].move.vX;
this.m_bubblesAll[index_x].move.vY = -this.m_bubblesAll[index_x].move.vY;
} else {
this.bubblesAll[index_x].move.vX = this.bubblesAll[j].move.vX;
this.bubblesAll[j].move.vX = tempX;
this.bubblesAll[index_x].move.vY = this.bubblesAll[j].move.vY;
this.bubblesAll[j].move.vY = tempY;
this.m_bubblesAll[index_x].move.vX = this.m_bubblesAll[j].move.vX;
this.m_bubblesAll[j].move.vX = tempX;
this.m_bubblesAll[index_x].move.vY = this.m_bubblesAll[j].move.vY;
this.m_bubblesAll[j].move.vY = tempY;
}
}
}
......@@ -137,114 +196,208 @@ export default class GameLogic {
}
}
})
}, 30)
}
initNodes() {
this.g_cartoon.initCartoonElement("background", this.g_cartoon.getNodeByPath(`Canvas/background/background`));
this.g_cartoon.initCartoonElement("lion", this.g_cartoon.getNodeByPath(`Canvas/lion`));
initStar() {
const starGroup = this.g_cartoon.getNodeByPath(`Canvas/star_group`)
const scoreGroup = this.g_cartoon.getNodeByPath(`Canvas/score_group`)
const scoreAll = []
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 + (scoreAll.length-1) * 10) / 2;
scoreAll.forEach((score, index)=>{
score.y = startY
startY -= 66 + 10
})
}
addStar(callback) {
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.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++;
if(this.m_currentQuestionIndex >= this.g_formData.dataArray.length) {
return 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`)
for(let i=0; i<6; i++) {
for(let i=0; i<bubbleNum; i++) {
const bubble = cc.instantiate(this.g_systemOption.prefabs.bubble);
bubble.parent = bubbleParent;
console.log(bubble)
this.g_cartoon.setCartoonElement(`bubble_${i}`, bubble)
}
}
initBg() {
const bgMain = this.g_cartoon.getCartoonElement("background")
// if(this.g_formData.bg.type == "custome" && this.g_formData.bg.image_url) {
// this.g_cartoon.mountImageToNode(this.g_formData.bg.image_url, bgMain.node, cc.winSize.width, cc.winSize.height, true);
// } else {
bgMain.node.width = cc.winSize.width
bgMain.node.height = cc.winSize.height
// }
}
bubblesAll = []
initBubbles() {
for(let i=0; i<6; i++) {
for(let i=0; i<bubbleNum; i++) {
const bubble = this.g_cartoon.getCartoonElement(`bubble_${i}`)
let item = i<rightNum?this.g_formData.dataArray[this.m_currentQuestionIndex].correct[i]:this.g_formData.dataArray[this.m_currentQuestionIndex].incorrect[i-rightNum]
bubble.isRight = i<rightNum?true:false;
bubble.move = {
r: 100, x: 0, y: 0, vX: 1, vY: 1.3, enable: false, fix: false, scale: 0, id: i, lastId: null
r: 95, x: 0, y: 0, vX: 1, vY: 1.3, enable: false, fix: false, scale: 0, id: i, lastId: null
}
if(item.type == 'Image') {
let image = bubble.node.getChildByName("image_container")
image.active = true;
this.g_cartoon.mountImageToNode(item.image_url, image, 120, 120)
} else {
let text = bubble.node.getChildByName("text_container")
text.active = true;
var tLabel = text.getComponent(cc.Label)
tLabel.string = item.text
}
bubble.node.scaleX = 0;
bubble.node.scaleY = 0;
bubble.node.x = 0;
bubble.node.y = -2000;
this.bubblesAll.push(bubble)
this.m_bubblesAll.push(bubble)
this.g_cartoon.subscribeTouchEvent(`bubble_${i}`, ()=>{
console.log("d")
this.disableClick(`bubble_${i}`)
if(bubble.isRight) {
bubble.node.active = false;
this.g_cartoon.playAudio("正确");
this.m_rightAns++;
if(this.m_rightAns>=rightNum) {
this.m_stopMoving = true;
this.addStar(_=>{
this.destroyBubbles();
if(!this.nextQuestion()) {
this.endGame()
this.enableClick(`bubble_${i}`)
}
})
}
} else {
this.m_stopMoving = true;
setTimeout(() => {
this.m_stopMoving = false;
this.enableClick(`bubble_${i}`)
}, 1500);
this.g_cartoon.playAudio("错误泡泡爆炸");
}
}, true)
}
return true;
}
resetPosition() {
let node = this.g_cartoon.getNodeByPath(`Canvas/speaker`)
node.x = -cc.winSize.width / 2 + 100
node.y = -cc.winSize.height / 2 + 100
this.bubblesAll.push({node: node, move: {
r: 50, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1, id: 999, lastId: null
}})
node = this.g_cartoon.getNodeByPath(`Canvas/btn_back`)
node.x = -cc.winSize.width / 2 + 60
node.y = cc.winSize.height / 2 - 50
this.bubblesAll.push({node: node, move: {
r: 40, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1, id: 998, lastId: null
}})
node = this.g_cartoon.getNodeByPath(`Canvas/btn_restart`)
node.x = 0
node.y = 20
// this.bubblesAll.push({node: node, move: {
// r: 90, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1
// }})
node = this.g_cartoon.getNodeByPath(`Canvas/lion`)
node.x = cc.winSize.width / 2 - 150
node.y = -cc.winSize.height / 2 + 170
this.bubblesAll.push({node: node, move: {
r: 90, x: node.x, y: node.y, vX: 0, vY: 0, enable: true, fix: true, scale: 1, id: 997, lastId: null
}})
destroyBubbles() {
this.save = []
this.m_bubblesAll.forEach(item=>{
if(!item.move.fix) {
this.g_cartoon.tweenChange(item.node, {y: item.node.y + cc.winSize.height}, 1, ()=>{
item.node.destroy()
})
} else {
this.save.push(item)
}
})
this.m_bubblesAll = this.save;
}
releaseBubbles() {
const pos = [
[
{x: -280, y: 24}, {x: 0, y: 5}, {x: -172, y: -172}, {x: 34, y: -220}, {x: 235, y: -37},
{x: -119, y: 191}, {x: 287, y: 186}, {x: -320, y: 252}, {x: -486, y: -45}, {x: 452, y: 30},
{x: -380, y: -247}, {x: 87, y: 252}, {x: 258, y: -244}, {x: 505, y: 236}, {x: -500, y: 160},
]
]
let startx = cc.winSize.width / 2 - 350
let starty = -cc.winSize.height / 2 + 350
const vArr = [
{vX: -5, vY: 1 }, {vX: -5, vY: 2 }, {vX: -5, vY: 1 }
{vX: -0.5, vY: 0.5 }, {vX: 0.5, vY: -0.5 }, {vX: -0.5, vY: -0.5 }, {vX: 0.5, vY: 0.5 }
]
// const pos = [
// {x: }
// ]
this.bubblesAll.forEach((bubble, index) => {
setTimeout(() => {
if(!bubble.move.fix) {
bubble.node.x = startx
bubble.node.y = starty
bubble.move.x = startx
bubble.move.y = starty
bubble.move.vX = vArr[index%3].vX
bubble.move.vY = vArr[index%3].vY
bubble.move.scale = 0.3;
let pAll = []
let count = 0;
this.m_bubblesAll.forEach(bubble => {
if(!bubble.move.fix) {
let _p = new Promise((resolve, reject) => {
console.log(count)
bubble.node.x = pos[0][count].x
bubble.node.y = pos[0][count].y
bubble.move.x = pos[0][count].x
bubble.move.y = pos[0][count].y
bubble.move.vX = vArr[count%4].vX
bubble.move.vY = vArr[count%4].vY
bubble.move.scale = 1;
bubble.node.scaleX = bubble.move.scale;
bubble.node.scaleY = bubble.move.scale;
// console.log(bubble.move.vX, bubble.move.vY)
count++;
resolve()
})
pAll.push(_p)
}
})
Promise.all(pAll).then(_=>{
this.m_bubblesAll.forEach(bubble=>{
if(!bubble.move.fix) {
bubble.move.enable = true;
setTimeout(() => {
bubble.move.vX = -1 * (Math.ceil(Math.random()*10)/10)
}, 1000);
}
}, 1500 * index);
})
})
}
endGame() {
const btn_restart = this.g_cartoon.getCartoonElement("restart")
console.log(btn_restart.node)
this.g_cartoon.playAudio("撒花")
this.g_cartoon.tweenChange(btn_restart.node, {scale: 1}, 0.3, _=>{
this.enableClick("Restart")
})
}
restartGame() {
this.m_currentQuestion = -1;
this.m_currentQuestionIndex = -1;
this.m_rightAns = 0;
this.m_stopMoving = false;
console.log("重新开始", this.nextQuestion());
this.initStar();
this.releaseBubbles();
}
......
......@@ -16,6 +16,14 @@ cc.Class({
type: cc.Prefab,
default: null,
},
star: {
type: cc.Prefab,
default: null,
},
score: {
type: cc.Prefab,
default: null,
},
},
gameLogic: null,
......@@ -87,7 +95,9 @@ cc.Class({
audioResList: this._audioResList,
animaResList: this._animaResList,
prefabs: {
bubble: this.bubble
bubble: this.bubble,
star: this.star,
score: this.score
},
properties: {
option: this.option,
......
{
"ver": "2.3.5",
"uuid": "0601a05d-da6a-45e5-bc19-7dd339206079",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 436,
"height": 256,
"platformSettings": {},
"subMetas": {
"btn_restart": {
"ver": "1.0.4",
"uuid": "955b7ad5-9107-4588-8235-d652be51ace1",
"rawTextureUuid": "0601a05d-da6a-45e5-bc19-7dd339206079",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 436,
"height": 256,
"rawWidth": 436,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "caebfe0f-b246-41db-9ef6-395e80d10a5c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 62,
"height": 66,
"platformSettings": {},
"subMetas": {
"多边形1拷贝": {
"ver": "1.0.4",
"uuid": "e3fc5cc3-7007-4f39-a4f7-854a16e06883",
"rawTextureUuid": "caebfe0f-b246-41db-9ef6-395e80d10a5c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 62,
"height": 66,
"rawWidth": 62,
"rawHeight": 66,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ad5a9b5e-56cd-4271-9a43-44afa49c9194",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 278,
"height": 275,
"platformSettings": {},
"subMetas": {
"组21": {
"ver": "1.0.4",
"uuid": "0d4e8ab5-1e48-4a70-b5f3-41ac05264cbf",
"rawTextureUuid": "ad5a9b5e-56cd-4271-9a43-44afa49c9194",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 278,
"height": 275,
"rawWidth": 278,
"rawHeight": 275,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9d817392-6611-414c-9c05-64da2564376f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 62,
"height": 69,
"platformSettings": {},
"subMetas": {
"组22": {
"ver": "1.0.4",
"uuid": "87136bc7-13f1-4c93-a705-396b8d9281b2",
"rawTextureUuid": "9d817392-6611-414c-9c05-64da2564376f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 62,
"height": 69,
"rawWidth": 62,
"rawHeight": 69,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment