[Add]: Store

This commit is contained in:
Mohammad_Hasan 2025-11-07 15:52:33 +04:00
parent f666d01370
commit 929f165c45
17 changed files with 1498 additions and 190 deletions

BIN
assets/Buttons/select.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

View File

@ -0,0 +1,34 @@
{
"ver": "2.3.3",
"uuid": "61ef4b76-ea31-470f-af82-bc4fbee2bf69",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"platformSettings": {},
"subMetas": {
"select": {
"ver": "1.0.4",
"uuid": "19079cc6-f48e-4ef9-bf7c-b53624d3bad6",
"rawTextureUuid": "61ef4b76-ea31-470f-af82-bc4fbee2bf69",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 0,
"trimX": 79,
"trimY": 84,
"width": 453,
"height": 240,
"rawWidth": 612,
"rawHeight": 408,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

BIN
assets/Buttons/selected.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@ -0,0 +1,34 @@
{
"ver": "2.3.3",
"uuid": "48aeb9dc-565f-4dff-9ea8-87edec42cd8e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"platformSettings": {},
"subMetas": {
"selected": {
"ver": "1.0.4",
"uuid": "ff64caa3-19f2-46ca-8c65-ba297df0f85b",
"rawTextureUuid": "48aeb9dc-565f-4dff-9ea8-87edec42cd8e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -7,
"trimX": 57,
"trimY": 107,
"width": 386,
"height": 300,
"rawWidth": 500,
"rawHeight": 500,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -68,32 +68,32 @@
"__id__": 8 "__id__": 8
}, },
{ {
"__id__": 13 "__id__": 11
}, },
{ {
"__id__": 32 "__id__": 31
}, },
{ {
"__id__": 38 "__id__": 37
}, },
{ {
"__id__": 43 "__id__": 42
}, },
{ {
"__id__": 45 "__id__": 44
} }
], ],
"_active": true, "_active": true,
"_level": 1, "_level": 1,
"_components": [ "_components": [
{
"__id__": 49
},
{ {
"__id__": 50 "__id__": 50
}, },
{ {
"__id__": 51 "__id__": 51
},
{
"__id__": 52
} }
], ],
"_prefab": null, "_prefab": null,
@ -417,22 +417,21 @@
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
}, },
"_children": [ "_children": [],
{
"__id__": 9
}
],
"_active": true, "_active": true,
"_level": 2, "_level": 2,
"_components": [ "_components": [
{ {
"__id__": 11 "__id__": 9
}, },
{ {
"__id__": 12 "__id__": 10
}, },
{ {
"__id__": 31 "__id__": 29
},
{
"__id__": 30
} }
], ],
"_prefab": null, "_prefab": null,
@ -478,70 +477,12 @@
"groupIndex": 3, "groupIndex": 3,
"_id": "f7jh+kBxhCWakG/dJc/bGy" "_id": "f7jh+kBxhCWakG/dJc/bGy"
}, },
{
"__type__": "cc.Node",
"_name": "alienship1",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": true,
"_level": 3,
"_components": [
{
"__id__": 10
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 165,
"height": 154
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_id": "2cghscU9dIH67SGUN2y7/j"
},
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 9 "__id__": 8
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -566,36 +507,6 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "e3jYYahGtA0r3vMlde8BNs"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "130k9PPWVPubyMVLckxDCJ" "_id": "130k9PPWVPubyMVLckxDCJ"
}, },
{ {
@ -610,7 +521,7 @@
"__uuid__": "9c1eea54-1438-4486-9ff4-c2ba640da280" "__uuid__": "9c1eea54-1438-4486-9ff4-c2ba640da280"
}, },
"heartContainer": { "heartContainer": {
"__id__": 13 "__id__": 11
}, },
"_id": "15NYjVkItKELZAnW57eLwS" "_id": "15NYjVkItKELZAnW57eLwS"
}, },
@ -622,6 +533,9 @@
"__id__": 2 "__id__": 2
}, },
"_children": [ "_children": [
{
"__id__": 12
},
{ {
"__id__": 14 "__id__": 14
}, },
@ -642,16 +556,13 @@
}, },
{ {
"__id__": 26 "__id__": 26
},
{
"__id__": 28
} }
], ],
"_active": true, "_active": true,
"_level": 2, "_level": 2,
"_components": [ "_components": [
{ {
"__id__": 30 "__id__": 28
} }
], ],
"_prefab": null, "_prefab": null,
@ -702,14 +613,14 @@
"_name": "heart1", "_name": "heart1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 15 "__id__": 13
} }
], ],
"_prefab": null, "_prefab": null,
@ -760,7 +671,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 14 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -792,14 +703,14 @@
"_name": "heart2", "_name": "heart2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 17 "__id__": 15
} }
], ],
"_prefab": null, "_prefab": null,
@ -850,7 +761,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 16 "__id__": 14
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -882,14 +793,14 @@
"_name": "heart3", "_name": "heart3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 17
} }
], ],
"_prefab": null, "_prefab": null,
@ -940,7 +851,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 18 "__id__": 16
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -972,14 +883,14 @@
"_name": "heart4", "_name": "heart4",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 21 "__id__": 19
} }
], ],
"_prefab": null, "_prefab": null,
@ -1030,7 +941,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 20 "__id__": 18
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1062,14 +973,14 @@
"_name": "heart5", "_name": "heart5",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 21
} }
], ],
"_prefab": null, "_prefab": null,
@ -1120,7 +1031,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 20
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1152,14 +1063,14 @@
"_name": "heart6", "_name": "heart6",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 25 "__id__": 23
} }
], ],
"_prefab": null, "_prefab": null,
@ -1210,7 +1121,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 24 "__id__": 22
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1242,14 +1153,14 @@
"_name": "heart7", "_name": "heart7",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 25
} }
], ],
"_prefab": null, "_prefab": null,
@ -1300,7 +1211,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 26 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1332,14 +1243,14 @@
"_name": "heart8", "_name": "heart8",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 13 "__id__": 11
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 29 "__id__": 27
} }
], ],
"_prefab": null, "_prefab": null,
@ -1390,7 +1301,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 28 "__id__": 26
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1422,7 +1333,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 13 "__id__": 11
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2147,6 +2058,25 @@
], ],
"_id": "965MCSJRhGs5q7cLGkd0WT" "_id": "965MCSJRhGs5q7cLGkd0WT"
}, },
{
"__type__": "ddcfeMbF29P8LR+YmLBmQhL",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"jet1": {
"__uuid__": "14cd4280-b3a7-4ac6-858b-63ca8d96ba56"
},
"jet2": {
"__uuid__": "1bd8edbd-4e0b-4241-8c6e-55ca6bdae141"
},
"jet3": {
"__uuid__": "75dcc924-38f8-4a67-8fad-20fab2a34518"
},
"_id": "1f9O/SPitFcKsCLHV6CCj8"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "ScoreBox", "_name": "ScoreBox",
@ -2156,17 +2086,17 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 33 "__id__": 32
}, },
{ {
"__id__": 35 "__id__": 34
} }
], ],
"_active": true, "_active": true,
"_level": 2, "_level": 2,
"_components": [ "_components": [
{ {
"__id__": 37 "__id__": 36
} }
], ],
"_prefab": null, "_prefab": null,
@ -2217,14 +2147,14 @@
"_name": "Score", "_name": "Score",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 32 "__id__": 31
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 34 "__id__": 33
} }
], ],
"_prefab": null, "_prefab": null,
@ -2275,7 +2205,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 33 "__id__": 32
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2307,14 +2237,14 @@
"_name": "ScoreLabel", "_name": "ScoreLabel",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 32 "__id__": 31
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_level": 3, "_level": 3,
"_components": [ "_components": [
{ {
"__id__": 36 "__id__": 35
} }
], ],
"_prefab": null, "_prefab": null,
@ -2365,7 +2295,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 35 "__id__": 34
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2397,7 +2327,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 32 "__id__": 31
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2435,14 +2365,14 @@
"_active": true, "_active": true,
"_level": 2, "_level": 2,
"_components": [ "_components": [
{
"__id__": 38
},
{ {
"__id__": 39 "__id__": 39
}, },
{ {
"__id__": 40 "__id__": 41
},
{
"__id__": 42
} }
], ],
"_prefab": null, "_prefab": null,
@ -2493,7 +2423,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 38 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2525,14 +2455,14 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 38 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"duration": 0.1, "duration": 0.1,
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 41 "__id__": 40
} }
], ],
"_N$interactable": true, "_N$interactable": true,
@ -2593,7 +2523,7 @@
{ {
"__type__": "cc.ClickEvent", "__type__": "cc.ClickEvent",
"target": { "target": {
"__id__": 38 "__id__": 37
}, },
"component": "", "component": "",
"_componentId": "e5d86rh+v5CiLRVDqSVqxtt", "_componentId": "e5d86rh+v5CiLRVDqSVqxtt",
@ -2605,12 +2535,12 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 38 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"scoreLabel": null, "scoreLabel": null,
"flashOverlay": { "flashOverlay": {
"__id__": 43 "__id__": 42
}, },
"_id": "51STeOY+lMX6sh3RPWMh9s" "_id": "51STeOY+lMX6sh3RPWMh9s"
}, },
@ -2626,7 +2556,7 @@
"_level": 2, "_level": 2,
"_components": [ "_components": [
{ {
"__id__": 44 "__id__": 43
} }
], ],
"_prefab": null, "_prefab": null,
@ -2677,7 +2607,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 43 "__id__": 42
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2715,14 +2645,14 @@
"_active": true, "_active": true,
"_level": 2, "_level": 2,
"_components": [ "_components": [
{
"__id__": 45
},
{ {
"__id__": 46 "__id__": 46
}, },
{ {
"__id__": 47 "__id__": 48
},
{
"__id__": 49
} }
], ],
"_prefab": null, "_prefab": null,
@ -2773,7 +2703,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 45 "__id__": 44
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2805,14 +2735,14 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 45 "__id__": 44
}, },
"_enabled": true, "_enabled": true,
"duration": 0.1, "duration": 0.1,
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 48 "__id__": 47
} }
], ],
"_N$interactable": true, "_N$interactable": true,
@ -2873,7 +2803,7 @@
{ {
"__type__": "cc.ClickEvent", "__type__": "cc.ClickEvent",
"target": { "target": {
"__id__": 45 "__id__": 44
}, },
"component": "", "component": "",
"_componentId": "3a2abJhRaJFyrM9SBg5rWtB", "_componentId": "3a2abJhRaJFyrM9SBg5rWtB",
@ -2885,7 +2815,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 45 "__id__": 44
}, },
"_enabled": true, "_enabled": true,
"_id": "38cnqxqqNN3YDl21Wkb0g3" "_id": "38cnqxqqNN3YDl21Wkb0g3"

View File

@ -21,15 +21,23 @@ export default class GameData extends cc.Component {
public soundEnabled: boolean = true; public soundEnabled: boolean = true;
public musicEnabled: boolean = true; public musicEnabled: boolean = true;
public selectedShip: number = 1;
public static get instance(): GameData { public static get instance(): GameData {
if (!this._instance) { if (!this._instance) {
this._instance = new GameData(); this._instance = new GameData();
this._instance.soundEnabled = cc.sys.localStorage.getItem('soundEnabled') !== 'false'; this._instance.soundEnabled = cc.sys.localStorage.getItem('soundEnabled') !== 'false';
this._instance.musicEnabled = cc.sys.localStorage.getItem('musicEnabled') !== 'false'; this._instance.musicEnabled = cc.sys.localStorage.getItem('musicEnabled') !== 'false';
this._instance.selectedShip = Number(cc.sys.localStorage.getItem('selectedShip')) || 1;
} }
return this._instance; return this._instance;
} }
public setSelectedShip(ship: number) {
this.selectedShip = ship;
cc.sys.localStorage.setItem('selectedShip', ship.toString());
}
public setSoundEnabled(enabled: boolean) { public setSoundEnabled(enabled: boolean) {
this.soundEnabled = enabled; this.soundEnabled = enabled;
cc.sys.localStorage.setItem('soundEnabled', enabled.toString()); cc.sys.localStorage.setItem('soundEnabled', enabled.toString());

54
assets/Scripts/Store.ts Normal file
View File

@ -0,0 +1,54 @@
// Learn TypeScript:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
const {ccclass, property} = cc._decorator;
import GameData from "./GameData";
@ccclass
export default class NewClass extends cc.Component {
@property(cc.Node)
ship1Selector: cc.Node = null;
@property(cc.Node)
ship2Selector: cc.Node = null;
@property(cc.Node)
ship3Selector: cc.Node = null;
@property(cc.SpriteFrame)
selectFrame: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
selectedFrame: cc.SpriteFrame = null;
onLoad () {
if(GameData.instance.selectedShip === 1) {
this.ship1Selector.getComponent(cc.Sprite).spriteFrame = this.selectedFrame;
} else if(GameData.instance.selectedShip === 2) {
this.ship2Selector.getComponent(cc.Sprite).spriteFrame = this.selectedFrame;
} else if(GameData.instance.selectedShip === 3) {
this.ship3Selector.getComponent(cc.Sprite).spriteFrame = this.selectedFrame;
}
}
update (dt) {
this.ship1Selector.getComponent(cc.Sprite).spriteFrame = this.selectFrame;
this.ship2Selector.getComponent(cc.Sprite).spriteFrame = this.selectFrame;
this.ship3Selector.getComponent(cc.Sprite).spriteFrame = this.selectFrame;
if(GameData.instance.selectedShip === 1) {
this.ship1Selector.getComponent(cc.Sprite).spriteFrame = this.selectedFrame;
} else if(GameData.instance.selectedShip === 2) {
this.ship2Selector.getComponent(cc.Sprite).spriteFrame = this.selectedFrame;
} else if(GameData.instance.selectedShip === 3) {
this.ship3Selector.getComponent(cc.Sprite).spriteFrame = this.selectedFrame;
}
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "d15cde6d-e9ed-4f7d-805b-966a3dbcf4d8",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,23 @@
// Learn TypeScript:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
import GameData from "./GameData";
import SoundManager from "./SoundsManager";
const {ccclass, property} = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
switchPlane(event, customData) {
SoundManager.instance.playEffect('click');
GameData.instance.setSelectedShip(Number(customData));
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "b56649ef-1bc0-457f-b4d4-e020a7dd0729",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

40
assets/Scripts/UsedJet.ts Normal file
View File

@ -0,0 +1,40 @@
// Learn TypeScript:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
import GameData from "./GameData";
const {ccclass, property} = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
@property(cc.SpriteFrame)
jet1: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
jet2: cc.SpriteFrame = null;
@property(cc.SpriteFrame)
jet3: cc.SpriteFrame = null;
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
if(GameData.instance.selectedShip === 1) {
this.node.getComponent(cc.Sprite).spriteFrame = this.jet1;
} else if(GameData.instance.selectedShip === 2) {
this.node.getComponent(cc.Sprite).spriteFrame = this.jet2;
} else if(GameData.instance.selectedShip === 3) {
this.node.getComponent(cc.Sprite).spriteFrame = this.jet3;
}
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "ddcfe31b-176f-4ff0-b47e-6262c199084b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -1,6 +1,6 @@
{ {
"ver": "2.3.3", "ver": "2.3.3",
"uuid": "d743834a-5238-49db-a251-8cb48ce30816", "uuid": "6edf1a67-ee2f-488a-8ad0-8aa805003417",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
@ -11,19 +11,19 @@
"subMetas": { "subMetas": {
"player2": { "player2": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "16a01726-3afc-4177-ae5e-baa3ab1b2c75", "uuid": "1bd8edbd-4e0b-4241-8c6e-55ca6bdae141",
"rawTextureUuid": "d743834a-5238-49db-a251-8cb48ce30816", "rawTextureUuid": "6edf1a67-ee2f-488a-8ad0-8aa805003417",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 7.5, "offsetX": 2.5,
"offsetY": 11.5, "offsetY": 4,
"trimX": 18, "trimX": 5,
"trimY": 11, "trimY": 3,
"width": 479, "width": 159,
"height": 455, "height": 150,
"rawWidth": 500, "rawWidth": 164,
"rawHeight": 500, "rawHeight": 164,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -1,6 +1,6 @@
{ {
"ver": "2.3.3", "ver": "2.3.3",
"uuid": "923d7e23-4edc-4338-971b-e736e7dce92b", "uuid": "0b963317-2ef4-42f4-8bed-713ae721dfbd",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
@ -11,19 +11,19 @@
"subMetas": { "subMetas": {
"player3": { "player3": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "6440914a-8642-4fef-86e4-0efd31840fde", "uuid": "75dcc924-38f8-4a67-8fad-20fab2a34518",
"rawTextureUuid": "923d7e23-4edc-4338-971b-e736e7dce92b", "rawTextureUuid": "0b963317-2ef4-42f4-8bed-713ae721dfbd",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 14.5, "offsetX": 6,
"offsetY": 10, "offsetY": 3.5,
"trimX": 82, "trimX": 33,
"trimY": 9, "trimY": 3,
"width": 477, "width": 192,
"height": 370, "height": 151,
"rawWidth": 612, "rawWidth": 246,
"rawHeight": 408, "rawHeight": 164,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,