Commit aaf83803 authored by 智慧's avatar 智慧

feat:删除无用代码,添加飞机大战背景

parent d4c5cd1b
No preview for this file type
const {ccclass, property} = cc._decorator;
@ccclass
export default class BgControl extends cc.Component {
start () {
}
update (dt) {
for(let bgNode of this.node.children) {
bgNode.y -= 50 * dt;
if (bgNode.y < -700) {
bgNode.y += 700 * 2;
}
}
}
}
{
"ver": "1.0.8",
"uuid": "1a1b6d00-9310-4542-8ccf-052bd2a6c56b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 6
} }
], ],
"_active": false, "_active": false,
...@@ -70,27 +73,12 @@ ...@@ -70,27 +73,12 @@
"_children": [ "_children": [
{ {
"__id__": 3 "__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 14
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 5
},
{
"__id__": 25
},
{
"__id__": 26
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -104,8 +92,8 @@ ...@@ -104,8 +92,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1280, "width": 480,
"height": 720 "height": 648
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -116,8 +104,8 @@ ...@@ -116,8 +104,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
640, 240,
360, 324,
0, 0,
0, 0,
0, 0,
...@@ -240,116 +228,43 @@ ...@@ -240,116 +228,43 @@
"_id": "81GN3uXINKVLeW4+iKSlim" "_id": "81GN3uXINKVLeW4+iKSlim"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Canvas",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "32MJMZ2HRGF4BOf533Avyi"
},
{
"__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 5 "__id__": 2
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_designResolution": {
{ "__type__": "cc.Size",
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" "width": 480,
} "height": 648
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8288e3d4-4c75-4b27-8f01-f7014417f4dd"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
}, },
"_fillStart": 0, "_fitWidth": false,
"_fillRange": 0, "_fitHeight": true,
"_isTrimmedMode": true, "_id": "59Cd0ovbdF4byw5sbjJDx7"
"_atlas": null,
"_id": "97/S6HDq9MeqgmV1Zwnhbb"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bottomPart", "_name": "bg",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 1
}, },
"_children": [ "_children": [
{ {
"__id__": 8 "__id__": 7
}, },
{ {
"__id__": 11 "__id__": 9
} }
], ],
"_active": true, "_active": true,
"_components": [], "_components": [
{
"__id__": 11
}
],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -373,8 +288,8 @@ ...@@ -373,8 +288,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
635.132, 240,
-356.326, 334,
0, 0,
0, 0,
0, 0,
...@@ -396,23 +311,20 @@ ...@@ -396,23 +311,20 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "8c7k8ep/ZFNpO263+1QHz9" "_id": "58AGxdFJZGlbLHl3dixyAf"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_left", "_name": "background1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 6
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 8
},
{
"__id__": 10
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -426,8 +338,8 @@ ...@@ -426,8 +338,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 61, "width": 480,
"height": 67 "height": 700
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -438,8 +350,8 @@ ...@@ -438,8 +350,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-148.464, 0,
34, 0,
0, 0,
0, 0,
0, 0,
...@@ -461,14 +373,14 @@ ...@@ -461,14 +373,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "5ad2wLQLxIN5Eg7OHecSH6" "_id": "73kNHV8ulJWpZLcXYp6mll"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 7
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -479,7 +391,7 @@ ...@@ -479,7 +391,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5" "__uuid__": "4bfe315d-d78b-4dce-9fef-918d66220e5a"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -493,91 +405,20 @@ ...@@ -493,91 +405,20 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "84mqOgJ3JNqZrYVTEU8CjE" "_id": "56jSZnnkNCr5X7DRS/YD3r"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "bcYN/4EKBJhbIAfovo9Ah1"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_right", "_name": "background2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 6
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 12 "__id__": 10
},
{
"__id__": 13
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -591,8 +432,8 @@ ...@@ -591,8 +432,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 60, "width": 480,
"height": 66 "height": 700
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -603,8 +444,8 @@ ...@@ -603,8 +444,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-47.164, 0,
34, 700,
0, 0,
0, 0,
0, 0,
...@@ -626,14 +467,14 @@ ...@@ -626,14 +467,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "46i3stdzpHX6zQHTGnRsNE" "_id": "f1UKe9lFxGc7OfjJOIZ1Cm"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -644,7 +485,7 @@ ...@@ -644,7 +485,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59" "__uuid__": "4bfe315d-d78b-4dce-9fef-918d66220e5a"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -658,646 +499,16 @@ ...@@ -658,646 +499,16 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "42Sh8QS/BHn4WiGyPQPKPt" "_id": "19Wh93Ki5PapyRGzieUgta"
}, },
{ {
"__type__": "cc.Button", "__type__": "1a1b60AkxBFQozPBSvSpsVr",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 6
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "1aj32fYY1IxLesa77E70Qu"
},
{
"__type__": "cc.Node",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 15
},
{
"__id__": 18
},
{
"__id__": 21
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "0aAzbH6R1E+6AmGRrkKa5O"
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 16
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "9bLfcYeeNKrr524vzWchiM"
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cfMLGsq0BMhJARv+ySMAxS"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY"
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 19
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "53LUHHG2pEr79fyrvazXJs"
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 18
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 20
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 138,
"height": 141
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "1blU2OArJIfoC9XfupGxJG"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM"
},
{
"__type__": "cc.Node",
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 22
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d9f+b0lmZGSJJae6zrADhp"
},
{
"__type__": "cc.Node",
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e87DSaFCVJfb2PAUkf4/o7"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_clip": {
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "dey05oKrBIspvsDa6pOIQz"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": true,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "408a6f4ZfpM8Yzyg+IOGg/V",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
}, },
"_enabled": true, "_enabled": true,
"_id": "eaTVUpqahPfZeO9+sUI7RP" "_id": "a9iPVyldxOJKzrQ7Q43Chs"
} }
] ]
\ No newline at end of file
...@@ -6,190 +6,190 @@ const { ccclass, property } = cc._decorator; ...@@ -6,190 +6,190 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class SceneComponent extends MyCocosSceneComponent { export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() { // addPreloadImage() {
// TODO 根据自己的配置预加载图片资源 // // TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url }); // this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 }); // this._imageResList.push({ url: this.data.pic_url_2 });
} // }
addPreloadAudio() { // addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源 // // TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url }); // this._audioResList.push({ url: this.data.audio_url });
} // }
addPreloadAnima() { // addPreloadAnima() {
} // }
onLoadEnd() { // onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考 // // TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData(); // this.initData();
this.initView(); // this.initView();
this.initListener(); // this.initListener();
} // }
_cantouch = null; // _cantouch = null;
initData() { // initData() {
// 所有全局变量 默认都是null // // 所有全局变量 默认都是null
this._cantouch = true; // this._cantouch = true;
} // }
initView() { // initView() {
this.initBg(); // this.initBg();
this.initPic(); // this.initPic();
this.initBtn(); // this.initBtn();
this.initIcon(); // this.initIcon();
} // }
initBg() { // initBg() {
const bgNode = cc.find('Canvas/bg'); // const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax; // bgNode.scale = this._mapScaleMax;
} // }
pic1 = null; // pic1 = null;
pic2 = null; // pic2 = null;
initPic() { // initPic() {
const canvas = cc.find('Canvas'); // const canvas = cc.find('Canvas');
const maxW = canvas.width * 0.7; // const maxW = canvas.width * 0.7;
this.getSprNodeByUrl(this.data.pic_url, (sprNode) => { // this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
const picNode1 = sprNode; // const picNode1 = sprNode;
picNode1.scale = maxW / picNode1.width; // picNode1.scale = maxW / picNode1.width;
picNode1.baseX = picNode1.x; // picNode1.baseX = picNode1.x;
canvas.addChild(picNode1); // canvas.addChild(picNode1);
this.pic1 = picNode1; // this.pic1 = picNode1;
const labelNode = new cc.Node(); // const labelNode = new cc.Node();
labelNode.color = cc.Color.YELLOW; // labelNode.color = cc.Color.YELLOW;
const label = labelNode.addComponent(cc.Label); // const label = labelNode.addComponent(cc.Label);
label.string = this.data.text; // label.string = this.data.text;
label.fontSize = 60; // label.fontSize = 60;
label.lineHeight = 60; // label.lineHeight = 60;
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font; // label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
picNode1.addChild(labelNode); // picNode1.addChild(labelNode);
}); // });
this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => { // this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
const picNode2 = sprNode; // const picNode2 = sprNode;
picNode2.scale = maxW / picNode2.width; // picNode2.scale = maxW / picNode2.width;
canvas.addChild(picNode2); // canvas.addChild(picNode2);
picNode2.x = canvas.width; // picNode2.x = canvas.width;
picNode2.baseX = picNode2.x; // picNode2.baseX = picNode2.x;
this.pic2 = picNode2; // this.pic2 = picNode2;
const labelNode = new cc.Node(); // const labelNode = new cc.Node();
const label = labelNode.addComponent(cc.RichText); // const label = labelNode.addComponent(cc.RichText);
const size = 60 // const size = 60
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font; // label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font;
label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>` // label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>`
label.lineHeight = size; // label.lineHeight = size;
picNode2.addChild(labelNode); // picNode2.addChild(labelNode);
}); // });
} // }
initIcon() { // initIcon() {
const iconNode = this.getSprNode('icon'); // const iconNode = this.getSprNode('icon');
iconNode.zIndex = 5; // iconNode.zIndex = 5;
iconNode.anchorX = 1; // iconNode.anchorX = 1;
iconNode.anchorY = 1; // iconNode.anchorY = 1;
iconNode.parent = cc.find('Canvas'); // iconNode.parent = cc.find('Canvas');
iconNode.x = iconNode.parent.width / 2 - 10; // iconNode.x = iconNode.parent.width / 2 - 10;
iconNode.y = iconNode.parent.height / 2 - 10; // iconNode.y = iconNode.parent.height / 2 - 10;
iconNode.on(cc.Node.EventType.TOUCH_START, () => { // iconNode.on(cc.Node.EventType.TOUCH_START, () => {
this.playAudioByUrl(this.data.audio_url); // this.playAudioByUrl(this.data.audio_url);
}) // })
} // }
curPage = null; // curPage = null;
initBtn() { // initBtn() {
this.curPage = 0; // this.curPage = 0;
const bottomPart = cc.find('Canvas/bottomPart'); // const bottomPart = cc.find('Canvas/bottomPart');
bottomPart.zIndex = 5; // 提高层级 // bottomPart.zIndex = 5; // 提高层级
bottomPart.x = bottomPart.parent.width / 2; // bottomPart.x = bottomPart.parent.width / 2;
bottomPart.y = -bottomPart.parent.height / 2; // bottomPart.y = -bottomPart.parent.height / 2;
const leftBtnNode = bottomPart.getChildByName('btn_left'); // const leftBtnNode = bottomPart.getChildByName('btn_left');
//节点中添加了button组件 则可以添加click事件监听 // //节点中添加了button组件 则可以添加click事件监听
leftBtnNode.on('click', () => { // leftBtnNode.on('click', () => {
if (!this._cantouch) { // if (!this._cantouch) {
return; // return;
} // }
if (this.curPage == 0) { // if (this.curPage == 0) {
return; // return;
} // }
this.curPage = 0 // this.curPage = 0
this.leftMove(); // this.leftMove();
this.playLocalAudio('btn'); // this.playLocalAudio('btn');
}) // })
const rightBtnNode = bottomPart.getChildByName('btn_right'); // const rightBtnNode = bottomPart.getChildByName('btn_right');
//节点中添加了button组件 则可以添加click事件监听 // //节点中添加了button组件 则可以添加click事件监听
rightBtnNode.on('click', () => { // rightBtnNode.on('click', () => {
if (!this._cantouch) { // if (!this._cantouch) {
return; // return;
} // }
if (this.curPage == 1) { // if (this.curPage == 1) {
return; // return;
} // }
this.curPage = 1 // this.curPage = 1
this.rightMove(); // this.rightMove();
// 游戏结束时需要调用这个方法通知系统作业完成 // // 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish(); // onHomeworkFinish();
this.playLocalAudio('btn'); // this.playLocalAudio('btn');
}) // })
} // }
leftMove() { // leftMove() {
this._cantouch = false; // this._cantouch = false;
const len = this.pic1.parent.width; // const len = this.pic1.parent.width;
cc.tween(this.pic1) // cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' }) // .to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
.start(); // .start();
cc.tween(this.pic2) // cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' }) // .to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
.call(() => { // .call(() => {
this._cantouch = true; // this._cantouch = true;
}) // })
.start(); // .start();
} // }
rightMove() { // rightMove() {
this._cantouch = false; // this._cantouch = false;
const len = this.pic1.parent.width; // const len = this.pic1.parent.width;
cc.tween(this.pic1) // cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' }) // .to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
.start(); // .start();
cc.tween(this.pic2) // cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' }) // .to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
.call(() => { // .call(() => {
this._cantouch = true; // this._cantouch = true;
}) // })
.start(); // .start();
} // }
// update (dt) {}, // // update (dt) {},
initListener() { // initListener() {
} // }
playLocalAudio(audioName) { // playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource); // const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false); // const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => { // cc.audioEngine.setFinishCallback(id, () => {
resolve(id); // resolve(id);
}); // });
}) // })
} // }
} }
{
"ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 366,
"height": 336,
"platformSettings": {},
"subMetas": {
"1orange": {
"ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 0,
"trimY": 1,
"width": 366,
"height": 335,
"rawWidth": 366,
"rawHeight": 336,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "uuid": "64c16c90-f717-4765-9f42-4322b7067f29",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 480,
"height": 67, "height": 700,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "background": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "4bfe315d-d78b-4dce-9fef-918d66220e5a",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "64c16c90-f717-4765-9f42-4322b7067f29",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 61, "width": 480,
"height": 67, "height": 700,
"rawWidth": 61, "rawWidth": 480,
"rawHeight": 67, "rawHeight": 700,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 720,
"platformSettings": {},
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 720,
"rawWidth": 1280,
"rawHeight": 720,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 61,
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_right": {
"ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 60,
"height": 66,
"rawWidth": 61,
"rawHeight": 67,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"platformSettings": {},
"subMetas": {
"icon": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment