Commit d973657c authored by haiyoucuv's avatar haiyoucuv

init

parent 97992bb6
...@@ -18,12 +18,15 @@ ...@@ -18,12 +18,15 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 40
} }
], ],
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 13 "__id__": 58
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
...@@ -54,7 +57,7 @@ ...@@ -54,7 +57,7 @@
}, },
"autoReleaseAssets": false, "autoReleaseAssets": false,
"_globals": { "_globals": {
"__id__": 14 "__id__": 59
}, },
"_id": "53947ca7-3484-4b53-800d-509405063d68" "_id": "53947ca7-3484-4b53-800d-509405063d68"
}, },
...@@ -72,21 +75,30 @@ ...@@ -72,21 +75,30 @@
}, },
{ {
"__id__": 5 "__id__": 5
},
{
"__id__": 20
},
{
"__id__": 24
},
{
"__id__": 26
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 34
}, },
{ {
"__id__": 10 "__id__": 35
}, },
{ {
"__id__": 11 "__id__": 36
}, },
{ {
"__id__": 12 "__id__": 37
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -110,7 +122,7 @@ ...@@ -110,7 +122,7 @@
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
"_layer": 33554432, "_layer": 1,
"_euler": { "_euler": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
...@@ -121,7 +133,7 @@ ...@@ -121,7 +133,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Camera", "_name": "GameCamera",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
...@@ -155,7 +167,7 @@ ...@@ -155,7 +167,7 @@
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
"_layer": 1073741824, "_layer": 1,
"_euler": { "_euler": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
...@@ -175,11 +187,11 @@ ...@@ -175,11 +187,11 @@
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"_projection": 0, "_projection": 0,
"_priority": 50000, "_priority": 40000,
"_fov": 45, "_fov": 45,
"_fovAxis": 0, "_fovAxis": 0,
"_orthoHeight": 812, "_orthoHeight": 812,
"_near": 1, "_near": 0,
"_far": 2000, "_far": 2000,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
...@@ -190,7 +202,7 @@ ...@@ -190,7 +202,7 @@
}, },
"_depth": 1, "_depth": 1,
"_stencil": 0, "_stencil": 0,
"_clearFlags": 6, "_clearFlags": 7,
"_rect": { "_rect": {
"__type__": "cc.Rect", "__type__": "cc.Rect",
"x": 0, "x": 0,
...@@ -202,7 +214,7 @@ ...@@ -202,7 +214,7 @@
"_shutter": 7, "_shutter": 7,
"_iso": 0, "_iso": 0,
"_screenScale": 1, "_screenScale": 1,
"_visibility": 41943040, "_visibility": 1,
"_targetTexture": null, "_targetTexture": null,
"_postProcess": null, "_postProcess": null,
"_usePostProcess": false, "_usePostProcess": false,
...@@ -212,18 +224,76 @@ ...@@ -212,18 +224,76 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Snake", "_name": "bg",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [
{
"__id__": 6
},
{
"__id__": 9
},
{
"__id__": 12
},
{
"__id__": 15
}
],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 6 "__id__": 18
},
{
"__id__": 19
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "11jF7gWMtCMIpoIRdc/iDi"
},
{
"__type__": "cc.Node",
"_name": "WALL_TOP",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 5
}, },
"_children": [],
"_active": true,
"_components": [
{ {
"__id__": 7 "__id__": 7
}, },
...@@ -252,14 +322,14 @@ ...@@ -252,14 +322,14 @@
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
"_layer": 33554432, "_layer": 1,
"_euler": { "_euler": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"_id": "ee8O/qSSVCI71mLCUiPZ14" "_id": "f6dD0+FwJOJYEMXuWTsWF8"
}, },
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
...@@ -267,7 +337,7 @@ ...@@ -267,7 +337,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 5 "__id__": 6
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
...@@ -281,7 +351,7 @@ ...@@ -281,7 +351,7 @@
"x": 0.5, "x": 0.5,
"y": 0.5 "y": 0.5
}, },
"_id": "f4NXIEHRxHb42L3h6JeOws" "_id": "a2pNtQyb1KiJHrvhUDwYhR"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -289,7 +359,7 @@ ...@@ -289,7 +359,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 5 "__id__": 6
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
...@@ -299,8 +369,8 @@ ...@@ -299,8 +369,8 @@
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
"g": 255, "g": 0,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
...@@ -320,24 +390,55 @@ ...@@ -320,24 +390,55 @@
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_useGrayscale": false, "_useGrayscale": false,
"_atlas": null, "_atlas": null,
"_id": "26Y28dKY5DYrbelc1SN0/x" "_id": "62Gw59LnZFDbxGGR1SnLpR"
}, },
{ {
"__type__": "5c1d7QKgk1JsaoI0kPfkdM9", "__type__": "cc.Node",
"_name": "", "_name": "WALL_BOTTOM",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "_parent": {
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_children": [],
"__prefab": null, "_active": true,
"nodePrefab": { "_components": [
"__uuid__": "a9574a8f-f883-4d7f-99ca-86c3984b98aa", {
"__expectedType__": "cc.Prefab" "__id__": 10
}, },
"gap": 20, {
"_id": "5fBUl8qiFBzbPmQ/o4D604" "__id__": 11
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "e6XXFuzW5NdJImcpkQvQ7j"
}, },
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
...@@ -345,84 +446,1604 @@ ...@@ -345,84 +446,1604 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 2 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 750, "width": 40,
"height": 1624 "height": 36
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": 0.5,
"y": 0.5 "y": 0.5
}, },
"_id": "bacPL97PpF2bL6DkBZU0aV" "_id": "acrjILq2ZEqabjZCBr/Qd3"
}, },
{ {
"__type__": "cc.Canvas", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 2 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"_cameraComponent": { "_customMaterial": null,
"__id__": 4 "_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 255,
"a": 255
}, },
"_alignCanvasWithScreen": true, "_spriteFrame": {
"_id": "62LdbkMj9H0aoMZiMqeOXB" "__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "80VpvxboFCx7OE0n/0lwfU"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Node",
"_name": "", "_name": "WALL_LEFT",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "_parent": {
"__id__": 2 "__id__": 5
}, },
"_enabled": true, "_children": [],
"__prefab": null, "_active": true,
"_alignFlags": 45, "_components": [
"_target": null, {
"_left": 0, "__id__": 13
"_right": 0, },
"_top": 0, {
"_bottom": 0, "__id__": 14
"_horizontalCenter": 0, }
"_verticalCenter": 0, ],
"_isAbsLeft": true, "_prefab": null,
"_isAbsRight": true, "_lpos": {
"_isAbsTop": true, "__type__": "cc.Vec3",
"_isAbsBottom": true, "x": 0,
"_isAbsHorizontalCenter": true, "y": 0,
"_isAbsVerticalCenter": true, "z": 0
"_originalWidth": 0, },
"_originalHeight": 0, "_lrot": {
"_alignMode": 2, "__type__": "cc.Quat",
"_lockFlags": 0, "x": 0,
"_id": "4b4n24QAlBAJTbqsXR4lUh" "y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "5b3j3YZMpEcr/H/VC/I5e5"
}, },
{ {
"__type__": "701bew69aZIS5LPXLZ6/4lh", "__type__": "cc.UITransform",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 2 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"uiLayer": null, "_contentSize": {
"snake": { "__type__": "cc.Size",
"__id__": 5 "width": 40,
"height": 36
}, },
"speed": 200, "_anchorPoint": {
"_id": "82BvT1r7xD+JbBxZ+0VBoD" "__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "cfpN3KtK1H94V6wBxPZDr7"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 255,
"b": 10,
"a": 255
},
"_spriteFrame": {
"__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "81uLUKrflGZJfZ4OsjkAcU"
},
{
"__type__": "cc.Node",
"_name": "WALL_RIGHT",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "6cTcLYWGpAyLunZ2+Iiu2O"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 15
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "06OUkD5W1BSZqZ0ha4MAZq"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 15
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 235,
"b": 0,
"a": 255
},
"_spriteFrame": {
"__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "30nPtFanxCAZz6kA6oAUjL"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 5
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 5000,
"height": 4000
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "c3dZAHGeVNFoZ7+2mhU/0k"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 5
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 167,
"g": 167,
"b": 167,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "4bRyNFPpJGVa0DJhYHS84j"
},
{
"__type__": "cc.Node",
"_name": "foodNode",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 21
},
{
"__id__": 22
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "f6PdnNEWFM1pYc4uurpjCY"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 20
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "9aW6gHR5xN0oA7AYACNl4n"
},
{
"__type__": "e21cfLAphJOk7fsHD2QEDbI",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 20
},
"_enabled": true,
"__prefab": null,
"Foods": [
{
"__id__": 23
}
],
"foodPrefab": {
"__uuid__": "485bac5c-31d1-4090-a194-c8c17e2cc3b1",
"__expectedType__": "cc.Prefab"
},
"_id": "9esMn6VP9O+rMphRXPE94i"
},
{
"__type__": "Item",
"type": 0,
"sp": {
"__uuid__": "ad97e5f2-485d-4ebb-a1ef-a63c1c32115a@f9941",
"__expectedType__": "cc.SpriteFrame"
}
},
{
"__type__": "cc.Node",
"_name": "animalNode",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 25
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "82VPH+44ZLna9InQ75QOAG"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 24
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "e9P/gCTMRB6YNIvQSZ/8Hg"
},
{
"__type__": "cc.Node",
"_name": "Snake",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 27
}
],
"_active": true,
"_components": [
{
"__id__": 32
},
{
"__id__": 33
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "ee8O/qSSVCI71mLCUiPZ14"
},
{
"__type__": "cc.Node",
"_name": "Head",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 26
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 28
},
{
"__id__": 29
},
{
"__id__": 30
},
{
"__id__": 31
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "4bNFrHrqRFnLipvvtR3IxW"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 27
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 163,
"height": 181
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "93szTjc/FGALN4nlwUdbOL"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 27
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "8f21f897-8cb9-448d-a674-e0574c83e228@9296f",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "611y7OvalMk6WKsBgpqsQe"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 27
},
"_enabled": true,
"__prefab": null,
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 2,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": "ba/Z9k48lFjKggly+uiLPQ"
},
{
"__type__": "cc.CircleCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 27
},
"_enabled": true,
"__prefab": null,
"tag": 0,
"_group": 2,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 60,
"_id": "35XBcgL4hOhYpj8xmXzP8l"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 26
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "f4NXIEHRxHb42L3h6JeOws"
},
{
"__type__": "5c1d7QKgk1JsaoI0kPfkdM9",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 26
},
"_enabled": true,
"__prefab": null,
"Head": {
"__id__": 27
},
"bodyPrefab": {
"__uuid__": "8c4f22c7-20c7-4868-88ea-dedb8004999f",
"__expectedType__": "cc.Prefab"
},
"_id": "5fBUl8qiFBzbPmQ/o4D604"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 750,
"height": 1624
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "bacPL97PpF2bL6DkBZU0aV"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": null,
"_cameraComponent": {
"__id__": 4
},
"_alignCanvasWithScreen": true,
"_id": "62LdbkMj9H0aoMZiMqeOXB"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "4b4n24QAlBAJTbqsXR4lUh"
},
{
"__type__": "21251JLe89C+bNR2HvMGDkB",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": null,
"animalPrefab": {
"__uuid__": "37f1dd8d-17a4-406d-9382-91b0969cf75d",
"__expectedType__": "cc.Prefab"
},
"maxFood": 200,
"maxAnimal": 20,
"angleBtn": {
"__id__": 38
},
"fashBtn": {
"__id__": 46
},
"uiBg": {
"__id__": 18
},
"snake": {
"__id__": 33
},
"fondManger": {
"__id__": 22
},
"animalNode": {
"__id__": 24
},
"LTips": {
"__id__": 49
},
"camera": {
"__id__": 4
},
"_id": "17e87LmmFPGJM7y37eKcPY"
},
{
"__type__": "4552b9T1AJHJ4xMNlpYdqL/",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 39
},
"_enabled": true,
"__prefab": null,
"uiCamera": {
"__id__": 42
},
"AngleBtn": {
"__id__": 39
},
"CirDot": {
"__id__": 53
},
"marR": 100,
"_id": "0elywIxWZJC67+0JraRtKG"
},
{
"__type__": "cc.Node",
"_name": "方向",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 40
},
"_children": [
{
"__id__": 53
}
],
"_active": true,
"_components": [
{
"__id__": 56
},
{
"__id__": 57
},
{
"__id__": 38
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": -194.414,
"y": -552.498,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "12tzYF6p5OgpcJ/w/gCMk2"
},
{
"__type__": "cc.Node",
"_name": "UICanvas",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 41
},
{
"__id__": 43
},
{
"__id__": 39
},
{
"__id__": 47
}
],
"_active": true,
"_components": [
{
"__id__": 50
},
{
"__id__": 51
},
{
"__id__": 52
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 375,
"y": 812,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "dfjZGFfC9HXKg7inKUvfox"
},
{
"__type__": "cc.Node",
"_name": "UICamera",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 40
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 42
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 1000
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "d0WcuvysBALLMulUsRTjc+"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 41
},
"_enabled": true,
"__prefab": null,
"_projection": 0,
"_priority": 50000,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 812,
"_near": 1,
"_far": 2000,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": 1,
"_stencil": 0,
"_clearFlags": 6,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_aperture": 19,
"_shutter": 7,
"_iso": 0,
"_screenScale": 1,
"_visibility": 41943040,
"_targetTexture": null,
"_postProcess": null,
"_usePostProcess": false,
"_cameraType": -1,
"_trackingType": 0,
"_id": "22C/2+IRRDyq2udD8/1gUV"
},
{
"__type__": "cc.Node",
"_name": "加速",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 40
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 44
},
{
"__id__": 45
},
{
"__id__": 46
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 264.187,
"y": -552.498,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "f5y3rH/8pFaajGmcTd1oBj"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 43
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "c5CRFJ2bpEq7yx7l92Z2dr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 43
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "f2/MOTjLFDBJqZf5WeC+OA"
},
{
"__type__": "10febBZWxpDH4Q3vzHVN77F",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 43
},
"_enabled": true,
"__prefab": null,
"sp": {
"__id__": 45
},
"_id": "cbuYoeJJBN/Z/dZ6F3l5A5"
},
{
"__type__": "cc.Node",
"_name": "LTips",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 40
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 48
},
{
"__id__": 49
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 253.913,
"y": -377.918,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "47LaLbo4NHs6DmVoLjGq0D"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 47
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 42.255859375,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "36UlLKql1OzYx2glz5wuM/"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 47
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "label",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": false,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": "19rM5WBaxLeLzdAeJnwo00"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 40
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 750,
"height": 1624
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "33mxfvlWJOYoIbx4ZEAfKS"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 40
},
"_enabled": true,
"__prefab": null,
"_cameraComponent": {
"__id__": 42
},
"_alignCanvasWithScreen": true,
"_id": "34wxp/0vpKH4Wcp1ieFQOS"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 40
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "06Ujytz0pEyLB5yn9hXAKx"
},
{
"__type__": "cc.Node",
"_name": "dot",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 39
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 54
},
{
"__id__": 55
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "afSm7CFGFEXrWoQl6Y6Gxn"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 53
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "90ZZLRikdJoKqiyDQXUVwh"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 53
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "6bMPXGycdENoxLG4JE1aI7"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 39
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "c4+GvL/5VLjY/baHBkgZtu"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 39
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "66XQUcIMlDkJvkLa8btCt/"
}, },
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
...@@ -435,28 +2056,28 @@ ...@@ -435,28 +2056,28 @@
{ {
"__type__": "cc.SceneGlobals", "__type__": "cc.SceneGlobals",
"ambient": { "ambient": {
"__id__": 15 "__id__": 60
}, },
"shadows": { "shadows": {
"__id__": 16 "__id__": 61
}, },
"_skybox": { "_skybox": {
"__id__": 17 "__id__": 62
}, },
"fog": { "fog": {
"__id__": 18 "__id__": 63
}, },
"octree": { "octree": {
"__id__": 19 "__id__": 64
}, },
"skin": { "skin": {
"__id__": 20 "__id__": 65
}, },
"lightProbeInfo": { "lightProbeInfo": {
"__id__": 21 "__id__": 66
}, },
"postSettings": { "postSettings": {
"__id__": 22 "__id__": 67
}, },
"bakedWithStationaryMainLight": false, "bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false "bakedWithHighpLightmap": false
......
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@6c48a",
"displayName": "Guide1",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@f9941",
"displayName": "Guide1",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 586,
"height": 163,
"rawWidth": 586,
"rawHeight": 163,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-293,
-81.5,
0,
293,
-81.5,
0,
-293,
81.5,
0,
293,
81.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
163,
586,
163,
0,
0,
586,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-293,
-81.5,
0
],
"maxPos": [
293,
81.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@6c48a",
"displayName": "Guide2",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@f9941",
"displayName": "Guide2",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 586,
"height": 163,
"rawWidth": 586,
"rawHeight": 163,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-293,
-81.5,
0,
293,
-81.5,
0,
-293,
81.5,
0,
293,
81.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
163,
586,
163,
0,
0,
586,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-293,
-81.5,
0
],
"maxPos": [
293,
81.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "f24bc6a3-56c8-4308-9a29-d8ed568c36e3",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "f24bc6a3-56c8-4308-9a29-d8ed568c36e3@6c48a",
"displayName": "Guide4",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "f24bc6a3-56c8-4308-9a29-d8ed568c36e3",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "f24bc6a3-56c8-4308-9a29-d8ed568c36e3@f9941",
"displayName": "Guide4",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 586,
"height": 163,
"rawWidth": 586,
"rawHeight": 163,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-293,
-81.5,
0,
293,
-81.5,
0,
-293,
81.5,
0,
293,
81.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
163,
586,
163,
0,
0,
586,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-293,
-81.5,
0
],
"maxPos": [
293,
81.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "f24bc6a3-56c8-4308-9a29-d8ed568c36e3@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "f24bc6a3-56c8-4308-9a29-d8ed568c36e3@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "62812253-e666-4efc-ad0a-d4d60e1e415c",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "62812253-e666-4efc-ad0a-d4d60e1e415c@6c48a",
"displayName": "next",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "62812253-e666-4efc-ad0a-d4d60e1e415c",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "62812253-e666-4efc-ad0a-d4d60e1e415c@f9941",
"displayName": "next",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 140,
"height": 58,
"rawWidth": 140,
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-70,
-29,
0,
70,
-29,
0,
-70,
29,
0,
70,
29,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
58,
140,
58,
0,
0,
140,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-70,
-29,
0
],
"maxPos": [
70,
29,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "62812253-e666-4efc-ad0a-d4d60e1e415c@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "62812253-e666-4efc-ad0a-d4d60e1e415c@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "fe3910ac-97d8-481c-9627-601077b214ec",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "fe3910ac-97d8-481c-9627-601077b214ec@6c48a",
"displayName": "start",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "fe3910ac-97d8-481c-9627-601077b214ec",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "fe3910ac-97d8-481c-9627-601077b214ec@f9941",
"displayName": "start",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 297,
"height": 58,
"rawWidth": 297,
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-148.5,
-29,
0,
148.5,
-29,
0,
-148.5,
29,
0,
148.5,
29,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
58,
297,
58,
0,
0,
297,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-148.5,
-29,
0
],
"maxPos": [
148.5,
29,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "fe3910ac-97d8-481c-9627-601077b214ec@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "fe3910ac-97d8-481c-9627-601077b214ec@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "5ea91ea2-30f1-4d76-b447-62a680352ee0",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "5ea91ea2-30f1-4d76-b447-62a680352ee0@6c48a",
"displayName": "中靶心",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "5ea91ea2-30f1-4d76-b447-62a680352ee0",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "5ea91ea2-30f1-4d76-b447-62a680352ee0@f9941",
"displayName": "中靶心",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 213,
"height": 103,
"rawWidth": 213,
"rawHeight": 103,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-106.5,
-51.5,
0,
106.5,
-51.5,
0,
-106.5,
51.5,
0,
106.5,
51.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
103,
213,
103,
0,
0,
213,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-106.5,
-51.5,
0
],
"maxPos": [
106.5,
51.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "5ea91ea2-30f1-4d76-b447-62a680352ee0@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "5ea91ea2-30f1-4d76-b447-62a680352ee0@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "2e216ba4-f0b7-49dd-a264-303eb1275af9",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "2e216ba4-f0b7-49dd-a264-303eb1275af9@6c48a",
"displayName": "组 34",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "2e216ba4-f0b7-49dd-a264-303eb1275af9",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "2e216ba4-f0b7-49dd-a264-303eb1275af9@f9941",
"displayName": "组 34",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 574,
"height": 406,
"rawWidth": 574,
"rawHeight": 406,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-287,
-203,
0,
287,
-203,
0,
-287,
203,
0,
287,
203,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
406,
574,
406,
0,
0,
574,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-287,
-203,
0
],
"maxPos": [
287,
203,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "2e216ba4-f0b7-49dd-a264-303eb1275af9@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "2e216ba4-f0b7-49dd-a264-303eb1275af9@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "cfcf3bd0-627a-4399-b971-cc6589bffddc",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "cfcf3bd0-627a-4399-b971-cc6589bffddc@6c48a",
"displayName": "音乐关",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "cfcf3bd0-627a-4399-b971-cc6589bffddc",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "cfcf3bd0-627a-4399-b971-cc6589bffddc@f9941",
"displayName": "音乐关",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 49,
"height": 49,
"rawWidth": 49,
"rawHeight": 49,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-24.5,
-24.5,
0,
24.5,
-24.5,
0,
-24.5,
24.5,
0,
24.5,
24.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
49,
49,
49,
0,
0,
49,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-24.5,
-24.5,
0
],
"maxPos": [
24.5,
24.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "cfcf3bd0-627a-4399-b971-cc6589bffddc@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "cfcf3bd0-627a-4399-b971-cc6589bffddc@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "a75e1371-4878-405d-859f-89ae90010a63",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "a75e1371-4878-405d-859f-89ae90010a63@6c48a",
"displayName": "音乐开",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "a75e1371-4878-405d-859f-89ae90010a63",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "a75e1371-4878-405d-859f-89ae90010a63@f9941",
"displayName": "音乐开",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 49,
"height": 49,
"rawWidth": 49,
"rawHeight": 49,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-24.5,
-24.5,
0,
24.5,
-24.5,
0,
-24.5,
24.5,
0,
24.5,
24.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
49,
49,
49,
0,
0,
49,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-24.5,
-24.5,
0
],
"maxPos": [
24.5,
24.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "a75e1371-4878-405d-859f-89ae90010a63@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "a75e1371-4878-405d-859f-89ae90010a63@6c48a"
}
}
[
{
"__type__": "cc.Prefab",
"_name": "Animal",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "Animal",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 12
}
],
"_active": true,
"_components": [
{
"__id__": 20
},
{
"__id__": 22
}
],
"_prefab": {
"__id__": 24
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Head",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 9
}
],
"_prefab": {
"__id__": 11
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "a6dzIL3W1E35IuXoCRFfNn"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6dl3c1yPVOYZx1iJKGtVyl"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 8,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "36f4FDJJ1Ic7xJG62kgK2v"
},
{
"__type__": "cc.CircleCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"tag": 0,
"_group": 8,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 20,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "149tzpkANOXpG57LmH6BS4"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "d4RvWudWVDfpQR1dJZBQWA",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "water",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
},
{
"__id__": 15
},
{
"__id__": 17
}
],
"_prefab": {
"__id__": 19
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5831s867ZOQIJwgm+uwEOn"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 8,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3b9xj0LydCnLxcVCUVNbXT"
},
{
"__type__": "cc.CircleCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"tag": 0,
"_group": 8,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 20,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "29rS1KzWxEIJcsCRKPGORx"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "10yUmi7JZE/5iqdarulMdp",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "12X03M90FPb4tU4xz9R77a"
},
{
"__type__": "07e2fsEmydEsKZ4PtdOb7Lo",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"Head": {
"__id__": 2
},
"water": {
"__id__": 12
},
"bodyPrefab": {
"__uuid__": "8c4f22c7-20c7-4868-88ea-dedb8004999f",
"__expectedType__": "cc.Prefab"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "51cV3MWXxJKYM+pvgsWjZH"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "1fLq1Ehg5BTYIbo7cQ9ZXL",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "37f1dd8d-17a4-406d-9382-91b0969cf75d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "Animal"
}
}
[
{
"__type__": "cc.Prefab",
"_name": "body",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "body",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
}
],
"_prefab": {
"__id__": 10
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "88f1BI+ppMx7P/El4T9ID8"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": null,
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "21qm6IS7BCm4uJwBm9j3wi"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 16,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "4dHGAlmMpK6rpCATtNAJWk"
},
{
"__type__": "cc.CircleCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"tag": 0,
"_group": 16,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 50,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e1mWfpPutLk7hPZ4GL/Z3X"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "d4eQJIOUhPN5HS2fwVfiqJ",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "8c4f22c7-20c7-4868-88ea-dedb8004999f",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "body"
}
}
[
{
"__type__": "cc.Prefab",
"_name": "food",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "food",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
}
],
"_prefab": {
"__id__": 10
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 30,
"height": 30
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2fZ9FRo8ZD2J3Qqq3PpXWy"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "8f21f897-8cb9-448d-a674-e0574c83e228@da8cd",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "00ZbcQtopI2JWAiMHxJkn+"
},
{
"__type__": "cc.CircleCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"tag": 0,
"_group": 4,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 15,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "bbd/hzdzVJ1rG0lXtNgF7s"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 4,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2d/O9bV5VIyqWQb88vJlpL"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "19m04ZDtRCUpgh0CHITjCk",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "485bac5c-31d1-4090-a194-c8c17e2cc3b1",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "food"
}
}
import { _decorator, Camera, Node, UITransform, v3, v2, misc, Component } from 'cc';
const { ccclass, property } = _decorator;
/**
* 角度控制按钮组件
*/
@ccclass('AngleBtn')
export class AngleBtn extends Component {
/** UI相机 */
@property(Camera)
private uiCamera: Camera = null;
/** 角度按钮节点 */
@property(Node)
private AngleBtn: Node = null;
/** 圆点节点 */
@property(Node)
private CirDot: Node = null;
/** 最大半径 */
@property
private marR: number = 100;
/** UI变换组件 */
private cTransform: UITransform = null;
/** 方向向量 */
private dir: any = v2(0, 0);
/** 当前角度 */
public angle: number = 0;
onLoad() {
console.log(this.CirDot);
// 注册触摸事件
this.AngleBtn.on(Node.EventType.TOUCH_START, this.OnTouchStart, this);
this.AngleBtn.on(Node.EventType.TOUCH_END, this.OnTouchEnd, this);
this.AngleBtn.on(Node.EventType.TOUCH_MOVE, this.OnTouchMove, this);
this.AngleBtn.on(Node.EventType.TOUCH_CANCEL, this.OnTouchEnd, this);
// 获取UI变换组件
this.cTransform = this.AngleBtn.getComponent(UITransform);
}
/**
* 触摸开始回调
*/
OnTouchStart(event: any) {
this.getCirPos(event.getLocation());
}
/**
* 触摸结束回调
*/
OnTouchEnd(event: any) {
// 重置方向和圆点位置
this.dir.x = this.dir.y = 0;
this.CirDot.setPosition(0, 0);
}
/**
* 触摸移动回调
*/
OnTouchMove(event: any) {
this.getCirPos(event.getLocation());
}
/**
* 计算圆点位置和角度
*/
getCirPos(pos: any) {
// 屏幕坐标转世界坐标
const worldPos = this.uiCamera.screenToWorld(v3(pos.x, pos.y, 0));
// 转换到节点本地坐标
const nodePos = this.cTransform.convertToNodeSpaceAR(worldPos);
nodePos.z = 0;
// 计算长度并限制在最大半径内
let len = nodePos.length();
if (len > this.marR) {
nodePos.x = nodePos.x * this.marR / len;
nodePos.y = nodePos.y * this.marR / len;
len = this.marR;
}
// 更新方向向量
this.dir.x = nodePos.x / len;
this.dir.y = nodePos.y / len;
// 设置圆点位置
this.CirDot.setPosition(nodePos);
// 计算角度
this.angle = this.vectorsToDegree(this.dir);
}
/**
* 向量转角度
*/
vectorsToDegree(vector: any): number {
const right = v2(1, 0);
const radian = vector.signAngle(right);
return misc.radiansToDegrees(radian);
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "4552bf53-d402-4727-8c4c-365a5876a2ff",
"files": [],
"subMetas": {},
"userData": {}
}
import {
_decorator, Node, assetManager, SpriteAtlas, Sprite, CircleCollider2D,
math, Collider2D, Contact2DType, ParticleSystem2D, UITransform,
tween, v3, v2, Component, Prefab, PhysicsGroup
} from "cc";
import { Global } from "./Global";
import { PoolManager } from "./PoolManager";
import { FoodType, DirectionType } from "./Enums";
import { isIntersect } from "./uitl";
import { GamePlayer } from "./GamePlayer";
const { ccclass, property } = _decorator;
@ccclass("Animal")
export class Animal extends Component {
@property({
type: Node,
displayName: "头部"
})
private Head: Node = null;
@property({
type: Node,
displayName: "水花"
})
private water: Node = null;
@property(Prefab)
private bodyPrefab: Prefab = null;
private uiSanke: UITransform = null;
private uiFondManger: UITransform = null;
private eye: Collider2D = null;
private Bodys: Node[] = [];
// 蛇身图片资源
private imgHead: any = null;
private imgBody1: any = null;
private imgBody2: any = null;
private imgTait1: any = null;
private imgTait2: any = null;
// 蛇的属性
private isLife: boolean = false;
private scale: number = 0.2;
private speed: number = 600;
private direction: DirectionType = DirectionType.DEFAULT;
private directionSpeed: number = 0;
private taitLen: number = 2;
private energy: number = 0;
private isRunning: boolean = false;
private tag: number = 0;
// 视野范围
private vw: number = Global.visibleSize.width / 2 + 100;
private vh: number = Global.visibleSize.height / 2 + 100;
private ready: boolean = false;
private b: any = null;
/**
* 初始化蛇
*/
init(x: number, y: number, angle: number, skinId: number = 1, scale: number = 0.2,
length: number = 3, taitLen: number = 1, tag: number = 0) {
this.ready = false;
const skinPath = `skin/s${skinId}`;
// 加载皮肤资源
assetManager.loadBundle("resources", (err, bundle) => {
if (err) {
console.warn(err);
return;
}
bundle.load(skinPath, SpriteAtlas, (err, atlas) => {
if (err) {
console.warn(err);
return;
}
// 获取各部分图片
this.imgHead = atlas.getSpriteFrame("head");
this.imgBody1 = atlas.getSpriteFrame("body1");
this.imgBody2 = atlas.getSpriteFrame("body2");
this.imgTait1 = atlas.getSpriteFrame("tait1");
this.imgTait2 = atlas.getSpriteFrame("tait2");
// 初始化属性
this.Bodys = [];
this.scale = scale;
this.speed = this.speed * scale;
this.energy = 0;
this.taitLen = taitLen;
this.tag = tag;
// 设置头部
this.Head.angle = 0;
this.Head.setPosition(x, y);
this.Head.setScale(scale, scale);
this.Head.getComponent(Sprite).spriteFrame = this.imgHead;
this.Head.active = isIntersect(
this.Head.getPosition(),
GamePlayer.ins.camera.node.getPosition(),
this.vw,
this.vh
);
// 设置水花特效
this.water.getComponent(CircleCollider2D).radius = math.randomRangeInt(100, 200);
// 创建身体节点
for (let i = 0; i < length; i++) {
const body = PoolManager.instance.getNode(this.bodyPrefab, this.node);
const collider = body.getComponent(Collider2D);
if (collider) collider.tag = this.tag;
body.setPosition(9999, 9999);
// 设置身体图片
if (i < length - taitLen) {
body.getComponent(Sprite).spriteFrame = i % 2 == 0 ? this.imgBody2 : this.imgBody1;
} else {
body.getComponent(Sprite).spriteFrame = i == length - 1 ? this.imgTait2 : this.imgTait1;
}
body.active = false;
this.Bodys.push(body);
}
this.isLife = true;
});
this.ready = true;
});
}
onEnable() {
// 注册碰撞事件
const headCollider = this.Head.getComponent(Collider2D);
if (headCollider) {
headCollider.on(Contact2DType.BEGIN_CONTACT, this.onBeginHead, this);
}
this.eye = this.water.getComponent(Collider2D);
if (this.eye) {
this.eye.on(Contact2DType.BEGIN_CONTACT, this.onBeginEye, this);
}
this.uiSanke = this.getComponent(UITransform);
this.uiFondManger = Global.gamePlayer.fondManger.node.getComponent(UITransform);
}
onDisable() {
// 注销碰撞事件
const headCollider = this.Head.getComponent(Collider2D);
if (headCollider) {
headCollider.off(Contact2DType.BEGIN_CONTACT, this.onBeginHead, this);
}
if (this.eye) {
this.eye.off(Contact2DType.BEGIN_CONTACT, this.onBeginEye, this);
}
}
/**
* 头部碰撞回调
*/
onBeginHead(selfCollider: Collider2D, otherCollider: Collider2D) {
if (otherCollider.group === PhysicsGroup["Body"] &&
otherCollider.tag != this.tag) {
this.death();
}
}
/**
* 视野碰撞回调
*/
onBeginEye(selfCollider: Collider2D, otherCollider: Collider2D) {
// 碰到食物
if (otherCollider.group === PhysicsGroup["Prop"]) {
const foodType = otherCollider.tag;
this.isRunning = true;
// 计算朝向食物的角度
const headPos = this.Head.getPosition();
const foodPos = otherCollider.node.getPosition();
const worldPos = this.uiFondManger.convertToWorldSpaceAR(foodPos);
const nodePos = this.uiSanke.convertToNodeSpaceAR(worldPos);
const angle = Math.atan2(nodePos.y - headPos.y, nodePos.x - headPos.x);
this.setAngle(angle * (180 / Math.PI));
// 吃掉食物的动画
tween(otherCollider.node)
.to(0.3, {
position: this.Head.getPosition(),
scale: v3(0, 0)
})
.call(() => {
PoolManager.instance.putNode(otherCollider.node);
if (foodType == FoodType.FOOD) {
this.setEnergy(1);
} else if (foodType == FoodType.MONEY) {
this.setEnergy(5);
}
})
.start();
}
// 碰到其他蛇身
else if (otherCollider.group === PhysicsGroup["Body"] &&
otherCollider.tag != this.tag) {
this.setAngle(this.Head.angle + 180);
this.isRunning = true;
}
}
/**
* 设置能量值
*/
setEnergy(value: number) {
this.energy += value;
const needEnergy = Math.floor(this.scale * 10);
if (this.energy >= needEnergy) {
this.grow();
this.energy -= needEnergy;
if (this.scale < 0.8) {
this.scale += 0.005;
}
this.speed = 600 * this.scale;
}
}
/**
* 成长(增加身体节点)
*/
grow() {
const len = this.Bodys.length;
const body = PoolManager.instance.getNode(this.bodyPrefab, this.node);
body.angle = this.Bodys[len - this.taitLen - 1].angle;
body.setPosition(this.Bodys[len - this.taitLen - 1].getPosition());
body.setScale(this.scale, this.scale);
const isEven = (len - this.taitLen) % 2 == 0;
body.getComponent(Sprite).spriteFrame = isEven ? this.imgBody2 : this.imgBody1;
body.getComponent(Collider2D).tag = this.tag;
body.active = isIntersect(
body.getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
this.Bodys.splice(len - this.taitLen, 0, body);
}
/**
* 设置角度
*/
setAngle(angle: number) {
if (this.isLife) {
this.Head.angle = angle;
}
}
/**
* 快速移动
*/
running(dt: number) {
if (!this.isLife) return;
const len = this.Bodys.length - 1;
// 更新身体位置
for (let i = len; i > 1; i--) {
this.Bodys[i].angle = this.Bodys[i - 2].angle;
this.Bodys[i].setPosition(this.Bodys[i - 2].getPosition());
this.Bodys[i].setScale(this.scale, this.scale);
this.Bodys[i].setSiblingIndex(len - i);
this.Bodys[i].active = isIntersect(
this.Bodys[i].getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
}
// 更新第二节位置
this.Bodys[1].angle = this.Head.angle;
this.Bodys[1].setPosition(this.Head.getPosition());
this.Bodys[1].setScale(this.scale, this.scale);
this.Bodys[1].setSiblingIndex(len - 1);
this.Bodys[1].active = isIntersect(
this.Bodys[1].getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
// 更新第一节位置
this.Bodys[0].angle = this.Head.angle;
this.Bodys[0].setPosition(this.getNewPos(this.Head.angle, dt, this.Head.getPosition()));
this.Bodys[0].setScale(this.scale, this.scale);
this.Bodys[0].setSiblingIndex(len);
this.Bodys[0].active = isIntersect(
this.Bodys[0].getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
// 更新头部位置
this.Head.setPosition(
this.getNewPos(this.Head.angle, dt, this.Head.getPosition(), this.speed * 2)
);
this.Head.setScale(this.scale, this.scale);
this.Head.setSiblingIndex(len + 1);
this.Head.active = isIntersect(
this.Head.getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
}
/**
* 普通移动
*/
move(dt: number) {
if (!this.ready || !this.isLife) return;
const len = this.Bodys.length - 1;
// 更新身体位置
for (let i = len; i > 0; i--) {
this.Bodys[i].angle = this.Bodys[i - 1].angle;
this.Bodys[i].setPosition(this.Bodys[i - 1].getPosition());
this.Bodys[i].setScale(this.scale, this.scale);
this.Bodys[i].setSiblingIndex(len - i);
this.Bodys[i].active = isIntersect(
this.Bodys[i].getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
}
// 更新第一节位置
this.Bodys[0].angle = this.Head.angle;
this.Bodys[0].setPosition(this.Head.getPosition());
this.Bodys[0].setScale(this.scale, this.scale);
this.Bodys[0].setSiblingIndex(len);
this.Bodys[0].active = isIntersect(
this.Bodys[0].getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
// 更新头部位置
this.Head.setPosition(
this.getNewPos(this.Head.angle, dt, this.Head.getPosition())
);
this.Head.setScale(this.scale, this.scale);
this.Head.setSiblingIndex(len + 1);
this.Head.active = isIntersect(
this.Head.getPosition(),
Global.gamePlayer.camera.node.getPosition(),
this.vw,
this.vh
);
}
v = v3();
/**
* AI自动移动
*/
autoMove(dt: number) {
if (!this.isLife) return;
// 预判断下一个位置
this.v = this.getNewPos(
this.Head.angle,
dt,
this.Head.getPosition(),
this.speed * 20
);
const halfWidth = Global.MAP_WIDTH / 2;
const halfHeight = Global.MAP_HIGHT / 2;
// 如果要超出地图边界,则转向
if (this.v.x <= -halfWidth || this.v.x >= halfWidth ||
this.v.y <= -halfHeight || this.v.y >= halfHeight) {
const angleAbs = Math.abs(this.Head.angle % 180);
this.direction = DirectionType.DEFAULT;
if (angleAbs > 90) {
this.Head.angle += math.randomRangeInt(180 - angleAbs, 360);
} else {
this.Head.angle -= math.randomRangeInt(angleAbs, 180 + angleAbs);
}
}
// 随机改变方向
else if (math.randomRangeInt(0, 11) == 0) {
this.direction = math.randomRangeInt(0, 3);
this.directionSpeed = math.randomRangeInt(0, 6);
}
// 根据方向更新角度
if (this.direction == DirectionType.DEFAULT) {
// 保持当前角度
} else if (this.direction == DirectionType.LEFT) {
this.Head.angle += this.directionSpeed;
} else {
this.Head.angle -= this.directionSpeed;
}
// 随机切换移动状态
if (this.isRunning) {
this.running(dt);
this.isRunning = math.randomRangeInt(1, 20) != 1;
} else {
this.move(dt);
}
}
/**
* 死亡
*/
death() {
if (!this.isLife) return;
this.isLife = false;
this.node.active = false;
// 死亡后将身体变成食物
this.initFond(this.Bodys.length).then(() => {
const x = math.randomRangeInt(
-(Global.MAP_WIDTH / 2 - 50),
Global.MAP_WIDTH / 2 - 50
);
const y = math.randomRangeInt(
-(Global.MAP_HIGHT / 2 - 50),
Global.MAP_HIGHT / 2 - 50
);
this.reInit(x, y);
});
}
/**
* 重生
*/
reInit(x: number, y: number) {
this.Head.angle = 0;
this.Head.setPosition(x, y);
this.node.active = true;
this.isLife = true;
}
/**
* 计算新位置
*/
getNewPos(angle: number, dt: number, pos: any, speed: number = this.speed) {
const radian = angle / 180 * Math.PI;
const dir = v2(Math.cos(radian), Math.sin(radian));
return v3(
pos.x + dt * dir.x * speed,
pos.y + dt * dir.y * speed,
0
);
}
/**
* 生成食物迭代器
*/
private* _getItemGenerator(count: number) {
for (let i = 0; i < count; i++) {
yield this._initItem(i);
}
}
/**
* 初始化食物
*/
private _initItem(index: number) {
this.b = this.Bodys[index].getPosition();
Global.gamePlayer.fondManger.setFood(
math.randomRangeInt(this.b.x - 10, this.b.x + 11),
math.randomRangeInt(this.b.y - 20, this.b.y + 21)
);
this.Bodys[index].setPosition(9999, 9999);
}
/**
* 初始化食物
*/
async initFond(count: number) {
await this.executePreFrame(this._getItemGenerator(count), 1);
}
/**
* 分帧执行
*/
executePreFrame(generator: Generator, frameTime: number): Promise<boolean> {
return new Promise((resolve, reject) => {
const iter = generator;
const next = () => {
const startTime = new Date().getTime();
for (let result = iter.next(); ; result = iter.next()) {
if (!result || result.done) {
resolve(true);
return;
}
if (new Date().getTime() - startTime > frameTime) {
this.scheduleOnce(() => {
next();
});
return;
}
}
};
next();
});
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "07e2fb04-9b27-44b0-a678-3ed74e6fb2e8",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator } from "cc";
const { ccclass } = _decorator;
/**
* 游戏配置类
*/
@ccclass("Config")
export class Config {
/** 皮肤样式配置 */
public static readonly SKIN_STYLE = [
{
name: "赤蛇",
len: 20,
taitLen: 0,
isLock: false
},
{
name: "紫蛇",
len: 20,
taitLen: 0,
isLock: true
},
{
name: "黄蛇",
len: 20,
taitLen: 0,
isLock: true
},
{
name: "青蛇",
len: 20,
taitLen: 0,
isLock: true
},
{
name: "蛙蛙",
len: 20,
taitLen: 1,
isLock: true
},
{
name: "鸭鸭",
len: 20,
taitLen: 1,
isLock: true
},
{
name: "小蛟",
len: 20,
taitLen: 2,
isLock: true
},
{
name: "小鲤",
len: 20,
taitLen: 10,
isLock: true
},
{
name: "小鳄",
len: 20,
taitLen: 2,
isLock: true
},
{
name: "大鲇鱼",
len: 20,
taitLen: 2,
isLock: true
},
{
name: "红金鱼",
len: 20,
taitLen: 10,
isLock: true
},
{
name: "彩带鱼",
len: 20,
taitLen: 10,
isLock: true
},
{
name: "大眼怪",
len: 20,
taitLen: 2,
isLock: true
},
{
name: "长尾怪",
len: 20,
taitLen: 19,
isLock: true
},
{
name: "青蛙王子",
len: 20,
taitLen: 0,
isLock: true
}
];
}
// 事件名称定义
export const Events = {
changeSkinId: "changeSkinId", // 更换皮肤事件
setGameState: "setGameState", // 设置游戏状态事件
showGOver: "showGOver" // 显示游戏结束界面事件
}
// 食物类型枚举
export enum FoodType {
FOOD = 0, // 普通食物
MONEY = 1 // 金币
}
// 移动方向枚举
export enum DirectionType {
DEFAULT = 0, // 默认方向
LEFT = 1, // 向左
RIGHT = 2 // 向右
}
// 游戏状态枚举
export enum GameState {
READY = 0, // 准备状态
PLAY = 1, // 游戏中
PAUSE = 2, // 暂停
OVER = 3, // 游戏结束
WIN = 4, // 游戏胜利
QUIT = 5 // 退出游戏
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "42cb5335-3e08-4a55-8e71-17ad1a2e0b03",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator, Component, Node, Sprite, Color } from "cc";
const { ccclass, property } = _decorator;
@ccclass("FastBtn")
export class FastBtn extends Component {
// 是否处于加速状态
isFash: boolean = false;
// 按钮精灵组件
@property(Sprite)
sp: Sprite = null;
// 按钮颜色状态
private c1 = new Color(255, 255, 255, 220); // 按下时的颜色
private c2 = new Color(200, 200, 200, 200); // 松开时的颜色
onLoad() {
// 注册触摸事件
this.node.on(Node.EventType.TOUCH_START, this.OnTouchStart, this);
this.node.on(Node.EventType.TOUCH_END, this.OnTouchEnd, this);
this.node.on(Node.EventType.TOUCH_CANCEL, this.OnTouchEnd, this);
}
// 按下时的处理
OnTouchStart() {
this.isFash = true;
this.sp.color = this.c1;
}
// 松开时的处理
OnTouchEnd() {
this.isFash = false;
this.sp.color = this.c2;
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "10feb059-5b1a-431f-8437-bf31d537bec5",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator, Enum, SpriteFrame, math, v3, Sprite, Collider2D, Component, Prefab } from "cc";
import { PoolManager } from "./PoolManager";
import { FoodType } from "./Enums";
import { Global } from "./Global";
const { ccclass, property } = _decorator;
/**
* 食物项配置
*/
@ccclass("Item")
class Item {
@property({
type: FoodType
})
type: FoodType = FoodType.FOOD;
@property(SpriteFrame)
sp: SpriteFrame = null;
}
/**
* 食物管理器
*/
@ccclass("FondManger")
export class FondManger extends Component {
@property([Item])
private Foods: Item[] = [];
@property(Prefab)
private foodPrefab: Prefab = null;
/**
* 获取当前食物数量
*/
getFoodSum() {
return this.node.children.length || 0;
}
/**
* 初始化食物
*/
init(count: number = 100) {
this.initFond(count);
}
/**
* 设置食物
*/
setFood(x?: number, y?: number) {
// 如果没有指定位置,随机生成位置
if (!x) {
x = math.randomRangeInt(
-(Global.MAP_WIDTH / 2 - 50),
Global.MAP_WIDTH / 2 - 50
);
}
if (!y) {
y = math.randomRangeInt(
-(Global.MAP_HIGHT / 2 - 50),
Global.MAP_HIGHT / 2 - 50
);
}
// 随机选择食物类型
const index = math.randomRangeInt(0, this.Foods.length);
// 从对象池获取食物节点
const node = PoolManager.instance.getNode(
this.foodPrefab,
this.node,
v3(x, y, 0)
);
// 设置食物属性
node.angle = 0;
node.setScale(1, 1);
node.getComponent(Sprite).spriteFrame = this.Foods[index].sp;
// 设置碰撞类型
const collider = node.getComponent(Collider2D);
if (collider) {
collider.tag = this.Foods[index].type;
}
node.active = true;
}
/**
* 生成食物迭代器
*/
private* _getItemGenerator(count: number) {
for (let i = 0; i < count; i++) {
yield this._initItem(i);
}
}
/**
* 初始化单个食物
*/
private _initItem(index: number) {
// 从对象池获取食物节点
const node = PoolManager.instance.getNode(this.foodPrefab, this.node);
// 随机生成位置
const x = math.randomRangeInt(-(Global.MAP_WIDTH / 2 - 50), Global.MAP_WIDTH / 2 - 50);
const y = math.randomRangeInt(-(Global.MAP_HIGHT / 2 - 50), Global.MAP_HIGHT / 2 - 50);
// 随机选择食物类型
index = math.randomRangeInt(0, this.Foods.length);
// 设置食物属性
node.angle = 0;
node.setScale(1, 1);
node.setPosition(x, y, 0);
node.getComponent(Sprite).spriteFrame = this.Foods[index].sp;
// 设置碰撞类型
const collider = node.getComponent(Collider2D);
if (collider) {
collider.tag = this.Foods[index].type;
}
node.active = true;
}
/**
* 初始化食物
*/
async initFond(count: number) {
await this.executePreFrame(this._getItemGenerator(count), 1);
}
/**
* 分帧执行
*/
executePreFrame(generator: Generator, frameTime: number): Promise<boolean> {
return new Promise((resolve, reject) => {
const iter = generator;
const next = () => {
const startTime = new Date().getTime();
for (let result = iter.next(); ; result = iter.next()) {
if (!result || result.done) {
resolve(true);
return;
}
if (new Date().getTime() - startTime > frameTime) {
this.scheduleOnce(() => {
next();
});
return;
}
}
};
next();
});
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "e21cf2c0-a612-4e93-b7ec-1c3d901036c8",
"files": [],
"subMetas": {},
"userData": {}
}
import {
_decorator,
UITransform,
Node,
Label,
Camera,
director,
math,
Component,
Prefab,
PhysicsSystem2D,
PhysicsGroup
} from "cc";
import { AngleBtn } from "./AngleBtn";
import { Snake } from "./Snake";
import { FastBtn } from "./FastBtn";
import { Animal } from "./Animal";
import { FondManger } from "./FondManger";
import { Config } from "./Config";
import { Global } from "./Global";
import { GameState, Events } from "./Enums";
import { PoolManager } from "./PoolManager";
import { showToast } from "../../../Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass("GamePlayer")
export class GamePlayer extends Component {
@property(Prefab)
private animalPrefab: Prefab = null;
@property({
displayName: "最多食物",
tooltip: "地图上随机产生食物,如果超过当前值不在产生。"
})
private maxFood: number = 200;
@property({
displayName: "NPC数量",
tooltip: "当前游戏最大NPC角色"
})
private maxAnimal: number = 20;
@property({
type: AngleBtn,
displayName: "旋转按钮"
})
private angleBtn: AngleBtn = null;
@property({
type: FastBtn,
displayName: "快进按钮"
})
private fashBtn: FastBtn = null;
@property(UITransform)
private uiBg: UITransform = null;
@property(Snake)
private snake: Snake = null;
@property(FondManger)
private fondManger: FondManger = null;
@property(Node)
private animalNode: Node = null;
@property(Label)
private LTips: Label = null;
@property(Camera)
camera: Camera = null;
private state: GameState = GameState.READY;
private rebirthSum: number = 0;
private static _ins: GamePlayer = null;
static get ins(): GamePlayer {
return GamePlayer._ins;
}
onLoad() {
GamePlayer._ins = this;
PhysicsSystem2D.instance.enable = true;
Global.gamePlayer = this;
Global.MAP_WIDTH = this.uiBg.contentSize.x;
Global.MAP_HIGHT = this.uiBg.contentSize.y;
// 初始化墙壁
const wallTop = this.uiBg.node.getChildByName("WALL_TOP");
wallTop.setPosition(0, Global.MAP_HIGHT / 2);
wallTop.getComponent(UITransform).width = Global.MAP_WIDTH;
const wallBottom = this.uiBg.node.getChildByName("WALL_BOTTOM");
wallBottom.setPosition(0, -Global.MAP_HIGHT / 2);
wallBottom.getComponent(UITransform).width = Global.MAP_WIDTH;
const wallLeft = this.uiBg.node.getChildByName("WALL_LEFT");
wallLeft.setPosition(-Global.MAP_WIDTH / 2, 0);
wallLeft.getComponent(UITransform).height = Global.MAP_HIGHT;
const wallRight = this.uiBg.node.getChildByName("WALL_RIGHT");
wallRight.setPosition(Global.MAP_WIDTH / 2, 0);
wallRight.getComponent(UITransform).height = Global.MAP_HIGHT;
// 初始化蛇
const skinId = Global.skinId;
this.snake.init(0, 0, 0, skinId, 0.2,
Config.SKIN_STYLE[skinId].len,
Config.SKIN_STYLE[skinId].taitLen, 0);
// 初始化食物和NPC
this.fondManger.init(this.maxFood);
this.initAnimal(this.maxAnimal);
// 设置游戏状态
this.setGameState(GameState.PLAY);
// 注册事件
director.on(Events.showGOver, this.showGOver, this);
director.on(Events.setGameState, this.setGameState, this);
}
onDestroy() {
GamePlayer._ins = null;
}
update(dt: number) {
if (this.state == GameState.READY) return;
// 更新UI提示
this.LTips.string = `长度:${this.snake.getSnakeLen()} 金币:${this.snake.getmoneySum()}`;
// 更新蛇的移动
this.snake.setAngle((360 - this.angleBtn.angle) % 360);
if (this.fashBtn.isFash) {
this.snake.running(dt);
} else {
this.snake.move(dt);
}
// 更新NPC移动
this.animalNode.children.forEach(child => {
child.getComponent(Animal)?.autoMove(dt);
});
}
onPause() {
this.setGameState(GameState.PAUSE);
console.log("pause");
}
setGameState(state: GameState) {
this.state = Number(state);
switch (this.state) {
case GameState.READY:
break;
case GameState.PLAY:
director.resume();
break;
case GameState.PAUSE:
director.pause();
break;
case GameState.OVER:
this.rebirthSum++;
if (this.rebirthSum > 2) return this.showGOver();
showToast("你已死亡!");
break;
case GameState.WIN:
director.pause();
console.log("win", this.snake.getSnakeLen(), this.snake.getmoneySum());
break;
case GameState.QUIT:
director.resume();
director.loadScene("GameMain");
break;
default:
console.log("err");
}
}
play() {
if (this.state == GameState.OVER) {
showToast("你已复活!");
this.state = GameState.PLAY;
this.snake.reInit(
math.randomRangeInt(-(Global.MAP_WIDTH / 2 - 50), Global.MAP_WIDTH / 2 - 50),
math.randomRangeInt(-(Global.MAP_HIGHT / 2 - 50), Global.MAP_HIGHT / 2 - 50)
);
// this.showGOver();
}
}
showGOver() {
console.log("showGOver", this.snake.getSnakeLen(), this.snake.getmoneySum());
}
private* _getItemGenerator(count: number) {
for (let i = 0; i < count; i++) {
yield this._initItem(i);
}
}
private _initItem(index: number) {
const node = PoolManager.instance.getNode(this.animalPrefab, this.animalNode);
const x = math.randomRangeInt(-(Global.MAP_WIDTH / 2 - 50), Global.MAP_WIDTH / 2 - 50);
const y = math.randomRangeInt(-(Global.MAP_HIGHT / 2 - 50), Global.MAP_HIGHT / 2 - 50);
// const skinId = math.randomRangeInt(0, Config.SKIN_STYLE.length);
const skinId = 0;
node.getComponent(Animal)?.init(
x, y,
math.randomRangeInt(0, 360),
skinId, 0.2,
Config.SKIN_STYLE[skinId].len,
Config.SKIN_STYLE[skinId].taitLen,
index + 1
);
}
async initAnimal(count: number) {
await this.executePreFrame(this._getItemGenerator(count), 1);
}
executePreFrame(generator: Generator, frameTime: number): Promise<boolean> {
return new Promise((resolve, reject) => {
const iter = generator;
const next = () => {
const startTime = new Date().getTime();
for (let result = iter.next(); ; result = iter.next()) {
if (!result || result.done) {
resolve(true);
return;
}
if (new Date().getTime() - startTime > frameTime) {
this.scheduleOnce(() => {
next();
});
return;
}
}
};
next();
});
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "2125124b-7bcf-42f9-b351-d87bcc183901",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator, View } from 'cc';
const { ccclass } = _decorator;
/**
* 全局配置类
*/
@ccclass('Global')
export class Global {
/** 插屏广告ID */
public static intersitialAdUnitId: string;
/** 激励视频广告ID */
public static rewardedVideoAdUnitId: string;
/** Banner广告ID */
public static bannerAdAdUnitId: string;
/** 自定义广告ID */
public static customAdUnitId: string;
/** 加载进度 */
public static LoadingRate: number = 0;
/** 调试模式 */
public static Debug: boolean = false;
/** 设计分辨率 */
public static designResolutionSize = View.instance.getDesignResolutionSize();
/** 可视区域大小 */
public static visibleSize = View.instance.getVisibleSize();
/** 宽度缩放比例 */
public static widthScaling = Math.round(
(Global.visibleSize.width / Global.designResolutionSize.width) * 100
) / 100;
/** 游戏玩家实例 */
public static gamePlayer = null;
/** 地图宽度 */
public static MAP_WIDTH: number = 5000;
/** 地图高度 */
public static MAP_HIGHT: number = 4000;
/** 当前皮肤ID */
public static skinId: number = 0;
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "9144f65a-1cca-4a24-8043-48374051cd1c",
"files": [],
"subMetas": {},
"userData": {}
}
...@@ -38,9 +38,9 @@ export class MainGame extends Scene { ...@@ -38,9 +38,9 @@ export class MainGame extends Scene {
keyArr = []; keyArr = [];
async start() { async start() {
this.schedule(() => { // this.schedule(() => {
this.snake.getComponent(Snake).addNode(); // this.snake.getComponent(Snake).addNode();
}, 1); // }, 1);
} }
onDestroy() { onDestroy() {
......
import { _decorator, instantiate, Node, NodePool, Prefab, Vec3 } from "cc";
const { ccclass } = _decorator;
/**
* 对象池管理器
*/
@ccclass("PoolManager")
export class PoolManager {
/** 单例实例 */
private static _instance: PoolManager;
/** 对象池字典 */
private _dictPool: { [key: string]: NodePool } = {};
/** 预制体字典 */
private _dictPrefab: { [key: string]: Node } = {};
/** 获取单例 */
public static get instance(): PoolManager {
if (!this._instance) {
this._instance = new PoolManager();
}
return this._instance;
}
/**
* 复制节点
* @param sourceNode 源节点
* @param parent 父节点
* @returns 复制的节点
*/
public copyNode(sourceNode: Node, parent?: Node): Node {
const name = sourceNode.name;
this._dictPrefab[name] = sourceNode;
let node = null;
if (this._dictPool.hasOwnProperty(name)) {
// 从对象池获取
const pool = this._dictPool[name];
node = pool.size() > 0 ? pool.get() : instantiate(sourceNode);
} else {
// 创建新的对象池
const pool = new NodePool();
this._dictPool[name] = pool;
node = instantiate(sourceNode);
}
if (parent) {
node.parent = parent;
node.active = true;
}
return node;
}
/**
* 获取节点
* @param prefab 预制体或预制体名称
* @param parent 父节点
* @param position 位置
* @returns 节点实例
*/
public getNode(prefab: Node | Prefab | string, parent?: Node, position?: Vec3): Node {
let prefabNode: Node | Prefab;
let prefabName: string;
if (typeof prefab === "string") {
prefabName = prefab;
prefabNode = this._dictPrefab[prefab];
if (!prefabNode) {
console.log("Pool invalid prefab name = ", prefabName);
return null;
}
} else {
prefabNode = prefab;
prefabName = prefab["data"].name;
}
let node = null;
if (this._dictPool.hasOwnProperty(prefabName)) {
// 从对象池获取
const pool = this._dictPool[prefabName];
node = pool.size() > 0 ? pool.get() : instantiate(prefabNode);
} else {
// 创建新的对象池
this._dictPool[prefabName] = new NodePool();
node = instantiate(prefabNode);
}
if (parent) {
node.parent = parent;
node.active = true;
if (position) {
node.position = position;
}
}
return node;
}
/**
* 回收节点
* @param node 要回收的节点
*/
public putNode(node: Node): void {
if (!node) {
console.log("putNode-node is null");
return;
}
const name = node.name;
let pool: NodePool = null;
if (this._dictPool.hasOwnProperty(name)) {
pool = this._dictPool[name];
} else {
pool = new NodePool();
this._dictPool[name] = pool;
}
pool.put(node);
}
/**
* 清空指定名称的对象池
* @param name 对象池名称
*/
public clearPool(name: string): void {
if (this._dictPool.hasOwnProperty(name)) {
this._dictPool[name].clear();
}
}
/**
* 设置预制体
* @param name 预制体名称
* @param prefab 预制体
*/
public setPrefab(name: string, prefab: Node): void {
this._dictPrefab[name] = prefab;
}
/**
* 获取预制体
* @param name 预制体名称
* @returns 预制体
*/
public getPrefab(name: string): Node {
return this._dictPrefab[name];
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "bdf18a2f-1ee1-4fcd-bcf5-e17972dee33d",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator, Component, instantiate, Node, Prefab, Vec3 } from "cc"; import {
_decorator,
assetManager,
Collider2D,
Component,
Sprite, SpriteAtlas,
SpriteFrame,
v2,
v3,
Vec3,
Node, Contact2DType, tween, Prefab, PhysicsGroup,
} from "cc";
import { FoodType } from "./Enums";
import { Global } from "./Global";
import { PoolManager } from "./PoolManager";
import { isIntersect } from "./uitl";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ccclass("Snake")
export class Snake extends Component {
// 属性装饰器
@property({
type: Node,
displayName: "头部"
})
private Head: Node = null;
class SnakeNode { @property(Prefab)
private bodyPrefab: Prefab = null;
node: Node = null; // 私有成员变量
next: SnakeNode = null; private eye: Collider2D = null;
private Bodys: Node[] = [];
private imgHead: SpriteFrame = null;
private imgBody1: SpriteFrame = null;
private imgBody2: SpriteFrame = null;
private imgTait1: SpriteFrame = null;
private imgTait2: SpriteFrame = null;
} // 蛇的状态
private isLife: boolean = false;
private scale: number = 0.2;
private speed: number = 600;
private taitLen: number = 2;
private energy: number = 0;
private tag: number = 0;
private moneySum: number = 0;
const _tempPos = new Vec3(); // 位置相关
const _tempPrePos = new Vec3(); private h: Vec3 = null;
private vw: number = Global.visibleSize.width / 2 + 100;
private vh: number = Global.visibleSize.height / 2 + 100;
private ready: boolean = false;
@ccclass("Snake") // 初始化方法
export class Snake extends Component { public init(x: number, y: number, angle: number, skinId: number = 1, scale: number = 0.2, bodyCount: number = 3, taitLen: number = 1, tag: number = 0) {
this.ready = false;
const bundlePath = `skin/s${skinId}`;
@property(Prefab) this.moneySum = 0;
nodePrefab: Prefab = null;
// 加载皮肤资源
assetManager.loadBundle("resources", (err, bundle) => {
if (err) {
console.warn(err);
return;
}
bundle.load(bundlePath, SpriteAtlas, (err, atlas) => {
if (err) {
console.warn(err);
return;
}
// 初始化蛇的图片资源
this.imgHead = atlas.getSpriteFrame("head");
this.imgBody1 = atlas.getSpriteFrame("body1");
this.imgBody2 = atlas.getSpriteFrame("body2");
this.imgTait1 = atlas.getSpriteFrame("tait1");
this.imgTait2 = atlas.getSpriteFrame("tait2");
// 初始化属性
this.Bodys = [];
this.scale = scale;
this.speed = this.speed * scale;
this.energy = 0;
this.taitLen = taitLen;
this.tag = tag;
// 设置头部
this.Head.angle = 0;
this.Head.setPosition(x, y);
this.Head.setScale(scale, scale);
this.Head.getComponent(Sprite).spriteFrame = this.imgHead;
// 创建身体节点
for (let i = 0; i < bodyCount; i++) {
const body = PoolManager.instance.getNode(this.bodyPrefab, this.node);
const collider = body.getComponent(Collider2D);
if (collider) {
collider.tag = this.tag;
}
body.angle = angle;
body.setPosition(-9999, -9999);
body.setScale(scale, scale);
// 设置身体部分的贴图
if (i < bodyCount - taitLen) {
body.getComponent(Sprite).spriteFrame = i % 2 == 0 ? this.imgBody2 : this.imgBody1;
} else {
body.getComponent(Sprite).spriteFrame = i == bodyCount - 1 ? this.imgTait2 : this.imgTait1;
}
@property body.active = false;
gap: number = 50; this.Bodys.push(body);
}
this.isLife = true;
});
this.ready = true;
});
}
onEnable() {
const collider = this.Head.getComponent(Collider2D);
collider && collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginHead, this);
this.eye = this.Head.getComponent(Collider2D);
this.eye && this.eye.on(Contact2DType.BEGIN_CONTACT, this.onBeginEye, this);
}
onDisable() {
const collider = this.Head.getComponent(Collider2D);
collider && collider.off(Contact2DType.BEGIN_CONTACT, this.onBeginHead, this);
this.eye && this.eye.off(Contact2DType.BEGIN_CONTACT, this.onBeginEye, this);
}
// 碰撞检测
private onBeginHead(selfCollider: Collider2D, otherCollider: Collider2D) {
if (otherCollider.group === PhysicsGroup["Body"] && otherCollider.tag != this.tag) {
this.death();
}
}
head: SnakeNode = null; private onBeginEye(selfCollider: Collider2D, otherCollider: Collider2D) {
last: SnakeNode = null; if (otherCollider.group === PhysicsGroup["Prop"]) {
const foodType = otherCollider.tag;
onLoad() { // 食物吃掉的动画
this.last = this.head = new SnakeNode(); tween(otherCollider.node)
this.head.node = this.node; .to(0.3, {
position: this.Head.getPosition(),
scale: v3(0, 0)
})
.call(() => {
PoolManager.instance.putNode(otherCollider.node);
if (foodType == FoodType.FOOD) {
this.setEnergy(1);
} else if (foodType == FoodType.MONEY) {
this.moneySum += 1;
} }
addNode() { // 生成新的食物
const node = instantiate(this.nodePrefab); if (Global.gamePlayer.fondManger.getFoodSum() < Global.gamePlayer.maxFood) {
this.node.parent.addChild(node); Global.gamePlayer.fondManger.setFood();
node.position = this.last.node.position; }
})
.start();
}
}
const snakeNode = new SnakeNode(); // 能量与成长系统
snakeNode.node = node; private setEnergy(value: number) {
this.last.next = snakeNode; this.energy += value;
this.last = snakeNode; const growthThreshold = Math.floor(10 * this.scale);
if (this.energy >= growthThreshold) {
this.grow();
this.energy -= growthThreshold;
if (this.scale < 0.8) {
this.scale += 0.005;
}
this.speed = 600 * this.scale;
} }
}
// 蛇身体生长
private grow() {
const len = this.Bodys.length;
const newBody = PoolManager.instance.getNode(this.bodyPrefab, this.node);
newBody.angle = this.Bodys[len - this.taitLen - 1].angle;
newBody.setPosition(this.Bodys[len - this.taitLen - 1].getPosition());
newBody.setScale(this.scale, this.scale);
update(dt: number) { const isEvenBody = (len - this.taitLen) % 2 == 0;
let pre: SnakeNode = this.head; newBody.getComponent(Sprite).spriteFrame = isEvenBody ? this.imgBody2 : this.imgBody1;
let current: SnakeNode = this.head.next; newBody.getComponent(Collider2D).tag = this.tag;
while (current) {
const posDir = current.node.getPosition(_tempPos)
.subtract(pre.node.position)
.normalize();
const pos = pre.node.getPosition(_tempPrePos) newBody.active = isIntersect(
.add(posDir.multiplyScalar(this.gap)); newBody.getPosition(),
current.node.setPosition(pos); this.Head.getPosition(),
this.vw,
this.vh
);
pre = current; this.Bodys.splice(len - this.taitLen, 0, newBody);
current = current.next;
} }
setAngle(e) {
this.isLife && (this.Head.angle = e);
}
// 移动相关方法
public running(dt: number) {
if (!this.isLife) return;
// 检查边界
this.h = this.Head.getPosition();
const mapHalfWidth = Global.MAP_WIDTH / 2;
const mapHalfHeight = Global.MAP_HIGHT / 2;
if (
this.h.x <= -mapHalfWidth ||
this.h.x >= mapHalfWidth ||
this.h.y <= -mapHalfHeight ||
this.h.y >= mapHalfHeight
) {
this.death();
}
// 更新身体节点位置
const lastIndex = this.Bodys.length - 1;
for (let i = lastIndex; i > 1; i--) {
this.Bodys[i].angle = this.Bodys[i - 2].angle;
this.Bodys[i].setPosition(this.Bodys[i - 2].getPosition());
this.Bodys[i].setScale(this.scale, this.scale);
this.Bodys[i].setSiblingIndex(lastIndex - i);
// 只显示在视野范围内的身体节点
this.Bodys[i].active = isIntersect(
this.Bodys[i].getPosition(),
this.Head.getPosition(),
this.vw,
this.vh
);
}
// 更新头部位置
this.Head.setPosition(this.getNewPos(
this.Head.angle,
dt,
this.Head.getPosition(),
2 * this.speed
));
this.Head.setScale(this.scale, this.scale);
this.Head.setSiblingIndex(lastIndex + 1);
// 更新相机位置
Global.gamePlayer.camera.node.setPosition(this.Head.getPosition());
}
move(dt: number) {
// 检查是否准备就绪且存活
if (!this.ready || !this.isLife) {
return;
}
// 获取头部位置并检查边界
this.h = this.Head.getPosition();
const mapHalfWidth = Global.MAP_WIDTH / 2;
const mapHalfHeight = Global.MAP_HIGHT / 2;
// 如果超出地图边界则死亡
if (
this.h.x <= -mapHalfWidth ||
this.h.x >= mapHalfWidth ||
this.h.y <= -mapHalfHeight ||
this.h.y >= mapHalfHeight
) {
this.death();
}
// 更新身体节点位置
const lastIndex = this.Bodys.length - 1;
// 从尾部开始更新,每个节点跟随前一个节点的位置
for (let i = lastIndex; i > 0; i--) {
// 更新角度
this.Bodys[i].angle = this.Bodys[i - 1].angle;
// 更新位置
this.Bodys[i].setPosition(this.Bodys[i - 1].getPosition());
// 更新缩放
this.Bodys[i].setScale(this.scale, this.scale);
// 更新渲染顺序
this.Bodys[i].setSiblingIndex(lastIndex - i);
// 只显示在视野范围内的身体节点
this.Bodys[i].active = isIntersect(
this.Bodys[i].getPosition(),
this.Head.getPosition(),
this.vw, // 视野宽度
this.vh // 视野高度
);
}
// 更新第一个身体节点,跟随头部
this.Bodys[0].angle = this.Head.angle;
this.Bodys[0].setPosition(this.Head.getPosition());
this.Bodys[0].setScale(this.scale, this.scale);
this.Bodys[0].setSiblingIndex(lastIndex);
this.Bodys[0].active = true;
// 更新头部位置
this.Head.setPosition(
this.getNewPos(
this.Head.angle,
dt,
this.Head.getPosition()
)
);
this.Head.setScale(this.scale, this.scale);
this.Head.setSiblingIndex(lastIndex + 1);
// 更新相机位置,跟随头部
Global.gamePlayer.camera.node.setPosition(this.Head.getPosition());
}
getSnakeLen() {
return this.Bodys.length;
}
getmoneySum() {
return this.moneySum;
}
reInit(e, t) {
this.Head.angle = 0;
this.Head.setPosition(e, t);
this.node.active = true;
this.isLife = true;
}
// 死亡处理
public death() {
if (!this.isLife) return;
// 隐藏所有身体节点
for (let i = 0; i < this.Bodys.length; i++) {
this.Bodys[i].setPosition(-9999, -9999);
this.Bodys[i].active = false;
}
this.isLife = false;
this.node.active = false;
// 发送游戏结束事件
// director.emit(Events.setGameState, GameState.OVER);
}
// 工具方法 - 计算新位置
private getNewPos(angle: number, dt: number, currentPos: Vec3, speed: number = this.speed): Vec3 {
const radian = angle / 180 * Math.PI;
const direction = v2(Math.cos(radian), Math.sin(radian));
return v3(
currentPos.x + dt * direction.x * speed,
currentPos.y + dt * direction.y * speed,
0
);
} }
} }
\ No newline at end of file
import { _decorator, Component, instantiate, Node, Prefab, Vec3 } from "cc";
const { ccclass, property } = _decorator;
class SnakeNode {
node: Node = null;
next: SnakeNode = null;
}
const _tempPos = new Vec3();
const _tempPrePos = new Vec3();
@ccclass("Snake")
export class Snake extends Component {
@property(Prefab)
nodePrefab: Prefab = null;
@property
gap: number = 50;
head: SnakeNode = null;
last: SnakeNode = null;
onLoad() {
this.last = this.head = new SnakeNode();
this.head.node = this.node;
}
addNode() {
const node = instantiate(this.nodePrefab);
this.node.parent.addChild(node);
node.position = this.last.node.position;
const snakeNode = new SnakeNode();
snakeNode.node = node;
this.last.next = snakeNode;
this.last = snakeNode;
}
update(dt: number) {
let pre: SnakeNode = this.head;
let current: SnakeNode = this.head.next;
while (current) {
const posDir = current.node.getPosition(_tempPos)
.subtract(pre.node.position)
.normalize();
const pos = pre.node.getPosition(_tempPrePos)
.add(posDir.multiplyScalar(this.gap));
current.node.setPosition(pos);
pre = current;
current = current.next;
}
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "917a4745-8677-4e4a-83f1-07545cfd07ef",
"files": [],
"subMetas": {},
"userData": {}
}
import { Vec2, Vec3, Size } from "cc";
/**
* 判断两点是否在指定范围内相交
* @param pos1 位置1
* @param pos2 位置2
* @param rangeW 宽度范围
* @param rangeH 高度范围
* @returns 是否相交
*/
export function isIntersect(pos1: Vec3, pos2: Vec3, rangeW: number, rangeH: number): boolean {
return rangeW > Math.abs(pos1.x - pos2.x) && rangeH > Math.abs(pos1.y - pos2.y);
}
/**
* 获取随机浮点数
* @param min 最小值
* @param max 最大值
* @returns 随机浮点数
*/
export function getRandomFloat(min: number, max: number): number {
return Math.random() * (max - min) + min;
}
/**
* 获取随机位置
* @param viewSize 视图大小
* @param padding 边距
* @returns 随机位置
*/
export function getRandomPosition(viewSize: Size, padding: number = 0): Vec2 {
const x = getRandomFloat(
-viewSize.width / 2 + padding,
viewSize.width / 2 - padding
);
const y = getRandomFloat(
-viewSize.height / 2 + padding,
viewSize.height / 2 - padding
);
return new Vec2(x, y);
}
export function formatTime(seconds: number): string {
const mins = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "608b178c-a272-4460-8658-968541eae7f0",
"files": [],
"subMetas": {},
"userData": {}
}
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "4160d603-9edb-4f83-b030-1cb2f20e1106",
"files": [],
"subMetas": {},
"userData": {}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>frames</key>
<dict>
<key>body1.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{100,100}</string>
<key>spriteSourceSize</key>
<string>{100,100}</string>
<key>textureRect</key>
<string>{{290,84},{100,100}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>body2.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{100,100}</string>
<key>spriteSourceSize</key>
<string>{100,100}</string>
<key>textureRect</key>
<string>{{392,84},{100,100}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>head.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{163,181}</string>
<key>spriteSourceSize</key>
<string>{163,181}</string>
<key>textureRect</key>
<string>{{125,1},{163,181}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>tait1.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{164,81}</string>
<key>spriteSourceSize</key>
<string>{164,81}</string>
<key>textureRect</key>
<string>{{290,1},{164,81}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>tait2.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{191,122}</string>
<key>spriteSourceSize</key>
<string>{191,122}</string>
<key>textureRect</key>
<string>{{1,1},{191,122}}</string>
<key>textureRotated</key>
<true/>
</dict>
</dict>
<key>metadata</key>
<dict>
<key>format</key>
<integer>3</integer>
<key>pixelFormat</key>
<string>RGBA8888</string>
<key>premultiplyAlpha</key>
<false/>
<key>realTextureFileName</key>
<string>s0.png</string>
<key>size</key>
<string>{493,193}</string>
<key>smartupdate</key>
<string>$TexturePacker:SmartUpdate:6735ea558f0aa7c64bd9e92da816ca23:4da33dda424e9dfc0ce663f9309a5b05:a66884bb0e575156b3af2630252c8c2f$</string>
<key>textureFileName</key>
<string>s0.png</string>
</dict>
</dict>
</plist>
{
"ver": "1.0.8",
"importer": "sprite-atlas",
"imported": true,
"uuid": "8f21f897-8cb9-448d-a674-e0574c83e228",
"files": [
".json"
],
"subMetas": {
"da8cd": {
"importer": "sprite-frame",
"uuid": "8f21f897-8cb9-448d-a674-e0574c83e228@da8cd",
"displayName": "",
"id": "da8cd",
"name": "body1",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 290,
"trimY": 84,
"width": 100,
"height": 100,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [],
"indexes": [],
"uv": [],
"nuv": [],
"minPos": [],
"maxPos": []
},
"isUuid": true,
"imageUuidOrDatabaseUri": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a",
"atlasUuid": "8f21f897-8cb9-448d-a674-e0574c83e228"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"7ca68": {
"importer": "sprite-frame",
"uuid": "8f21f897-8cb9-448d-a674-e0574c83e228@7ca68",
"displayName": "",
"id": "7ca68",
"name": "body2",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 392,
"trimY": 84,
"width": 100,
"height": 100,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [],
"indexes": [],
"uv": [],
"nuv": [],
"minPos": [],
"maxPos": []
},
"isUuid": true,
"imageUuidOrDatabaseUri": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a",
"atlasUuid": "8f21f897-8cb9-448d-a674-e0574c83e228"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"9296f": {
"importer": "sprite-frame",
"uuid": "8f21f897-8cb9-448d-a674-e0574c83e228@9296f",
"displayName": "",
"id": "9296f",
"name": "head",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 125,
"trimY": 1,
"width": 163,
"height": 181,
"rawWidth": 163,
"rawHeight": 181,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [],
"indexes": [],
"uv": [],
"nuv": [],
"minPos": [],
"maxPos": []
},
"isUuid": true,
"imageUuidOrDatabaseUri": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a",
"atlasUuid": "8f21f897-8cb9-448d-a674-e0574c83e228"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"e7dcb": {
"importer": "sprite-frame",
"uuid": "8f21f897-8cb9-448d-a674-e0574c83e228@e7dcb",
"displayName": "",
"id": "e7dcb",
"name": "tait1",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 290,
"trimY": 1,
"width": 164,
"height": 81,
"rawWidth": 164,
"rawHeight": 81,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [],
"indexes": [],
"uv": [],
"nuv": [],
"minPos": [],
"maxPos": []
},
"isUuid": true,
"imageUuidOrDatabaseUri": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a",
"atlasUuid": "8f21f897-8cb9-448d-a674-e0574c83e228"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"47d81": {
"importer": "sprite-frame",
"uuid": "8f21f897-8cb9-448d-a674-e0574c83e228@47d81",
"displayName": "",
"id": "47d81",
"name": "tait2",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": true,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 191,
"height": 122,
"rawWidth": 191,
"rawHeight": 122,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [],
"indexes": [],
"uv": [],
"nuv": [],
"minPos": [],
"maxPos": []
},
"isUuid": true,
"imageUuidOrDatabaseUri": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a",
"atlasUuid": "8f21f897-8cb9-448d-a674-e0574c83e228"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"atlasTextureName": "s0.png",
"format": 3,
"uuid": "8f21f897-8cb9-448d-a674-e0574c83e228",
"textureUuid": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a"
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"ver": "1.0.27", "ver": "1.0.27",
"importer": "image", "importer": "image",
"imported": true, "imported": true,
"uuid": "5ac7c111-9ab9-4d53-976a-1be72b2cc718", "uuid": "43c3d349-8e95-48ea-bf1a-e9de526864af",
"files": [ "files": [
".json", ".json",
".png" ".png"
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
"subMetas": { "subMetas": {
"6c48a": { "6c48a": {
"importer": "texture", "importer": "texture",
"uuid": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@6c48a", "uuid": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a",
"displayName": "Guide3", "displayName": "s0",
"id": "6c48a", "id": "6c48a",
"name": "texture", "name": "texture",
"userData": { "userData": {
"wrapModeS": "clamp-to-edge", "wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge", "wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "5ac7c111-9ab9-4d53-976a-1be72b2cc718", "imageUuidOrDatabaseUri": "43c3d349-8e95-48ea-bf1a-e9de526864af",
"isUuid": true, "isUuid": true,
"visible": false, "visible": false,
"minfilter": "linear", "minfilter": "linear",
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
}, },
"f9941": { "f9941": {
"importer": "sprite-frame", "importer": "sprite-frame",
"uuid": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@f9941", "uuid": "43c3d349-8e95-48ea-bf1a-e9de526864af@f9941",
"displayName": "Guide3", "displayName": "s0",
"id": "f9941", "id": "f9941",
"name": "spriteFrame", "name": "spriteFrame",
"userData": { "userData": {
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 586, "width": 493,
"height": 163, "height": 193,
"rawWidth": 586, "rawWidth": 493,
"rawHeight": 163, "rawHeight": 193,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
...@@ -61,17 +61,17 @@ ...@@ -61,17 +61,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-293, -246.5,
-81.5, -96.5,
0, 0,
293, 246.5,
-81.5, -96.5,
0, 0,
-293, -246.5,
81.5, 96.5,
0, 0,
293, 246.5,
81.5, 96.5,
0 0
], ],
"indexes": [ "indexes": [
...@@ -84,12 +84,12 @@ ...@@ -84,12 +84,12 @@
], ],
"uv": [ "uv": [
0, 0,
163, 193,
586, 493,
163, 193,
0, 0,
0, 0,
586, 493,
0 0
], ],
"nuv": [ "nuv": [
...@@ -103,18 +103,18 @@ ...@@ -103,18 +103,18 @@
1 1
], ],
"minPos": [ "minPos": [
-293, -246.5,
-81.5, -96.5,
0 0
], ],
"maxPos": [ "maxPos": [
293, 246.5,
81.5, 96.5,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@6c48a", "imageUuidOrDatabaseUri": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a",
"atlasUuid": "" "atlasUuid": ""
}, },
"ver": "1.0.12", "ver": "1.0.12",
...@@ -129,6 +129,6 @@ ...@@ -129,6 +129,6 @@
"type": "sprite-frame", "type": "sprite-frame",
"hasAlpha": true, "hasAlpha": true,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@6c48a" "redirect": "43c3d349-8e95-48ea-bf1a-e9de526864af@6c48a"
} }
} }
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
"_value": false "_value": false
}, },
"particle-2d": { "particle-2d": {
"_value": false "_value": true
}, },
"audio": { "audio": {
"_value": true "_value": true
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
"gfx-webgl2", "gfx-webgl2",
"intersection-2d", "intersection-2d",
"marionette", "marionette",
"particle-2d",
"physics-2d-builtin", "physics-2d-builtin",
"procedural-animation", "procedural-animation",
"profiler", "profiler",
......
...@@ -11,32 +11,43 @@ ...@@ -11,32 +11,43 @@
"custom_joint_texture_layouts": [], "custom_joint_texture_layouts": [],
"physics": { "physics": {
"collisionGroups": [ "collisionGroups": [
{
"index": 1,
"name": "Player"
},
{ {
"index": 2, "index": 2,
"name": "Wall" "name": "Prop"
}, },
{ {
"index": 3, "index": 3,
"name": "Player" "name": "Enemy"
}, },
{ {
"index": 4, "index": 4,
"name": "Prop" "name": "Body"
} }
], ],
"collisionMatrix": { "collisionMatrix": {
"0": 0, "0": 0,
"1": 0, "1": 20,
"2": 8, "2": 10,
"3": 20, "3": 84,
"4": 8 "4": 42,
"5": 80,
"6": 40
}, },
"maxSubSteps": 1, "maxSubSteps": 1,
"defaultMaterial": "ba21476f-2866-4f81-9c4d-6e359316e448", "defaultMaterial": "ba21476f-2866-4f81-9c4d-6e359316e448",
"fixedTimeStep": 0.016666666666666666, "fixedTimeStep": 0.016666666666666666,
"autoSimulation": true "autoSimulation": true
}, },
"layer": [], "layer": [
{
"name": "Game",
"value": 1
}
],
"version": "2.4.10", "version": "2.4.10",
"id": "a09620d1-8e68-4bb2-b7b7-1e9b271e234d", "id": "a09620d1-8e68-4bb2-b7b7-1e9b271e234d",
"isNew": false "isNew": false
......
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