Commit 13ccf0f9 authored by Đặng Minh Chiến's avatar Đặng Minh Chiến

UI Shop

parent b0fb585a
{
"__type__": "cc.AnimationClip",
"_name": "BtnPlayLevel",
"_objFlags": 0,
"_native": "",
"_duration": 0.5,
"sample": 60,
"speed": 0.4,
"wrapMode": 2,
"curveData": {
"props": {
"scale": [
{
"frame": 0,
"value": {
"__type__": "cc.Vec3",
"x": 1.35,
"y": 1.2,
"z": 1
}
},
{
"frame": 0.25,
"value": {
"__type__": "cc.Vec3",
"x": 1.45,
"y": 1.35,
"z": 1
}
},
{
"frame": 0.5,
"value": {
"__type__": "cc.Vec3",
"x": 1.35,
"y": 1.2,
"z": 1
}
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "4c18894f-769f-4a3b-9955-33211a16110d",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "ItemLevel",
"_objFlags": 0,
"_native": "",
"_duration": 0.5,
"sample": 60,
"speed": 0.4,
"wrapMode": 2,
"curveData": {
"props": {
"scale": [
{
"frame": 0,
"value": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
}
},
{
"frame": 0.25,
"value": {
"__type__": "cc.Vec3",
"x": 1.1,
"y": 1.1,
"z": 1
}
},
{
"frame": 0.5,
"value": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
}
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "9408570f-ff1f-49bd-9952-1f9a18238d28",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"_duration": 1.0166666666666666, "_duration": 1.0166666666666666,
"sample": 60, "sample": 60,
"speed": 1, "speed": 1,
"wrapMode": 1, "wrapMode": 2,
"curveData": { "curveData": {
"comps": { "comps": {
"cc.Sprite": { "cc.Sprite": {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "45d948da-daab-4635-9f85-6409abb0edab"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "45d948da-daab-4635-9f85-6409abb0edab" "__uuid__": "45d948da-daab-4635-9f85-6409abb0edab"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "99b3f64e-e2b4-4fe5-a94a-1e35cdc8d5db"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "99b3f64e-e2b4-4fe5-a94a-1e35cdc8d5db" "__uuid__": "99b3f64e-e2b4-4fe5-a94a-1e35cdc8d5db"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "3b43a330-46ab-429b-b554-5259f962006f"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "3b43a330-46ab-429b-b554-5259f962006f" "__uuid__": "3b43a330-46ab-429b-b554-5259f962006f"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -510,14 +510,15 @@ ...@@ -510,14 +510,15 @@
"__id__": 11 "__id__": 11
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "969ed3f2-bceb-4bff-b3bc-06e672c8edb3"
},
"_clips": [ "_clips": [
null,
{ {
"__uuid__": "969ed3f2-bceb-4bff-b3bc-06e672c8edb3" "__uuid__": "969ed3f2-bceb-4bff-b3bc-06e672c8edb3"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "fabbae1a-eeee-4850-9320-4227ab074bb9"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "fabbae1a-eeee-4850-9320-4227ab074bb9" "__uuid__": "fabbae1a-eeee-4850-9320-4227ab074bb9"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "e8360b20-61d9-4d3e-811c-60554f9e4be7"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "e8360b20-61d9-4d3e-811c-60554f9e4be7" "__uuid__": "e8360b20-61d9-4d3e-811c-60554f9e4be7"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "f2bfa9ec-7a49-4b71-a1aa-5211aa643197"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "f2bfa9ec-7a49-4b71-a1aa-5211aa643197" "__uuid__": "f2bfa9ec-7a49-4b71-a1aa-5211aa643197"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "6327a150-8533-43cf-8be4-d069fce8be59"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "6327a150-8533-43cf-8be4-d069fce8be59" "__uuid__": "6327a150-8533-43cf-8be4-d069fce8be59"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -296,13 +296,15 @@ ...@@ -296,13 +296,15 @@
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": null, "_defaultClip": {
"__uuid__": "3f895b2c-5c25-4f95-9c27-e1c9995b2fb9"
},
"_clips": [ "_clips": [
{ {
"__uuid__": "3f895b2c-5c25-4f95-9c27-e1c9995b2fb9" "__uuid__": "3f895b2c-5c25-4f95-9c27-e1c9995b2fb9"
} }
], ],
"playOnLoad": false, "playOnLoad": true,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -35,12 +35,15 @@ ...@@ -35,12 +35,15 @@
{ {
"__id__": 21 "__id__": 21
}, },
{
"__id__": 23
},
{ {
"__id__": 22 "__id__": 22
} }
], ],
"_prefab": { "_prefab": {
"__id__": 24 "__id__": 25
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -764,6 +767,9 @@ ...@@ -764,6 +767,9 @@
"__id__": 1 "__id__": 1
}, },
"_enabled": true, "_enabled": true,
"animItemLevel": {
"__id__": 22
},
"txtLevel": { "txtLevel": {
"__id__": 6 "__id__": 6
}, },
...@@ -775,6 +781,25 @@ ...@@ -775,6 +781,25 @@
}, },
"_id": "" "_id": ""
}, },
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "9408570f-ff1f-49bd-9952-1f9a18238d28"
},
"_clips": [
{
"__uuid__": "9408570f-ff1f-49bd-9952-1f9a18238d28"
}
],
"playOnLoad": false,
"_id": ""
},
{ {
"__type__": "cc.Button", "__type__": "cc.Button",
"_name": "", "_name": "",
...@@ -789,7 +814,7 @@ ...@@ -789,7 +814,7 @@
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 23 "__id__": 24
} }
], ],
"_N$interactable": true, "_N$interactable": true,
......
{
"ver": "1.1.3",
"uuid": "98b53be0-c23c-4943-b17a-8e8f9b365094",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "Skin",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 5
},
{
"__id__": 8
},
{
"__id__": 11
}
],
"_active": true,
"_components": [
{
"__id__": 19
},
{
"__id__": 20
}
],
"_prefab": {
"__id__": 21
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 268,
"height": 220
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-268,
-115.31,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Selected",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 260,
"height": 210
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
5.278,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5862e380-735b-405e-8ce2-df5896a66d6a"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "40omzdORZOWawJaaYIphNI",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "Worm",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 364,
"height": 120
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.5,
0.5,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "3b9e3467-f92c-46d7-a4d2-d74722b007be"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "72Mxqaxn9M66F0PofjM9G0",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "IconChecked",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": {
"__id__": 10
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 90,
"height": 68
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
105.839,
84.44,
0,
0,
0,
0,
1,
0.8,
0.8,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "40c6a8e0-024f-4726-87e8-39202504765d"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "54IbZIeZFAEZbh/twjSaqi",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "IsLock",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 12
},
{
"__id__": 15
}
],
"_active": false,
"_components": [],
"_prefab": {
"__id__": 18
},
"_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": ""
},
{
"__type__": "cc.Node",
"_name": "Bg",
"_objFlags": 0,
"_parent": {
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
}
],
"_prefab": {
"__id__": 14
},
"_opacity": 220,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 252,
"height": 200
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b62a161a-b647-4e47-b22d-2a717626213d"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "61EKNJjRpA3Z3ZDSeSqG4c",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "IconLock",
"_objFlags": 0,
"_parent": {
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
}
],
"_prefab": {
"__id__": 17
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 72
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "2faca82b-ad33-42bc-baad-cc7ffe9c247f"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e2+AJ7IO9En7+EFFly8y1x",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "2dSgEl3YVG0ImCLcZoWKgK",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f915ba25-abab-4f07-a125-15be3ef77bb6"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "4d091K6DTxNJaD2gMqaswNB",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"id": 0,
"lock": null,
"worm": null,
"selected": null,
"iconChecked": null,
"btnBuy": null,
"btnEquip": null,
"txtEquip": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.3.2",
"uuid": "33860531-1b21-4c18-99fb-06739e12d0bc",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1010,6 +1010,20 @@ ...@@ -1010,6 +1010,20 @@
"loadingLabel": { "loadingLabel": {
"__id__": 14 "__id__": 14
}, },
"backgroundSprite": {
"__id__": 23
},
"spriteFrameBackground": [
{
"__uuid__": "2b5ceff7-7f90-43d8-a623-d660a154c648"
},
{
"__uuid__": "5f89ef98-8a12-4b4b-9668-7c2786f35c65"
},
{
"__uuid__": "fb27d399-b5cc-4081-89da-afb48bf0de9f"
}
],
"_id": "40e5qNKa1PdYwcUW+FeLTB" "_id": "40e5qNKa1PdYwcUW+FeLTB"
}, },
{ {
......
...@@ -5,5 +5,12 @@ export const STATUS_GAME = cc.Enum({ ...@@ -5,5 +5,12 @@ export const STATUS_GAME = cc.Enum({
export const GAME_NAME = "Apple_Worm"; export const GAME_NAME = "Apple_Worm";
export const LEVEL = "Level"; export const LEVEL = "Level";
export const MUSIC = "Music"; export const MUSIC = "Music";
export const BG = "ID_BACKGRROUND";
export const GEM = "GEM";
export const HINT = "HINT";
export const UNDO = "UNDO";
export const WORM_ACTIVE = "Worm_Active"; export const WORM_ACTIVE = "Worm_Active";
export const WORM_SELECT = "Worm_Select"; export const WORM_SELECT = "Worm_Select";
export const IS_FREE_SPIN = "IsFreeSpin";
export const REMAININGTIME = "RemainingTime";
export const ELAPSESTIME = "ElapsedTime";
import { GAME_NAME, LEVEL, MUSIC, WORM_ACTIVE, WORM_SELECT } from "./Constans"; import { BG, GAME_NAME, GEM, HINT, IS_FREE_SPIN, LEVEL, MUSIC, UNDO, WORM_ACTIVE, WORM_SELECT } from "./Constans";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -13,10 +13,32 @@ export default class LocalStorage { ...@@ -13,10 +13,32 @@ export default class LocalStorage {
cc.sys.localStorage.setItem(GAME_NAME + '-' + MUSIC, value); cc.sys.localStorage.setItem(GAME_NAME + '-' + MUSIC, value);
} }
public static setBackground(value: number) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + BG, value);
}
public static setGem(value: number) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + GEM, value);
}
public static setHint(value: number) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + HINT, value);
}
public static setUndo(value: number) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + UNDO, value);
}
public static setSpin(value: boolean) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + IS_FREE_SPIN, value);
}
public static setWormSelected(value: number) { public static setWormSelected(value: number) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + WORM_SELECT, value); cc.sys.localStorage.setItem(GAME_NAME + '-' + WORM_SELECT, value);
} }
public static set(value: number) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + WORM_SELECT, value);
}
public static setWormActive(value: number) { public static setWormActive(value: number) {
let arrayStr = cc.sys.localStorage.getItem(GAME_NAME + '-' + WORM_ACTIVE); let arrayStr = cc.sys.localStorage.getItem(GAME_NAME + '-' + WORM_ACTIVE);
let array = arrayStr ? JSON.parse(arrayStr) : [0]; let array = arrayStr ? JSON.parse(arrayStr) : [0];
...@@ -34,7 +56,7 @@ export default class LocalStorage { ...@@ -34,7 +56,7 @@ export default class LocalStorage {
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + LEVEL)); } else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + LEVEL));
} }
public static getWormActive() { public static getWormActive(): [number] {
let arrayStr = cc.sys.localStorage.getItem(GAME_NAME + '-' + WORM_ACTIVE); let arrayStr = cc.sys.localStorage.getItem(GAME_NAME + '-' + WORM_ACTIVE);
let array = arrayStr ? JSON.parse(arrayStr) : [0]; let array = arrayStr ? JSON.parse(arrayStr) : [0];
return array; return array;
...@@ -47,6 +69,33 @@ export default class LocalStorage { ...@@ -47,6 +69,33 @@ export default class LocalStorage {
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + LEVEL)); } else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + LEVEL));
} }
public static getGem(): number {
if (cc.sys.localStorage.getItem(GAME_NAME + '-' + GEM) == null) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + GEM, 0);
return 0;
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + GEM));
}
public static getHint(): number {
if (cc.sys.localStorage.getItem(GAME_NAME + '-' + HINT) == null) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + HINT, 0);
return 0;
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + HINT));
}
public static getUndo(): number {
if (cc.sys.localStorage.getItem(GAME_NAME + '-' + UNDO) == null) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + UNDO, 0);
return 0;
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + UNDO));
}
public static getBackground(): number {
if (cc.sys.localStorage.getItem(GAME_NAME + '-' + BG) == null) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + BG, 0);
return 0;
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + BG));
}
public static getMusic(): boolean { public static getMusic(): boolean {
if (cc.sys.localStorage.getItem((GAME_NAME + '-' + MUSIC)) == null) { if (cc.sys.localStorage.getItem((GAME_NAME + '-' + MUSIC)) == null) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + MUSIC, true); cc.sys.localStorage.setItem(GAME_NAME + '-' + MUSIC, true);
...@@ -54,6 +103,13 @@ export default class LocalStorage { ...@@ -54,6 +103,13 @@ export default class LocalStorage {
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + MUSIC)); } else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + MUSIC));
} }
public static getIsFreeSpin(): boolean {
if (cc.sys.localStorage.getItem((GAME_NAME + '-' + IS_FREE_SPIN)) == null) {
cc.sys.localStorage.setItem(GAME_NAME + '-' + IS_FREE_SPIN, true);
return true;
} else return JSON.parse(cc.sys.localStorage.getItem(GAME_NAME + '-' + IS_FREE_SPIN));
}
} }
...@@ -18,18 +18,18 @@ export default class GameManager extends cc.Component { ...@@ -18,18 +18,18 @@ export default class GameManager extends cc.Component {
uiManager: UIManager = null; uiManager: UIManager = null;
dataLevels: DataLevel[] = []; dataLevels: DataLevel[] = [];
wormTry: number = 0;
async onLoad() { async onLoad() {
await this.initialize(); await this.initialize();
} }
protected start(): void { protected start(): void {
this.backHone()
} }
async initialize() { async initialize() {
this.dataLevels = await this.loadLevel() as DataLevel[]; this.dataLevels = await this.loadLevel() as DataLevel[];
this.uiManager.initialize(this); this.uiManager.initialize(this);
this.backHone();
} }
backHone() { backHone() {
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
const {ccclass, property} = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
}
// update (dt) {}
}
{
"ver": "1.1.0",
"uuid": "3b31a0c9-6b50-4ec3-87a5-3aac4dff4ccf",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
const {ccclass, property} = cc._decorator;
@ccclass
export default class ItemSkin extends cc.Component {
@property
id: number = 0;
@property(cc.Node)
lock: cc.Node = null;
@property(cc.Sprite)
worm: cc.Sprite = null;
@property(cc.Node)
selected: cc.Node = null;
@property(cc.Node)
iconChecked: cc.Node = null;
@property(cc.Node)
btnBuy: cc.Node = null;
@property(cc.Node)
btnEquip: cc.Node = null;
@property(cc.Label)
txtEquip: cc.Label = null;
isLock: boolean = true;
isSlected: boolean = true;
updateSkin(data){
this.id = data.id;
this.worm.spriteFrame = data.skin;
this.isSlected = data.isSelected;
this.isLock = data.isLock;
if (this.isLock) {
this.lock.active = true;
this.selected.active = false;
this.iconChecked.active = false;
}
if (data.isSelected) {
this.selected.active = true;
}
}
onSelected(){
this.selected.active = true;
if (this.isLock) {
this.btnEquip.active = false;
this.btnBuy.active = true;
}else{
this.btnEquip.active = false;
this.btnBuy.active = true;
if (this.isSlected) {
this.txtEquip.string = "Equipped";
}else{
this.txtEquip.string = "Equip";
}
}
}
}
{
"ver": "1.1.0",
"uuid": "4d0912ba-0d3c-4d25-a0f6-80ca9ab30341",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import UIManager from "../UIManager"; import UIManager from "../UIManager";
import PopupUI, { PopupName } from "./PopupUI"; import PopupUI, { PopupName } from "./PopupUI";
......
import LocalStorage from "../../Data/LocalStorage";
import LuckySpinScreen from "../Screen/LuckySpinScreen";
import UIManager from "../UIManager";
import PopupUI, { PopupName } from "./PopupUI";
const { ccclass, property } = cc._decorator;
@ccclass
export default class RewardPopup extends PopupUI {
@property(cc.Sprite)
iconSprite: cc.Sprite = null;
@property(cc.Label)
txtCount: cc.Label = null;
@property(cc.SpriteFrame)
spriteHint: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
spriteUndo: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
spriteGem10: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
spriteGem20: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
spriteGem30: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
spriteGem40: cc.SpriteFrame = null;
data = null;
luckySpin: LuckySpinScreen = null;
override initialize(manager: UIManager): void {
super.initialize(manager);
this.popupName = PopupName.REWARD;
}
hide(): void {
super.hide();
}
show(): void {
super.show();
}
setUp(data, luckySpin) {
this.luckySpin = luckySpin
this.data = data;
console.log(data);
switch (data.type) {
case 'UNDO':
this.iconSprite.spriteFrame = this.spriteUndo;
this.txtCount.string = data.count;
break;
case 'HINT':
this.iconSprite.spriteFrame = this.spriteHint;
this.txtCount.string = data.count;
break;
case 'GEM':
console.log(data.count);
if (data.count == 10) {
console.log(data.count);
this.iconSprite.spriteFrame = this.spriteGem10;
this.txtCount.string = "+" + data.count;
} else if (data.count == 20) {
this.iconSprite.spriteFrame = this.spriteGem20;
this.txtCount.string = "+" + data.count;
} else if (data.count == 30) {
this.iconSprite.spriteFrame = this.spriteGem30;
this.txtCount.string = "+" + data.count;
} else if (data.count == 40) {
this.iconSprite.spriteFrame = this.spriteGem40;
this.txtCount.string = "+" + data.count;
}
break;
}
}
onClickClaim() {
this.claim(false);
}
onClickClaimX2() {
this.claim(true);
}
claim(isX2: boolean) {
this.hide();
this.luckySpin.isRotary = true;
let count = this.data.count;
if (isX2) {
count = this.data * 2;
}
switch (this.data.type) {
case 'UNDO':
let undo = LocalStorage.getUndo();
LocalStorage.setUndo(undo + count);
break;
case 'HINT':
let hint = LocalStorage.getHint();
LocalStorage.setHint(hint + count);
break;
case 'GEM':
let gem = LocalStorage.getGem();
LocalStorage.setGem(gem + count);
}
}
}
{
"ver": "1.1.0",
"uuid": "46f04aa9-1197-494a-ab0f-1163612ec7d7",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import UIManager from "../UIManager"; import UIManager from "../UIManager";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
export enum PopupName { export enum PopupName {
DAILYREWARD, LOSE, WIN, SETTING, SHOPCOIN, SHOPSKIN DAILYREWARD, LOSE, WIN, SETTING, SHOPCOIN, SHOPSKIN, REWARD
} }
@ccclass @ccclass
export default class PopupUI extends cc.Component { export default class PopupUI extends cc.Component {
popupName: PopupName = PopupName.SETTING; popupName: PopupName = PopupName.SETTING;
uiManager: UIManager; uiManager: UIManager;
...@@ -25,9 +18,20 @@ export default class PopupUI extends cc.Component { ...@@ -25,9 +18,20 @@ export default class PopupUI extends cc.Component {
show() { show() {
this.node.active = true; this.node.active = true;
this.uiManager.activeTransparent();
this.node.scale = 0;
cc.tween(this.node)
.to(1, { scale: 1 }, { easing: "elasticOut" })
.start();
} }
hide() { hide() {
this.node.active = false; cc.tween(this.node)
.to(1, { scale: 0 }, { easing: "elasticIn" })
.call(() => {
this.node.active = false;
this.uiManager.deActiveTransparent();
})
.start();
} }
} }
import LocalStorage from "../../Data/LocalStorage";
import UIManager from "../UIManager";
import ItemSkin from "./ItemSkin";
import PopupUI, { PopupName } from "./PopupUI";
const { ccclass, property } = cc._decorator;
@ccclass
export default class ShopSkin extends PopupUI {
@property([cc.SpriteFrame])
listSkin: cc.SpriteFrame[] = [];
@property(cc.Sprite)
skinWorm: cc.Sprite = null;
@property(cc.Prefab)
itemSkin: cc.Prefab = null;
@property(cc.Node)
containerSkin: cc.Node = null;
@property(cc.Node)
showSkin: cc.Node = null;
override initialize(manager: UIManager): void {
super.initialize(manager);
this.popupName = PopupName.SHOPSKIN;
}
showShopSkin() {
for (let index: number = 0; index < this.listSkin.length; index++) {
let skin: cc.Node = cc.instantiate(this.itemSkin);
this.containerSkin.addChild(skin);
skin.getComponent(ItemSkin).updateSkin({
id: index,
skin: this.listSkin[index],
isLock : LocalStorage.getWormActive().includes(index),
isSelected: LocalStorage.getWormSelected() == index ? true: false
});
}
}
hide(): void {
super.hide();
}
show(): void {
super.show();
}
}
{
"ver": "1.1.0",
"uuid": "77150b55-020d-4457-a2c8-abb452b3ecb7",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -5,6 +5,8 @@ const { ccclass, property } = cc._decorator; ...@@ -5,6 +5,8 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class ItemLevel extends cc.Component { export default class ItemLevel extends cc.Component {
@property(cc.Animation)
animItemLevel: cc.Animation = null;
@property(cc.Label) @property(cc.Label)
txtLevel: cc.Label = null; txtLevel: cc.Label = null;
@property(cc.Node) @property(cc.Node)
...@@ -12,14 +14,16 @@ export default class ItemLevel extends cc.Component { ...@@ -12,14 +14,16 @@ export default class ItemLevel extends cc.Component {
@property(cc.Node) @property(cc.Node)
iconLocked: cc.Node = null; iconLocked: cc.Node = null;
idBackground: number = 0;
level: number = 0; level: number = 0;
isLock = true; isLock = true;
initialize(level) { initialize(level, idBackground) {
this.isLock = false; this.isLock = false;
this.level = level - 1; this.level = level - 1;
this.txtLevel.string = level + ""; this.txtLevel.string = level + "";
this.setup(LocalStorage.getLevel()); this.setup(LocalStorage.getLevel());
this.idBackground = idBackground;
} }
setup(curentLevel){ setup(curentLevel){
...@@ -31,6 +35,7 @@ export default class ItemLevel extends cc.Component { ...@@ -31,6 +35,7 @@ export default class ItemLevel extends cc.Component {
this.iconChecked.active = false; this.iconChecked.active = false;
this.iconLocked.active = false; this.iconLocked.active = false;
this.txtLevel.node.color.fromHEX("#FFFFFF"); this.txtLevel.node.color.fromHEX("#FFFFFF");
this.animItemLevel.play("ItemLevel");
} else { } else {
this.iconChecked.active = false; this.iconChecked.active = false;
this.iconLocked.active = true; this.iconLocked.active = true;
...@@ -42,6 +47,7 @@ export default class ItemLevel extends cc.Component { ...@@ -42,6 +47,7 @@ export default class ItemLevel extends cc.Component {
retload(){ retload(){
this.setup(LocalStorage.getLevel()); this.setup(LocalStorage.getLevel());
} }
onClickLevel() { onClickLevel() {
if (this.isLock) { if (this.isLock) {
return; return;
......
...@@ -7,38 +7,43 @@ ...@@ -7,38 +7,43 @@
import ItemLevel from "./ItemLevel"; import ItemLevel from "./ItemLevel";
const {ccclass, property} = cc._decorator; const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class Page extends cc.Component { export default class Page extends cc.Component {
@property(cc.Prefab) @property(cc.Prefab)
itemLevelPrefab : cc.Prefab = null; itemLevelPrefab: cc.Prefab = null;
@property(cc.Node) @property(cc.Node)
containerLevels: cc.Node = null; containerLevels: cc.Node = null;
listItem: ItemLevel[] = []; listItem: ItemLevel[] = [];
levelPerPage: number = 0; levelPerPage: number = 0;
countBackground: number = 0;
initialize(start, end, levelPerPage){ initialize(start, end, levelPerPage) {
let levelIndex = start; let levelIndex = start;
for (let i = 0; i < levelPerPage; i++) { for (let i = 0; i < levelPerPage; i++) {
let itemLevel: cc.Node = cc.instantiate(this.itemLevelPrefab); let itemLevel: cc.Node = cc.instantiate(this.itemLevelPrefab);
this.containerLevels.addChild(itemLevel); this.containerLevels.addChild(itemLevel);
let l = itemLevel.getComponent(ItemLevel) let l = itemLevel.getComponent(ItemLevel)
l.initialize(levelIndex); l.initialize(levelIndex, this.countBackground);
this.listItem.push(l); this.listItem.push(l);
if (levelIndex < end) { if (levelIndex < end) {
levelIndex++; levelIndex++;
} }
this.countBackground++;
if (this.countBackground > 2) {
this.countBackground = 0;
}
} }
} }
reload(){ reload() {
for (let i = 0; i < this.listItem.length; i++) { for (let i = 0; i < this.listItem.length; i++) {
this.listItem[i].retload(); this.listItem[i].retload();
} }
} }
} }
...@@ -21,22 +21,21 @@ export default class LevelScreen extends ScreenUI { ...@@ -21,22 +21,21 @@ export default class LevelScreen extends ScreenUI {
@property(cc.Node) @property(cc.Node)
containerNodePage: cc.Node = null; containerNodePage: cc.Node = null;
@property(cc.Vec3)
pageStep: cc.Vec3 = new cc.Vec3(850, 0, 0);
@property(cc.Label)
txtBtnLevel: cc.Label = null;
totalLevels: number = 0; totalLevels: number = 0;
levelPerPage: number = 12; levelPerPage: number = 12;
curentLevel: number = 0; curentLevel: number = 0;
totalPages: number = 0; totalPages: number = 0;
currentPage: number = 0; currentPage: number = 0;
targetPos: cc.Vec3 = new cc.Vec3(0, 0, 0); targetPos: cc.Vec3 = new cc.Vec3(0, 0, 0);
@property(cc.Vec3)
pageStep: cc.Vec3 = new cc.Vec3(850, 0, 0);
tweenTime: number = 0.5; tweenTime: number = 0.5;
listNodePage: NodePage[] = [] listNodePage: NodePage[] = []
listPage: Page[] = [] listPage: Page[] = []
isActive: boolean = false; isActive: boolean = false;
isMove: boolean = true; isMove: boolean = true;
...@@ -118,15 +117,23 @@ export default class LevelScreen extends ScreenUI { ...@@ -118,15 +117,23 @@ export default class LevelScreen extends ScreenUI {
for (let index = 0; index < this.listPage.length; index++) { for (let index = 0; index < this.listPage.length; index++) {
this.listPage[index].reload(); this.listPage[index].reload();
} }
for (let i = 0; i < this.listNodePage.length; i++) { for (let i = 0; i < this.listNodePage.length; i++) {
this.listNodePage[i].deActiveNode(); this.listNodePage[i].deActiveNode();
} }
this.listNodePage[0].activeNode(); this.listNodePage[0].activeNode();
} }
updateTxtLevel(){
this.txtBtnLevel.string = "LEVEL " + (LocalStorage.getLevel() + 1) ;
}
onClickPlayLevel(){
console.log(this.curentLevel);
}
override active(): void { override active(): void {
super.active(); super.active();
this.updateTxtLevel();
if (!this.isActive) { if (!this.isActive) {
this.isActive = true; this.isActive = true;
} else { } else {
......
import LocalStorage from '../../Data/LocalStorage';
// Learn TypeScript: // Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute: // Learn Attribute:
...@@ -14,9 +15,23 @@ export default class Loading extends cc.Component { ...@@ -14,9 +15,23 @@ export default class Loading extends cc.Component {
loadingBar: cc.ProgressBar = null; loadingBar: cc.ProgressBar = null;
@property(cc.Label) @property(cc.Label)
loadingLabel: cc.Label = null; loadingLabel: cc.Label = null;
@property(cc.Sprite)
backgroundSprite: cc.Sprite = null;
@property([cc.SpriteFrame])
spriteFrameBackground: cc.SpriteFrame[] = [];
progress: number = 0; progress: number = 0;
protected onLoad(): void {
this.setBackground();
}
setBackground(){
this.backgroundSprite.spriteFrame = this.spriteFrameBackground[LocalStorage.getBackground()];
}
protected start(): void { protected start(): void {
cc.director.preloadScene("Game", this.onProgress.bind(this), this.onLoaded); cc.director.preloadScene("Game", this.onProgress.bind(this), this.onLoaded);
} }
......
// Learn TypeScript: import { ELAPSESTIME, REMAININGTIME } from "../../Data/Constans";
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html import LocalStorage from "../../Data/LocalStorage";
// Learn Attribute: import RewardPopup from "../Popup/PopupReward";
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html import { PopupName } from "../Popup/PopupUI";
// Learn life-cycle callbacks: import TimerSpin from "../TimerSpin";
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import UIManager from "../UIManager"; import UIManager from "../UIManager";
import ScreenUI, { ScreenName } from "./ScreenUI"; import ScreenUI, { ScreenName } from "./ScreenUI";
const {ccclass, property} = cc._decorator; const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class LuckySpinScreen extends ScreenUI { export default class LuckySpinScreen extends ScreenUI {
@property(cc.Node)
wheel: cc.Node = null;
@property(cc.Node)
point: cc.Node = null;
@property(cc.Label)
txtTitleTime: cc.Label = null;
@property(cc.Label)
timerLabel: cc.Label = null;
@property(cc.Button)
btnFree: cc.Button = null;
@property(cc.Button)
btnSpin: cc.Button = null;
private isSpinning: boolean = false;
isRotary: boolean = true;
isSpin: boolean = true;
currentRotation = 0;
minRotation = -10;
maxRotation = 10;
rotationSpeed = 150;
private prizes: { type: string; count: number }[] = [
{ type: "UNDO", count: 1 },
{ type: "GEM", count: 30 },
{ type: "HINT", count: 2 },
{ type: "GEM", count: 20 },
{ type: "UNDO", count: 2 },
{ type: "GEM", count: 10 },
{ type: "HINT", count: 1 },
{ type: "GEM", count: 40 },
];
override initialize(uiManager: UIManager): void { override initialize(uiManager: UIManager): void {
super.initialize(uiManager); super.initialize(uiManager);
this.screenName = ScreenName.LUCKYSPIN; this.screenName = ScreenName.LUCKYSPIN;
} }
async onSpinButtonClicked() {
if (this.isSpinning) {
return;
}
this.isRotary = false;
this.wheel.rotation = 0;
this.isSpinning = true;
this.isSpin = true;
const randomIndex = Math.floor(Math.random() * this.prizes.length);
const angle = (360 / this.prizes.length) * randomIndex + 3620;
this.scheduleOnce(()=>{
this.isSpin = false;
}, 3.5)
await new Promise(() => {
cc.tween(this.wheel)
.to(4, { angle: angle }, { easing: "sineInOut" })
.call(() => {
const prize = this.prizes[randomIndex];
this.isSpinning = false;
TimerSpin.Instance.startTimerSpin();
this.updateButton();
this.scheduleOnce(() => {
this.point.angle = 0;
let rewardPopup = this.uiManager.showPopup(PopupName.REWARD);
rewardPopup.getComponent(RewardPopup).setUp(prize, this);
}, 0.7);
})
.start();
});
}
update(dt: number) {
if (this.isRotary) {
this.wheel.angle += 10 * dt;
}
if (this.isSpin) {
this.currentRotation += this.rotationSpeed * dt;
if (this.currentRotation > this.maxRotation) {
this.currentRotation = this.maxRotation;
this.rotationSpeed = -this.rotationSpeed;
} else if (this.currentRotation < this.minRotation) {
this.currentRotation = this.minRotation;
this.rotationSpeed = -this.rotationSpeed;
}
this.point.angle = this.currentRotation;
}
}
updateButton() {
if (LocalStorage.getIsFreeSpin()) {
this.activeButtonSpin();
} else {
this.activeButtonFree();
}
}
activeButtonSpin() {
this.btnSpin.node.active = true;
this.btnFree.node.active = false;
this.txtTitleTime.node.active = false;
this.timerLabel.node.active = false;
}
activeButtonFree() {
this.btnFree.node.active = true;
this.txtTitleTime.node.active = true;
this.timerLabel.node.active = true;
this.btnSpin.node.active = false;
}
override active(): void {
super.active();
this.isRotary = true;
this.isSpin = false;
this.updateButton();
}
override deactive(): void {
super.deactive();
}
} }
...@@ -16,22 +16,27 @@ export default class MainScreen extends ScreenUI { ...@@ -16,22 +16,27 @@ export default class MainScreen extends ScreenUI {
@property(cc.Node) @property(cc.Node)
logo: cc.Node = null; logo: cc.Node = null;
@property([cc.Prefab]) @property([cc.Prefab])
listWormPrefab: cc.Prefab[] = []; listWormPrefab: cc.Prefab[] = [];
@property(cc.Node) @property(cc.Node)
containerSkins: cc.Node = null; containerSkins: cc.Node = null;
@property(cc.Label)
txtGem: cc.Label = null;
@property(cc.Label)
txtPlayLevel: cc.Label = null;
@property(cc.Button)
btnTry: cc.Button = null;
isMove: boolean = true; isMove: boolean = true;
listWorm: cc.Node[] = []; listWorm: cc.Node[] = [];
currentIndex: number = 0; currentIndex: number = 0;
moveDuration: number = 0.5; moveDuration: number = 0.5;
wormId: number = 0;
override initialize(uiManager: UIManager): void { override initialize(uiManager: UIManager): void {
super.initialize(uiManager); super.initialize(uiManager);
this.screenName = ScreenName.MAINMENU; this.screenName = ScreenName.MAINMENU;
this.initializeListWorm(); this.initializeListWorm();
} }
initializeListWorm() { initializeListWorm() {
...@@ -39,9 +44,13 @@ export default class MainScreen extends ScreenUI { ...@@ -39,9 +44,13 @@ export default class MainScreen extends ScreenUI {
this.containerSkins.removeAllChildren(); this.containerSkins.removeAllChildren();
this.currentIndex = 0; this.currentIndex = 0;
let listWormActive: [number] = LocalStorage.getWormActive(); let listWormActive: [number] = LocalStorage.getWormActive();
let newListWorm: cc.Prefab[] = this.listWormPrefab.filter((item, i ) => { let newListWorm: cc.Prefab[] = this.listWormPrefab.filter((item, i) => {
return !listWormActive.includes(i); return !listWormActive.includes(i);
}) })
if (newListWorm.length == 0) {
newListWorm = this.listWormPrefab;
this.btnTry.interactable = false;
}
for (let index = 0; index < newListWorm.length; index++) { for (let index = 0; index < newListWorm.length; index++) {
let worm: cc.Node = cc.instantiate(newListWorm[index]); let worm: cc.Node = cc.instantiate(newListWorm[index]);
this.containerSkins.addChild(worm); this.containerSkins.addChild(worm);
...@@ -71,18 +80,18 @@ export default class MainScreen extends ScreenUI { ...@@ -71,18 +80,18 @@ export default class MainScreen extends ScreenUI {
moveItems(isNext: boolean) { moveItems(isNext: boolean) {
this.isMove = false; this.isMove = false;
cc.tween(this.listWorm[this.currentIndex]) cc.tween(this.listWorm[this.currentIndex])
.to(this.moveDuration, { position: cc.v3(0, 0) , scale: 1.2 }) .to(this.moveDuration, { position: cc.v3(0, 0), scale: 1.2 })
.call(()=> { .call(() => {
this.isMove = true; this.isMove = true;
}) })
.start(); .start();
if (isNext) { if (isNext) {
cc.tween(this.listWorm[this.currentIndex - 1]) cc.tween(this.listWorm[this.currentIndex - 1])
.to(this.moveDuration, { position: cc.v3(-450, 0), scale: 1 }) .to(this.moveDuration, { position: cc.v3(-450, 0), scale: 1 })
.start(); .start();
} else { } else {
cc.tween(this.listWorm[this.currentIndex + 1 ]) cc.tween(this.listWorm[this.currentIndex + 1])
.to(this.moveDuration, { position: cc.v3(450, 0), scale: 1 }) .to(this.moveDuration, { position: cc.v3(450, 0), scale: 1 })
.start(); .start();
} }
...@@ -90,6 +99,7 @@ export default class MainScreen extends ScreenUI { ...@@ -90,6 +99,7 @@ export default class MainScreen extends ScreenUI {
override active(): void { override active(): void {
super.active(); super.active();
this.updateGem();
cc.tween(this.logo) cc.tween(this.logo)
.to(0.3, { position: cc.v3(0, 500) }, { easing: "bounceOut" }) .to(0.3, { position: cc.v3(0, 500) }, { easing: "bounceOut" })
.start(); .start();
...@@ -104,7 +114,31 @@ export default class MainScreen extends ScreenUI { ...@@ -104,7 +114,31 @@ export default class MainScreen extends ScreenUI {
this.uiManager.showMessage("Is Comming"); this.uiManager.showMessage("Is Comming");
} }
onClickLevel(){ onClickLevel() {
this.uiManager.activeScreen(ScreenName.LEVEL); this.uiManager.activeScreen(ScreenName.LEVEL);
} }
updateGem() {
this.txtGem.string = LocalStorage.getGem() + "";
}
updateBtnPlay() {
this.txtPlayLevel.string = (LocalStorage.getLevel() + 1) + ""
}
onClickPlay() {
}
onClickLuckySpin(){
this.uiManager.activeScreen(ScreenName.LUCKYSPIN);
}
onClickTryWorm(){
let worm = this.listWorm[this.currentIndex].name;
let id = '';
if (worm) {
id = worm.split("_")[1];
}
this.uiManager.gameManager.wormTry = Number(id);
}
} }
// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import { GAME_NAME } from "../Data/Constans";
import LocalStorage from "../Data/LocalStorage";
import LuckySpinScreen from "./Screen/LuckySpinScreen";
const { ccclass, property } = cc._decorator;
@ccclass
export default class TimerSpin extends cc.Component {
@property(cc.Label)
timerLabel: cc.Label = null;
@property(cc.Node)
nodeLuckySpin: cc.Node = null;
luckySpin: LuckySpinScreen = null;
time: number = 12 * 60 * 60;
public static Instance: TimerSpin = null;
protected onLoad(): void {
window.addEventListener('unload', this.unloadHandler.bind(this));
TimerSpin.Instance = this;
this.luckySpin = this.nodeLuckySpin.getComponent(LuckySpinScreen);
}
unloadHandler() {
cc.sys.localStorage.setItem(GAME_NAME + "_REMAININGTIME", Math.floor(Date.now() / 1000).toString());
cc.sys.localStorage.setItem(GAME_NAME + "_ELAPSESTIME", this.time);
}
protected start(): void {
if (!LocalStorage.getIsFreeSpin()) {
const storedTime = cc.sys.localStorage.getItem(GAME_NAME + "_REMAININGTIME");
const timeCount = cc.sys.localStorage.getItem(GAME_NAME + "_ELAPSESTIME");
const storedTimestamp = parseInt(storedTime);
const currentTime = Math.floor(Date.now() / 1000);
const elapsedTime = currentTime - storedTimestamp;
this.time = timeCount;
this.time -= elapsedTime;
this.updateTimerLabel();
this.startTimerSpin();
}
}
startTimerSpin() {
LocalStorage.setSpin(false);
this.schedule(this.updateCountdown, 1);
}
updateCountdown() {
this.time = this.time - 1;
cc.sys.localStorage.setItem(GAME_NAME + "_REMAININGTIME", Math.floor(Date.now() / 1000).toString());
cc.sys.localStorage.setItem(GAME_NAME + "_ELAPSESTIME", this.time);
this.updateTimerLabel();
if (this.time <= 0) {
LocalStorage.setSpin(true);
this.luckySpin.activeButtonSpin();
this.unschedule(this.updateCountdown);
this.time = 12*60*60;
}
}
updateTimerLabel() {
const hours = Math.floor(this.time / 3600);
const minutes = Math.floor((this.time % 3600) / 60);
const seconds = this.time % 60;
const formattedTime = `${this.formatNumber(hours)}:${this.formatNumber(minutes)}:${this.formatNumber(seconds)}`;
this.timerLabel.string = formattedTime;
}
formatNumber(value: number): string {
return value < 10 ? `0${value}` : value.toString();
}
}
{
"ver": "1.1.0",
"uuid": "20e7f32a-2e9a-4d07-9506-e6a5a2e9c6e8",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// Learn life-cycle callbacks: // Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import LocalStorage from "../Data/LocalStorage";
import GameManager from "../GamePlay/GameManager"; import GameManager from "../GamePlay/GameManager";
import Message from "./Message"; import Message from "./Message";
import PopupUI from "./Popup/PopupUI"; import PopupUI from "./Popup/PopupUI";
...@@ -18,12 +19,21 @@ export default class UIManager extends cc.Component { ...@@ -18,12 +19,21 @@ export default class UIManager extends cc.Component {
screens: ScreenUI[] = []; screens: ScreenUI[] = [];
@property([PopupUI]) @property([PopupUI])
popups: PopupUI[] = []; popups: PopupUI[] = [];
@property(cc.Node)
transparentPopup: cc.Node = null;
@property(Message) @property(Message)
message: Message = null; message: Message = null;
gameManager: GameManager = null; @property(cc.Sprite)
spriteBackground: cc.Sprite = null;
@property([cc.SpriteFrame])
spriteFrameBackground: cc.SpriteFrame[] = [];
gameManager: GameManager = null;
initialize(manager: GameManager) { initialize(manager: GameManager) {
this.gameManager = manager; this.gameManager = manager;
...@@ -34,6 +44,7 @@ export default class UIManager extends cc.Component { ...@@ -34,6 +44,7 @@ export default class UIManager extends cc.Component {
for (let i = 0; i < this.popups.length; i++) { for (let i = 0; i < this.popups.length; i++) {
this.popups[i].initialize(this); this.popups[i].initialize(this);
} }
this.setBackground();
} }
deactiveAllScreen() { deactiveAllScreen() {
...@@ -42,7 +53,7 @@ export default class UIManager extends cc.Component { ...@@ -42,7 +53,7 @@ export default class UIManager extends cc.Component {
} }
} }
activeScreen(screenName, hideAll = true, showTopUI = true) { activeScreen(screenName, hideAll = true) {
let screen = null; let screen = null;
for (let i = 0; i < this.screens.length; i++) { for (let i = 0; i < this.screens.length; i++) {
if (this.screens[i].screenName == screenName) { if (this.screens[i].screenName == screenName) {
...@@ -78,6 +89,14 @@ export default class UIManager extends cc.Component { ...@@ -78,6 +89,14 @@ export default class UIManager extends cc.Component {
return popup; return popup;
} }
activeTransparent(){
this.transparentPopup.active = true;
}
deActiveTransparent(){
this.transparentPopup.active = false;
}
getPopup(popupName) { getPopup(popupName) {
let popup = null; let popup = null;
for (let i = 0; i < this.popups.length; i++) { for (let i = 0; i < this.popups.length; i++) {
...@@ -92,6 +111,7 @@ export default class UIManager extends cc.Component { ...@@ -92,6 +111,7 @@ export default class UIManager extends cc.Component {
this.message.showMessage(message); this.message.showMessage(message);
} }
setBackground(){
this.spriteBackground.spriteFrame = this.spriteFrameBackground[LocalStorage.getBackground()];
}
} }
{ {
"start-scene": "2b1f57e0-e640-4283-a5ac-1bac931a4d9f" "start-scene": "7602b4d5-03ba-4bb0-b72f-840c3c878b7e"
} }
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