├── server ├── Bubble.js ├── Player.js ├── Game.js ├── TiledMap.js └── Net.js ├── .gitattributes ├── project.json ├── assets ├── Texture │ ├── bg.jpg │ ├── around.png │ ├── bubble.png │ ├── dead.png │ ├── inner.png │ ├── player.png │ ├── water_up.png │ ├── water_down.png │ ├── water_left.png │ ├── water_right.png │ ├── water_center.png │ ├── water_up_far.png │ ├── water_down_far.png │ ├── water_left_far.png │ ├── water_right_far.png │ ├── dead.png.meta │ ├── bg.jpg.meta │ ├── bubble.png.meta │ ├── inner.png.meta │ ├── player.png.meta │ ├── water_up.png.meta │ ├── around.png.meta │ ├── water_center.png.meta │ ├── water_down.png.meta │ ├── water_left.png.meta │ ├── water_right.png.meta │ ├── water_up_far.png.meta │ ├── water_down_far.png.meta │ ├── water_left_far.png.meta │ └── water_right_far.png.meta ├── map │ ├── map_plaza_tile2.png │ ├── map0.tmx.meta │ ├── map_plaza_tile2.png.meta │ └── map0.tmx ├── map.meta ├── Scene.meta ├── Script.meta ├── Texture.meta ├── prefab.meta ├── prefab │ ├── bubble.prefab.meta │ ├── player.prefab.meta │ ├── water_down.prefab.meta │ ├── water_left.prefab.meta │ ├── water_right.prefab.meta │ ├── water_up.prefab.meta │ ├── water_center.prefab.meta │ ├── water_down_far.prefab.meta │ ├── water_left_far.prefab.meta │ ├── water_right_far.prefab.meta │ ├── water_up_far.prefab.meta │ ├── water_up.prefab │ ├── water_down.prefab │ ├── water_left.prefab │ ├── water_right.prefab │ ├── water_center.prefab │ ├── water_up_far.prefab │ ├── water_down_far.prefab │ ├── water_left_far.prefab │ ├── water_right_far.prefab │ ├── player.prefab │ └── bubble.prefab ├── Scene │ ├── helloworld.fire.meta │ └── helloworld.fire └── Script │ ├── Bubble.js.meta │ ├── Main.js.meta │ ├── Player.js.meta │ ├── GConnectMgr.js.meta │ ├── MapController.js.meta │ ├── PlayerController.js.meta │ ├── RoomController.js.meta │ ├── Main.js │ ├── MapController.js │ ├── PlayerController.js │ ├── Player.js │ ├── RoomController.js │ ├── GConnectMgr.js │ └── Bubble.js ├── runpic └── run_bubble.png ├── jsconfig.json ├── README.md ├── settings └── project.json └── .gitignore /server/Bubble.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /assets/Texture/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/bg.jpg -------------------------------------------------------------------------------- /runpic/run_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/runpic/run_bubble.png -------------------------------------------------------------------------------- /assets/Texture/around.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/around.png -------------------------------------------------------------------------------- /assets/Texture/bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/bubble.png -------------------------------------------------------------------------------- /assets/Texture/dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/dead.png -------------------------------------------------------------------------------- /assets/Texture/inner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/inner.png -------------------------------------------------------------------------------- /assets/Texture/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/player.png -------------------------------------------------------------------------------- /assets/Texture/water_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_up.png -------------------------------------------------------------------------------- /assets/Texture/water_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_down.png -------------------------------------------------------------------------------- /assets/Texture/water_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_left.png -------------------------------------------------------------------------------- /assets/Texture/water_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_right.png -------------------------------------------------------------------------------- /assets/map/map_plaza_tile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/map/map_plaza_tile2.png -------------------------------------------------------------------------------- /assets/Texture/water_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_center.png -------------------------------------------------------------------------------- /assets/Texture/water_up_far.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_up_far.png -------------------------------------------------------------------------------- /assets/Texture/water_down_far.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_down_far.png -------------------------------------------------------------------------------- /assets/Texture/water_left_far.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_left_far.png -------------------------------------------------------------------------------- /assets/Texture/water_right_far.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dxxia/Bubble/HEAD/assets/Texture/water_right_far.png -------------------------------------------------------------------------------- /assets/map/map0.tmx.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.4", 3 | "uuid": "0d3c8e8f-edec-4674-9ac7-5a7786395869", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/map.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "61528738-aae3-4a23-a0b0-bf6fd766a980", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Script.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Texture.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7b81d4e8-ec84-4716-968d-500ac1d78a54", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ab18d685-c498-4b8f-9c34-fa973204eeef", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/bubble.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "39e36736-5013-4742-b04f-2ed2ece52be7", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/player.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "74e37804-d41a-420f-a56c-7cf34e8d7392", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_down.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a2879d92-1b64-44db-8958-30e165fb5291", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_left.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "38fd1ef8-01d8-4fe2-8676-01321c28ebb1", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_right.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "8d9e9492-abc1-49dd-9ee7-4c2dc72f969d", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_up.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6bb68914-006b-464b-b800-e99576d7e4e6", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_center.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "35f4085b-7a49-4d2d-ab53-0651f38e2fcb", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_down_far.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "634a7b0c-4e46-4318-9fd3-f4287d9002c0", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_left_far.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "85ab9ff0-ed35-4158-b901-ee4bb11879ae", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_right_far.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "e40f4d3b-ca52-4976-bae1-43836be61364", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/water_up_far.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "b5a46e85-5714-432d-9019-ace597725cfc", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Scene/helloworld.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Script/Bubble.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "029e7e31-ac34-4973-a9f8-54e686da51cb", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Main.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "99432dce-a361-4a9e-8202-e797ee7ab4b4", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Player.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "28c65002-bb2d-4ceb-a6fd-ca464217f8f5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/GConnectMgr.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "8c6d6d59-4f38-4276-a780-b6ee9721edc6", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/MapController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "0fe7727d-0a0c-4f5c-b23c-12fdccfe494a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/PlayerController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "9bde9184-cb57-4681-bc31-ae9c2323bafe", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/RoomController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "280c3aec-6492-4a9d-9f51-a9b00b570b4a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bubble 2 | 【CocosCreator】网络版泡泡堂Demo 3 | 4 | 网络通讯使用WebSocket实现,简单搭建了网络通信框架,目前只实现了玩家在地图里的移动,一个房间支持最多4人加入。 5 | 后续可以进行放技能和死亡功能的扩展。 6 | 7 | 运行方法: 8 | 1. 安装CocosCreator,项目是V1.8版本. 9 | 2. 安装Node.js,项目用的是V4.4.3版本。 10 | 3. 打开命令行,启动服务端:"node 项目路径\server\Game.js"。 11 | 4. 打开CocosCreator,启动客户端即可,可以分别打开一个模拟器和一个网页端,可以体验联机。 12 | 13 | 运行截图: 14 | ![运行](runpic/run_bubble.png) 15 | [运行图片](https://img.wenhairu.com/image/Nv7sI) 16 | -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "start-scene": "current", 3 | "group-list": [ 4 | "default" 5 | ], 6 | "collision-matrix": [ 7 | [ 8 | true 9 | ] 10 | ], 11 | "excluded-modules": [], 12 | "design-resolution-width": 960, 13 | "design-resolution-height": 640, 14 | "fit-width": false, 15 | "fit-height": true, 16 | "use-project-simulator-setting": false, 17 | "simulator-orientation": false, 18 | "use-customize-simulator": false, 19 | "simulator-resolution": { 20 | "width": 960, 21 | "height": 640 22 | }, 23 | "cocos-analytics": { 24 | "enable": false, 25 | "appID": "13798", 26 | "appSecret": "959b3ac0037d0f3c2fdce94f8421a9b2" 27 | } 28 | } -------------------------------------------------------------------------------- /assets/Texture/dead.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "c2e8f2ba-1c04-4cab-ad43-afd900a98c3e", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "dead": { 9 | "ver": "1.0.3", 10 | "uuid": "164243e1-1c14-46ef-95d1-d3d6f3acb2aa", 11 | "rawTextureUuid": "c2e8f2ba-1c04-4cab-ad43-afd900a98c3e", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": -1, 17 | "trimX": 0, 18 | "trimY": 2, 19 | "width": 42, 20 | "height": 38, 21 | "rawWidth": 42, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/bg.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "540f1700-f454-4c81-b69e-42556b88ec15", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "bg": { 9 | "ver": "1.0.3", 10 | "uuid": "bcef7278-22a7-407a-9d49-ff93ce9a9596", 11 | "rawTextureUuid": "540f1700-f454-4c81-b69e-42556b88ec15", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 1136, 20 | "height": 800, 21 | "rawWidth": 1136, 22 | "rawHeight": 800, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/bubble.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "214e41ba-3991-4db9-86ad-a13636845fd3", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "bubble": { 9 | "ver": "1.0.3", 10 | "uuid": "e6958668-317f-4d60-9bc9-3a498e0cf236", 11 | "rawTextureUuid": "214e41ba-3991-4db9-86ad-a13636845fd3", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 1, 18 | "trimY": 1, 19 | "width": 36, 20 | "height": 36, 21 | "rawWidth": 38, 22 | "rawHeight": 38, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/inner.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "493ebd6a-e61c-4ded-9580-8dff36b8f755", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "inner": { 9 | "ver": "1.0.3", 10 | "uuid": "a2e3dcf5-e815-45c4-9c67-a53b0ffdb79f", 11 | "rawTextureUuid": "493ebd6a-e61c-4ded-9580-8dff36b8f755", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 1, 18 | "trimY": 1, 19 | "width": 36, 20 | "height": 36, 21 | "rawWidth": 38, 22 | "rawHeight": 38, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/player.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "1a9739ee-f685-4219-a138-e34598b3c504", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "player": { 9 | "ver": "1.0.3", 10 | "uuid": "04b0dcdb-1a66-4629-9d08-318d96c95567", 11 | "rawTextureUuid": "1a9739ee-f685-4219-a138-e34598b3c504", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 44, 20 | "height": 55, 21 | "rawWidth": 44, 22 | "rawHeight": 55, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_up.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "984df973-a876-4e92-b98b-a47fd9898bd3", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_up": { 9 | "ver": "1.0.3", 10 | "uuid": "4e948a39-2db2-4026-9b18-d887b232e6ea", 11 | "rawTextureUuid": "984df973-a876-4e92-b98b-a47fd9898bd3", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 40, 20 | "height": 40, 21 | "rawWidth": 40, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/around.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "cd2fa6f2-40b5-4cb1-8e82-96c0a64a2953", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "around": { 9 | "ver": "1.0.3", 10 | "uuid": "2c4ebdec-4c26-49e8-99ad-49ee36225b93", 11 | "rawTextureUuid": "cd2fa6f2-40b5-4cb1-8e82-96c0a64a2953", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 148, 20 | "height": 148, 21 | "rawWidth": 148, 22 | "rawHeight": 148, 23 | "borderTop": 43, 24 | "borderBottom": 54, 25 | "borderLeft": 34, 26 | "borderRight": 34, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_center.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "5cb84dd5-bcdb-4576-9272-62f54226b51d", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_center": { 9 | "ver": "1.0.3", 10 | "uuid": "af91d83a-6142-440c-9c82-fd825b9fa014", 11 | "rawTextureUuid": "5cb84dd5-bcdb-4576-9272-62f54226b51d", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 41, 20 | "height": 39, 21 | "rawWidth": 41, 22 | "rawHeight": 39, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_down.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "073ff89b-608f-480b-afe7-a77d92d08076", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_down": { 9 | "ver": "1.0.3", 10 | "uuid": "362315e2-5d33-45e9-8479-3e66460b24fc", 11 | "rawTextureUuid": "073ff89b-608f-480b-afe7-a77d92d08076", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 40, 20 | "height": 40, 21 | "rawWidth": 40, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_left.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "75b2cc53-7363-4f9c-a36c-0879c8250c2a", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_left": { 9 | "ver": "1.0.3", 10 | "uuid": "13ec8243-3d67-4ef2-bccc-752770843c4e", 11 | "rawTextureUuid": "75b2cc53-7363-4f9c-a36c-0879c8250c2a", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 40, 20 | "height": 40, 21 | "rawWidth": 40, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_right.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "3392d3fe-77c8-4ffb-be80-0c4b60040503", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_right": { 9 | "ver": "1.0.3", 10 | "uuid": "b4c7c5b7-be2b-4bd7-a180-af281bc8f19f", 11 | "rawTextureUuid": "3392d3fe-77c8-4ffb-be80-0c4b60040503", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 40, 20 | "height": 40, 21 | "rawWidth": 40, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_up_far.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "711a421b-6d7e-4bbd-9d35-6f41f9316f61", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_up_far": { 9 | "ver": "1.0.3", 10 | "uuid": "78daa21c-de78-47e1-909e-acf2f5883d75", 11 | "rawTextureUuid": "711a421b-6d7e-4bbd-9d35-6f41f9316f61", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 40, 20 | "height": 38, 21 | "rawWidth": 40, 22 | "rawHeight": 38, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_down_far.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "cc6a9f1f-ab0e-460b-89aa-5b5761971684", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_down_far": { 9 | "ver": "1.0.3", 10 | "uuid": "6df57b01-c690-4f7b-8f2f-85961bad0ea5", 11 | "rawTextureUuid": "cc6a9f1f-ab0e-460b-89aa-5b5761971684", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 40, 20 | "height": 38, 21 | "rawWidth": 40, 22 | "rawHeight": 38, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_left_far.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "5d1615af-0945-4065-b36b-7d4e2028eba8", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_left_far": { 9 | "ver": "1.0.3", 10 | "uuid": "6b89e395-4a26-4f23-a5fa-62f7d9869aa3", 11 | "rawTextureUuid": "5d1615af-0945-4065-b36b-7d4e2028eba8", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 39, 20 | "height": 40, 21 | "rawWidth": 39, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/map/map_plaza_tile2.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "721d2163-e50d-49fa-a531-39fc03fe4498", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "map_plaza_tile2": { 9 | "ver": "1.0.3", 10 | "uuid": "6e8c2427-d4c2-4160-9528-2d0f2995b758", 11 | "rawTextureUuid": "721d2163-e50d-49fa-a531-39fc03fe4498", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 480, 20 | "height": 40, 21 | "rawWidth": 480, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/water_right_far.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "54fc7b43-fef5-40e9-a494-cf3c49571548", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "water_right_far": { 9 | "ver": "1.0.3", 10 | "uuid": "d829be4d-13a1-4162-bea5-a6e29a560a0f", 11 | "rawTextureUuid": "54fc7b43-fef5-40e9-a494-cf3c49571548", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 39, 20 | "height": 40, 21 | "rawWidth": 39, 22 | "rawHeight": 40, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/map/map0.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | eJxjZmBgYIZiVjSamUg5XJiVSPXoZhNjPynuIMduVhLV0MoNtLab2DjGJQcANT4B8Q== 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /assets/Script/Main.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | }, 16 | 17 | // use this for initialization 18 | onLoad: function () { 19 | this.GConnectMgr = this.node.getComponent("GConnectMgr"); 20 | this._uid = null; 21 | 22 | this.init(); 23 | }, 24 | 25 | 26 | init: function(){ 27 | this.GConnectMgr.regPushEvent("userInfo", function(pack){ 28 | this._uid = pack.data.uid; 29 | }); 30 | }, 31 | 32 | getUid: function(){ 33 | return this._uid; 34 | } 35 | // called every frame, uncomment this function to activate update callback 36 | // update: function (dt) { 37 | 38 | // }, 39 | }); 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ -------------------------------------------------------------------------------- /server/Player.js: -------------------------------------------------------------------------------- 1 | var TiledMap = require("./TiledMap"); 2 | var Net = require("./Net"); 3 | 4 | var Player = function(uid){ 5 | //坐标 6 | this.pos = {x: 0, y: 0}; 7 | //重生坐标 8 | this.bornPos = {x: 0, y: 0}; 9 | //移动方向 10 | this.moveDirect = "stay"; // stay,up,down,left,right 11 | //移动速度 12 | this.moveSpeed = 100; 13 | //id 14 | this.uid = uid; 15 | //队伍id 16 | this.teamId = 0; 17 | 18 | this.born = function(){ 19 | this.pos = this.bornPos; 20 | }; 21 | 22 | this.onExit = function(){ 23 | 24 | }; 25 | 26 | this.move = function(dt){ 27 | if(this.moveDirect == "stay"){ 28 | return; 29 | } 30 | if(!TiledMap.moveJudge(this.pos, this.moveDirect)){ 31 | console.log("此路不通!"); 32 | this.setMoveDirection("stay"); 33 | return; 34 | } 35 | 36 | switch(this.moveDirect){ 37 | case "up": 38 | this.pos.y += this.moveSpeed * dt; 39 | break; 40 | case "down": 41 | this.pos.y -= this.moveSpeed * dt; 42 | break; 43 | case "left": 44 | this.pos.x -= this.moveSpeed * dt; 45 | break; 46 | case "right": 47 | this.pos.x += this.moveSpeed * dt; 48 | break; 49 | } 50 | }; 51 | 52 | this.setPosition = function(pos){ 53 | this.pos = pos; 54 | }; 55 | 56 | this.getPosition = function(){ 57 | return this.pos; 58 | }; 59 | 60 | this.setBornPos = function(pos){ 61 | this.bornPos = pos; 62 | }; 63 | 64 | this.setMoveDirection = function(moveDirect){ 65 | if (this.moveDirect == moveDirect){ 66 | return; 67 | } 68 | 69 | if (!TiledMap.moveJudge(this.pos, moveDirect)){ 70 | this.moveDirect = "stay"; 71 | console.log("此路不通!"); 72 | return; 73 | } 74 | 75 | this.moveDirect = moveDirect; 76 | 77 | Net.pushMsg("directionModify", { 78 | uid: this.uid, 79 | direction: moveDirect 80 | }) 81 | }; 82 | 83 | this.update = function(dt){ 84 | this.move(dt); 85 | }; 86 | 87 | }; 88 | 89 | 90 | module.exports = Player; -------------------------------------------------------------------------------- /assets/Script/MapController.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | 16 | tiledMap:{ 17 | default: null, 18 | type: cc.TiledMap 19 | }, 20 | 21 | bgLayer:{ 22 | default: null, 23 | type: cc.TiledLayer 24 | }, 25 | 26 | }, 27 | 28 | convertToTilePos: function(pos){ 29 | var posX,posY 30 | 31 | if(pos.x < 0){ 32 | posX = parseInt(pos.x / this.tileSize.width) - 1; 33 | }else{ 34 | posX = parseInt(pos.x / this.tileSize.width); 35 | } 36 | 37 | if(pos.y < 0){ 38 | posY = this.mapSize.height - (parseInt(pos.y/this.tileSize.height) - 1) - 1; 39 | }else{ 40 | posY = this.mapSize.height - parseInt(pos.y/this.tileSize.height) - 1; 41 | } 42 | 43 | return cc.v2(posX,posY); 44 | }, 45 | 46 | convertToLayerPos: function(pos){ 47 | var posX,posY 48 | 49 | posX = (pos.x + 0.5) * this.tileSize.width; 50 | posY = (this.mapSize.height - pos.y - 1 + 0.5)*this.tileSize.height; 51 | 52 | return cc.v2(posX,posY); 53 | }, 54 | 55 | // use this for initialization 56 | onLoad: function () { 57 | // this.mapSize = this.tiledMap.getMapSize(); 58 | // this.tileSize = this.tiledMap.getTileSize(); 59 | }, 60 | 61 | // called every frame, uncomment this function to activate update callback 62 | // update: function (dt) { 63 | 64 | // }, 65 | }); 66 | -------------------------------------------------------------------------------- /assets/prefab/water_up.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_up", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 40, 33 | "height": 40 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "4e948a39-2db2-4026-9b18-d887b232e6ea" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "2836fgi61hMPIf0/C6iVzLU", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_down.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_down", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 40, 33 | "height": 40 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "362315e2-5d33-45e9-8479-3e66460b24fc" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "164e0XZ4+NIR6flP1055k2W", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_left.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_left", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 40, 33 | "height": 40 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "13ec8243-3d67-4ef2-bccc-752770843c4e" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "4b6b45/x9JGTYNpHcYMIpNg", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_right.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_right", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 40, 33 | "height": 40 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "b4c7c5b7-be2b-4bd7-a180-af281bc8f19f" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "51d017qJpNFXIJQt1qpYvX+", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_center.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_center", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 41, 33 | "height": 39 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "af91d83a-6142-440c-9c82-fd825b9fa014" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "22c9bHJwbBPzqe7b7aCaTmB", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_up_far.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_up_far", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 40, 33 | "height": 38 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "78daa21c-de78-47e1-909e-acf2f5883d75" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "4569aEWCHpD/awq41xvKTOo", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_down_far.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_down_far", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 40, 33 | "height": 38 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "6df57b01-c690-4f7b-8f2f-85961bad0ea5" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "28179gj8K9CT5y0uKf84DDY", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_left_far.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_left_far", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 39, 33 | "height": 40 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "6b89e395-4a26-4f23-a5fa-62f7d9869aa3" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "c0cc83j0KlLC7YsMQ0c/WL6", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/water_right_far.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "water_right_far", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 39, 33 | "height": 40 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | } 57 | ], 58 | "_prefab": { 59 | "__id__": 3 60 | }, 61 | "groupIndex": 0 62 | }, 63 | { 64 | "__type__": "cc.Sprite", 65 | "_name": "", 66 | "_objFlags": 0, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "_spriteFrame": { 72 | "__uuid__": "d829be4d-13a1-4162-bea5-a6e29a560a0f" 73 | }, 74 | "_type": 0, 75 | "_sizeMode": 1, 76 | "_fillType": 0, 77 | "_fillCenter": { 78 | "__type__": "cc.Vec2", 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "_fillStart": 0, 83 | "_fillRange": 0, 84 | "_isTrimmedMode": true, 85 | "_srcBlendFactor": 770, 86 | "_dstBlendFactor": 771, 87 | "_atlas": null 88 | }, 89 | { 90 | "__type__": "cc.PrefabInfo", 91 | "root": { 92 | "__id__": 1 93 | }, 94 | "asset": { 95 | "__id__": 0 96 | }, 97 | "fileId": "81a17p6vDpLCYhD2L7sXcVr", 98 | "sync": false 99 | } 100 | ] -------------------------------------------------------------------------------- /assets/prefab/player.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "player", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 52.3, 33 | "height": 73.4 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 0.6666667, 39 | "_scaleY": 0.6666667, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 20, 43 | "y": 340 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | }, 57 | { 58 | "__id__": 3 59 | } 60 | ], 61 | "_prefab": { 62 | "__id__": 4 63 | }, 64 | "groupIndex": 0 65 | }, 66 | { 67 | "__type__": "cc.Sprite", 68 | "_name": "", 69 | "_objFlags": 0, 70 | "node": { 71 | "__id__": 1 72 | }, 73 | "_enabled": true, 74 | "_spriteFrame": { 75 | "__uuid__": "04b0dcdb-1a66-4629-9d08-318d96c95567" 76 | }, 77 | "_type": 0, 78 | "_sizeMode": 0, 79 | "_fillType": 0, 80 | "_fillCenter": { 81 | "__type__": "cc.Vec2", 82 | "x": 0, 83 | "y": 0 84 | }, 85 | "_fillStart": 0, 86 | "_fillRange": 0, 87 | "_isTrimmedMode": true, 88 | "_srcBlendFactor": 770, 89 | "_dstBlendFactor": 771, 90 | "_atlas": null 91 | }, 92 | { 93 | "__type__": "28c65ACuy1M66b9ykZCF/j1", 94 | "_name": "", 95 | "_objFlags": 0, 96 | "node": { 97 | "__id__": 1 98 | }, 99 | "_enabled": true, 100 | "bubblePrefab": { 101 | "__uuid__": "39e36736-5013-4742-b04f-2ed2ece52be7" 102 | }, 103 | "deadPic": { 104 | "__uuid__": "c2e8f2ba-1c04-4cab-ad43-afd900a98c3e" 105 | }, 106 | "norPic": { 107 | "__uuid__": "1a9739ee-f685-4219-a138-e34598b3c504" 108 | }, 109 | "moveSpeed": 100, 110 | "uid": 0, 111 | "teamId": 0 112 | }, 113 | { 114 | "__type__": "cc.PrefabInfo", 115 | "root": { 116 | "__id__": 1 117 | }, 118 | "asset": { 119 | "__uuid__": "74e37804-d41a-420f-a56c-7cf34e8d7392" 120 | }, 121 | "fileId": "73f32cN0NRKQon98Okf2HwU", 122 | "sync": false 123 | } 124 | ] -------------------------------------------------------------------------------- /server/Game.js: -------------------------------------------------------------------------------- 1 | var Game = {}; 2 | var Net = require("./Net"); 3 | var TiledMap = require("./TiledMap"); 4 | var Player = require("./Player"); 5 | //var Bubble = require("./Bubble"); 6 | 7 | var players = new Array(); 8 | //var bubbles = new Array(); 9 | var MAXMEMBER = 4; 10 | 11 | // 启动服务器 12 | Net.run(); 13 | 14 | // 监听玩家加入离开 15 | Net.addRequestHandler("player_join", function(uid){ 16 | if (players.length >= MAXMEMBER){ 17 | console.log("房间人数已满!"); 18 | Net.closeSocket(uid); 19 | return; 20 | } 21 | 22 | console.log("玩家"+uid+"加入了房间!"); 23 | Game.playerJoin(uid); 24 | }); 25 | Net.addRequestHandler("player_exit", function(uid){ 26 | console.log("玩家"+uid+"退出了房间!"); 27 | Game.playerExit(uid); 28 | }); 29 | 30 | 31 | 32 | // 监听玩家移动 33 | Net.addRequestHandler("move", function(uid, msg){ 34 | console.log("move: "+msg.direction); 35 | 36 | for (var i = 0; i < players.length; i ++){ 37 | var player = players[i]; 38 | if (uid == player.uid){ 39 | player.setMoveDirection(msg.direction); 40 | return; 41 | } 42 | } 43 | }); 44 | 45 | // 监听技能 46 | Net.addRequestHandler("skill", function(msg){ 47 | 48 | }); 49 | 50 | 51 | //调用主循环更新游戏 52 | var lastTime = Date.now(); 53 | setInterval(function(){ 54 | var curTime = Date.now(); 55 | Game.update((curTime - lastTime)/ 1000); 56 | lastTime = curTime; 57 | }, 1000/60); 58 | 59 | /*****************************************************************/ 60 | 61 | // 玩家加入处理 62 | Game.playerJoin = function(uid){ 63 | var player = new Player(uid); 64 | players.push(player); 65 | // 设置重生点 66 | var bornPos = TiledMap.createBornPos(uid); 67 | player.setBornPos(bornPos); 68 | player.born(); 69 | 70 | //广播 71 | Net.pushMsg("playerJoin",{ 72 | uid: uid, 73 | pos: player.getPosition(), 74 | moveDirect: "stay" 75 | }); 76 | 77 | //登录信息 78 | Net.pushMsg("userInfo",{ 79 | uid: uid 80 | }, uid); 81 | 82 | //游戏信息 83 | var playerInfos = new Array(); 84 | for (var i = 0; i < players.length; i ++){ 85 | playerInfos.push({ 86 | uid: players[i].uid, 87 | pos: players[i].pos, 88 | moveDirect: players[i].moveDirect 89 | }); 90 | } 91 | Net.pushMsg("roomInfo", { 92 | playerInfo: playerInfos 93 | }, uid); 94 | }; 95 | 96 | // 玩家退出处理 97 | Game.playerExit = function(uid){ 98 | for (var i = 0; i < players.length; i++){ 99 | var player = players[i]; 100 | if (player.uid == uid){ 101 | player.onExit(); 102 | TiledMap.removePlayer(uid); 103 | players.splice(i, 1); 104 | Net.pushMsg("playerExit",{ 105 | uid: uid 106 | }); 107 | return; 108 | } 109 | } 110 | console.log("退出时未找到相应player"); 111 | }; 112 | 113 | // 主计时器 114 | Game.update = function(dt){ 115 | //角色移动 116 | for (var i = 0; i < players.length; i++){ 117 | players[i].update(dt); 118 | } 119 | }; -------------------------------------------------------------------------------- /assets/Script/PlayerController.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | playerPrefab: { 16 | default: null, 17 | type: cc.Prefab 18 | } 19 | }, 20 | 21 | // use this for initialization 22 | onLoad: function () { 23 | this._players = new Array(); 24 | this.GConnectMgr = this.node.getComponent("RoomController").Main.getComponent("GConnectMgr"); 25 | this.tiledMap = this.node.getComponent("RoomController").Map; 26 | 27 | this.init(); 28 | }, 29 | 30 | init: function(){ 31 | var self = this; 32 | this.GConnectMgr.regPushEvent("playerJoin", function(pack){ 33 | //生成新角色 34 | self.createPlayer(pack.data); 35 | }); 36 | 37 | this.GConnectMgr.regPushEvent("playerExit", function(pack){ 38 | //清楚角色 39 | self.removePlayer(pack.data.uid); 40 | }); 41 | 42 | this.GConnectMgr.regPushEvent("directionModify", function(pack){ 43 | var uid = pack.data.uid; 44 | var direct = pack.data.direction; 45 | 46 | for (var i = 0; i < self._players.length; i++){ 47 | var player = self._players[i].getComponent("Player"); 48 | if (player.uid == uid){ 49 | player.setMoveDirect(direct); 50 | break; 51 | } 52 | } 53 | }); 54 | }, 55 | 56 | createPlayer: function(playerInfo){ 57 | var newPlayer = cc.instantiate(this.playerPrefab); 58 | var player_js = newPlayer.getComponent("Player"); 59 | player_js.init(playerInfo); 60 | this.tiledMap.node.addChild(newPlayer); 61 | 62 | this._players.push(newPlayer); 63 | }, 64 | 65 | removePlayer: function(uid){ 66 | for (var i = 0; i < this._players.length; i++){ 67 | var player = this._players[i].getComponent("Player"); 68 | if (player.uid == uid){ 69 | this._players[i].removeFromParent(); 70 | this._players.splice(i, 1); 71 | 72 | return; 73 | } 74 | } 75 | 76 | cc.log("移除角色失败 uid="+uid); 77 | }, 78 | 79 | setInfo: function(playerInfo){ 80 | for (var i = 0; i < playerInfo.length; i++){ 81 | var info = playerInfo[i]; 82 | 83 | // 对于不存在的角色创建 84 | var isExist = false; 85 | for (var j = 0; j < this._players.length; j++){ 86 | if (this._players[j].getComponent("Player").uid == info.uid){ 87 | isExist = true; 88 | break; 89 | } 90 | } 91 | if (isExist == false){ 92 | this.createPlayer(info); 93 | } 94 | } 95 | }, 96 | // called every frame, uncomment this function to activate update callback 97 | // update: function (dt) { 98 | 99 | // }, 100 | }); 101 | -------------------------------------------------------------------------------- /assets/prefab/bubble.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "bubble", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 36, 33 | "height": 36 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | }, 57 | { 58 | "__id__": 3 59 | } 60 | ], 61 | "_prefab": { 62 | "__id__": 4 63 | }, 64 | "groupIndex": 0 65 | }, 66 | { 67 | "__type__": "cc.Sprite", 68 | "_name": "", 69 | "_objFlags": 0, 70 | "node": { 71 | "__id__": 1 72 | }, 73 | "_enabled": true, 74 | "_spriteFrame": { 75 | "__uuid__": "e6958668-317f-4d60-9bc9-3a498e0cf236" 76 | }, 77 | "_type": 0, 78 | "_sizeMode": 1, 79 | "_fillType": 0, 80 | "_fillCenter": { 81 | "__type__": "cc.Vec2", 82 | "x": 0, 83 | "y": 0 84 | }, 85 | "_fillStart": 0, 86 | "_fillRange": 0, 87 | "_isTrimmedMode": true, 88 | "_srcBlendFactor": 770, 89 | "_dstBlendFactor": 771, 90 | "_atlas": null 91 | }, 92 | { 93 | "__type__": "029e74xrDRJc6n4VOaG2lHL", 94 | "_name": "", 95 | "_objFlags": 0, 96 | "node": { 97 | "__id__": 1 98 | }, 99 | "_enabled": true, 100 | "stayDuration": 2, 101 | "skillLenth": 2, 102 | "water_center_prefab": { 103 | "__uuid__": "35f4085b-7a49-4d2d-ab53-0651f38e2fcb" 104 | }, 105 | "water_left_f_prefab": { 106 | "__uuid__": "85ab9ff0-ed35-4158-b901-ee4bb11879ae" 107 | }, 108 | "water_left_prefab": { 109 | "__uuid__": "38fd1ef8-01d8-4fe2-8676-01321c28ebb1" 110 | }, 111 | "water_right_f_prefab": { 112 | "__uuid__": "e40f4d3b-ca52-4976-bae1-43836be61364" 113 | }, 114 | "water_right_prefab": { 115 | "__uuid__": "8d9e9492-abc1-49dd-9ee7-4c2dc72f969d" 116 | }, 117 | "water_up_f_prefab": { 118 | "__uuid__": "b5a46e85-5714-432d-9019-ace597725cfc" 119 | }, 120 | "water_up_prefab": { 121 | "__uuid__": "6bb68914-006b-464b-b800-e99576d7e4e6" 122 | }, 123 | "water_down_f_prefab": { 124 | "__uuid__": "634a7b0c-4e46-4318-9fd3-f4287d9002c0" 125 | }, 126 | "water_down_prefab": { 127 | "__uuid__": "a2879d92-1b64-44db-8958-30e165fb5291" 128 | } 129 | }, 130 | { 131 | "__type__": "cc.PrefabInfo", 132 | "root": { 133 | "__id__": 1 134 | }, 135 | "asset": { 136 | "__uuid__": "39e36736-5013-4742-b04f-2ed2ece52be7" 137 | }, 138 | "fileId": "66b2aWTb45KAZDNDy++OZHr", 139 | "sync": false 140 | } 141 | ] -------------------------------------------------------------------------------- /assets/Script/Player.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | bubblePrefab: { 16 | default: null, 17 | type: cc.Prefab 18 | }, 19 | 20 | deadPic:{ 21 | default: "", 22 | url: cc.Texture2D 23 | }, 24 | norPic:{ 25 | default: "", 26 | url: cc.Texture2D 27 | }, 28 | 29 | //移动速度 30 | moveSpeed: 100, 31 | //id 32 | uid: 0, 33 | //队伍id 34 | teamId: 0, 35 | }, 36 | 37 | init: function(initData){ 38 | this.uid = initData.uid; 39 | this.node.setPosition(initData.pos); 40 | this.moveDirect = initData.moveDirect; 41 | }, 42 | 43 | movePlayer: function(dt){ 44 | if(this.moveDirect == "stay"){ 45 | return; 46 | } 47 | 48 | switch(this.moveDirect){ 49 | case "up": 50 | this.node.y += this.moveSpeed * dt; 51 | break; 52 | case "down": 53 | this.node.y -= this.moveSpeed * dt; 54 | break; 55 | case "left": 56 | this.node.x -= this.moveSpeed * dt; 57 | break; 58 | case "right": 59 | this.node.x += this.moveSpeed * dt; 60 | break; 61 | } 62 | }, 63 | 64 | bubble: function(){ 65 | var tileMap = this.node.parent.getComponent(cc.TiledMap); 66 | var mapSize = tileMap.getMapSize(); 67 | var tileSize = tileMap.getTileSize(); 68 | var bgLayer = this.node.parent.getChildByName("bg_layer").getComponent(cc.TiledLayer); 69 | 70 | var newBubble = cc.instantiate(this.bubblePrefab); 71 | var pos = cc.v2(parseInt(this.node.x / tileSize.width) , mapSize.height - parseInt(this.node.y / tileSize.height) - 1); 72 | var tile = bgLayer.getTileAt(pos); 73 | tileMap.node.addChild(newBubble); 74 | newBubble.setPosition(tile.getPositionX() + tileSize.width/2, tile.getPositionY() + tileSize.height/2); 75 | }, 76 | 77 | killed:function(){ 78 | var self = this; 79 | self.state = "killed"; 80 | self.moveDirect = "stay"; 81 | self.node.getComponent(cc.Sprite).spriteFrame.setTexture(self.deadPic); 82 | setTimeout(function() { 83 | self.state = "normal"; 84 | self.node.getComponent(cc.Sprite).spriteFrame.setTexture(self.norPic); 85 | self.node.setPosition(20, 340); 86 | }, 3000); 87 | }, 88 | 89 | setMoveDirect: function(moveDirect){ 90 | cc.log("movedirect modify: "+moveDirect); 91 | this.moveDirect = moveDirect; 92 | }, 93 | 94 | // use this for initialization 95 | onLoad: function () { 96 | this.moveDirect = "stay"; 97 | this.state = "normal"; 98 | }, 99 | 100 | // called every frame, uncomment this function to activate update callback 101 | update: function (dt) { 102 | this.movePlayer(dt); 103 | }, 104 | }); 105 | -------------------------------------------------------------------------------- /assets/Script/RoomController.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | Main:{ 6 | default:null, 7 | type:cc.Node 8 | }, 9 | Map:{ 10 | default: null, 11 | type:cc.TiledMap 12 | }, 13 | 14 | btn_up:{ 15 | default:null, 16 | type:cc.Button 17 | }, 18 | btn_down:{ 19 | default:null, 20 | type:cc.Button 21 | }, 22 | btn_left:{ 23 | default:null, 24 | type:cc.Button 25 | }, 26 | btn_right:{ 27 | default:null, 28 | type:cc.Button 29 | }, 30 | btn_skill:{ 31 | default:null, 32 | type:cc.Button 33 | } 34 | }, 35 | 36 | // use this for initialization 37 | onLoad: function () { 38 | this.GConnectMgr = this.Main.getComponent("GConnectMgr"); 39 | this.PlayerController = this.getComponent("PlayerController"); 40 | 41 | this.roomInfo = null; 42 | this.init(); 43 | }, 44 | 45 | init: function(){ 46 | var self = this; 47 | 48 | //房间信息 49 | self.GConnectMgr.regPushEvent("roomInfo", function(pack){ 50 | self.roomInfo = pack.data; 51 | 52 | //玩家信息 53 | self.PlayerController.setInfo(self.roomInfo.playerInfo); 54 | }); 55 | 56 | // up 57 | this.btn_up.node.on("touchstart", function(){ 58 | self.GConnectMgr.send(function(pack){}, "move", {direction: "up"}); 59 | }); 60 | this.btn_up.node.on("touchend", function(){ 61 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 62 | }); 63 | this.btn_up.node.on("touchcancel", function(){ 64 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 65 | }); 66 | //down 67 | this.btn_down.node.on("touchstart", function(){ 68 | self.GConnectMgr.send(function(pack){}, "move", {direction: "down"}); 69 | }); 70 | this.btn_down.node.on("touchend", function(){ 71 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 72 | }); 73 | this.btn_down.node.on("touchcancel", function(){ 74 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 75 | }); 76 | //left 77 | this.btn_left.node.on("touchstart", function(){ 78 | self.GConnectMgr.send(function(pack){}, "move", {direction: "left"}); 79 | }); 80 | this.btn_left.node.on("touchend", function(){ 81 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 82 | }); 83 | this.btn_left.node.on("touchcancel", function(){ 84 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 85 | }); 86 | //right 87 | this.btn_right.node.on("touchstart", function(){ 88 | self.GConnectMgr.send(function(pack){}, "move", {direction: "right"}); 89 | }); 90 | this.btn_right.node.on("touchend", function(){ 91 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 92 | }); 93 | this.btn_right.node.on("touchcancel", function(){ 94 | self.GConnectMgr.send(function(pack){}, "move", {direction: "stay"}); 95 | }); 96 | //skill 97 | this.btn_skill.node.on("touchstart", function(){ 98 | //player.bubble(); 99 | }); 100 | } 101 | // called every frame 102 | // update: function (dt) { 103 | 104 | // }, 105 | }); 106 | -------------------------------------------------------------------------------- /server/TiledMap.js: -------------------------------------------------------------------------------- 1 | var TiledMap = { 2 | weight: 16, 3 | height: 9, 4 | tileWeight: 40, 5 | tileHeight: 40, 6 | playerBornPos: [{x: 20, y: 340, playerId: 0}, {x: 20, y: 20, playerId: 0}, 7 | {x: 620, y: 20, playerId: 0}, {x: 620, y: 340, playerId: 0}], 8 | tiles: [[0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0], 9 | [0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0], 10 | [0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0], 11 | [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 12 | [1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1], 13 | [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 14 | [0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0], 15 | [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 16 | [0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0]] 17 | }; 18 | 19 | TiledMap.convertToTilePos = function(pos){ 20 | var posX,posY; 21 | 22 | if(pos.x < 0){ 23 | posX = parseInt(pos.x / this.tileWeight) - 1; 24 | }else{ 25 | posX = parseInt(pos.x / this.tileWeight); 26 | } 27 | 28 | if(pos.y < 0){ 29 | posY = parseInt(pos.y/this.tileHeight) - 1; 30 | }else{ 31 | posY = parseInt(pos.y/this.tileHeight); 32 | } 33 | 34 | return {x: posX, y: posY}; 35 | }; 36 | 37 | TiledMap.convertToLayerPos = function(pos){ 38 | var posX,posY; 39 | 40 | posX = (pos.x + 0.5) * this.tileSize.width; 41 | posY = (pos.y + 0.5) * this.tileSize.height; 42 | 43 | return {x: posX, y: posY}; 44 | }; 45 | 46 | TiledMap.getTile = function(tilePos){ 47 | return this.tiles[this.height - 1 - tilePos.y][tilePos.x] 48 | }; 49 | 50 | 51 | // 初始化player重生位置 52 | TiledMap.createBornPos = function(playerId){ 53 | for (var i = 0; i < this.playerBornPos.length; i ++){ 54 | var pos = this.playerBornPos[i]; 55 | if (pos.playerId == 0){ 56 | pos.playerId = playerId; 57 | return {x: pos.x, y: pos.y}; 58 | } 59 | } 60 | 61 | console.log("位置异常,未找到合适重生点!"); 62 | }; 63 | 64 | //解除player相关占用 65 | TiledMap.removePlayer = function(playerId){ 66 | for (var i = 0; i < this.playerBornPos.length; i ++){ 67 | var pos = this.playerBornPos[i]; 68 | if (pos.playerId == playerId){ 69 | pos.playerId = 0; 70 | return; 71 | } 72 | } 73 | 74 | console.log("解除重生点占用异常,未找到相应重生点!"); 75 | }; 76 | 77 | //判断是否可以移动 78 | TiledMap.moveJudge = function(pos, moveDirect){ 79 | switch(moveDirect){ 80 | case "up": 81 | var nextPoint = this.convertToTilePos({x: pos.x, y: pos.y + this.tileHeight / 2 + 1}); 82 | // 边界判断 83 | if (nextPoint.y >= this.height){ 84 | return false; 85 | } 86 | // 板块判断 87 | var moveable = this.getTile(nextPoint); 88 | if(moveable == 1){ 89 | return false; 90 | } 91 | 92 | break; 93 | case "down": 94 | var nextPoint = this.convertToTilePos({x: pos.x, y: pos.y - this.tileHeight / 2 - 1}); 95 | // 边界判断 96 | if (nextPoint.y < 0){ 97 | return false; 98 | } 99 | // 板块判断 100 | var moveable = this.getTile(nextPoint); 101 | if(moveable == 1){ 102 | return false; 103 | } 104 | 105 | break; 106 | case "left": 107 | var nextPoint = this.convertToTilePos({x: pos.x - this.tileWeight / 2 - 1, y: pos.y}); 108 | // 边界判断 109 | if (nextPoint.x < 0){ 110 | return false; 111 | } 112 | // 板块判断 113 | var moveable = this.getTile(nextPoint); 114 | if(moveable == 1){ 115 | return false; 116 | } 117 | 118 | break; 119 | case "right": 120 | var nextPoint = this.convertToTilePos({x: pos.x + this.tileWeight / 2 + 1, y: pos.y}); 121 | // 边界判断 122 | if (nextPoint.x >= this.weight){ 123 | return false; 124 | } 125 | // 板块判断 126 | var moveable = this.getTile(nextPoint); 127 | if(moveable == 1){ 128 | return false; 129 | } 130 | 131 | break; 132 | } 133 | 134 | 135 | return true; 136 | }; 137 | 138 | module.exports = TiledMap; -------------------------------------------------------------------------------- /server/Net.js: -------------------------------------------------------------------------------- 1 | var WebSocketServer = require('ws').Server; 2 | var netTool = {}; 3 | netTool._handlers = new Array(); 4 | netTool._sockets = new Array(); 5 | netTool._curUid = 1; 6 | 7 | netTool.run = function(){ 8 | var self = this; 9 | var wss = new WebSocketServer({host:"127.0.0.1",port:8808}); 10 | console.log('websocket-server running...'); 11 | 12 | wss.on('connection',function(socket){ 13 | // 新客户端的连接 14 | socket._uid = self._curUid; 15 | self._curUid ++; 16 | self._sockets.push(socket); 17 | console.log('new connection founded successfully, id: '+ socket._uid); 18 | // 角色创建 19 | self._handlerRequest(socket._uid, "player_join"); 20 | 21 | // 消息接收处理 22 | socket.on('message',function(data){ 23 | console.log("[recv<--]:" + data); 24 | data = JSON.parse(data); 25 | data.uid = socket._uid; // 为每个消息加入客户端标识 26 | self._receive(data); 27 | }); 28 | 29 | //退出处理 30 | socket.on("close", function(){ 31 | console.log("连接断开, uid: " + socket._uid); 32 | self.closeSocket(socket._uid); 33 | // 角色注销 34 | self._handlerRequest(socket._uid, "player_exit"); 35 | }); 36 | 37 | socket.on("error", function(data){ 38 | console.log("socket error: " + data); 39 | }); 40 | }); 41 | }; 42 | 43 | // 注册消息处理方法 44 | netTool.addRequestHandler = function(action, onRequest){ 45 | var handler = { 46 | action: action, 47 | onRequest: onRequest, 48 | }; 49 | this._handlers.push(handler); 50 | }; 51 | 52 | // 关闭指定用户连接 53 | netTool.closeSocket = function(uid){ 54 | for (var i = 0; i < this._sockets.length; i ++){ 55 | if (uid == this._sockets[i]._uid){ 56 | this._sockets[i].close(); 57 | console.log("befor len="+this._sockets.length); 58 | this._sockets.splice(i, 1); 59 | console.log("after len="+this._sockets.length); 60 | return; 61 | } 62 | } 63 | 64 | console.log("找不到要关闭的socket!"); 65 | }; 66 | 67 | // 向[指定]客户端发送消息 68 | netTool.pushMsg = function(action, data, uid){ 69 | var pack = this._createPack(); 70 | pack.action = action; 71 | pack.msg.state = 2; 72 | pack.msg.data = data; 73 | pack = JSON.stringify(pack); 74 | 75 | for (var i = 0; i < this._sockets.length; i ++){ 76 | if (uid && uid == this._sockets[i]._uid){ 77 | this._sockets[i].send(pack); 78 | break; 79 | }else{ 80 | this._sockets[i].send(pack); 81 | } 82 | } 83 | 84 | if (uid){ 85 | console.log("[push-->uid: " + uid + "]: "+ pack); 86 | }else{ 87 | console.log("[push-->ALL]: "+ pack); 88 | } 89 | }; 90 | 91 | // 回应客户端消息 92 | netTool._response = function(requestId, msg, uid){ 93 | var pack = this._createPack(); 94 | pack.requestId = requestId; 95 | pack.msg = msg; 96 | pack = JSON.stringify(pack); 97 | 98 | for (var i = 0; i < this._sockets.length; i ++){ 99 | if (uid && uid == this._sockets[i]._uid){ 100 | this._sockets[i].send(pack); 101 | return; 102 | } 103 | } 104 | 105 | console.log("[send-->uid: " + uid + "]: "+ pack); 106 | }; 107 | 108 | // 从客户端接收消息 109 | netTool._receive = function(pack){ 110 | var requestId = pack.requestId; 111 | var action = pack.action; 112 | var recvMsg = pack.msg; 113 | var uid = pack.uid; 114 | 115 | var sendMsg = this._handlerRequest(uid, action, recvMsg); 116 | 117 | if (sendMsg){ 118 | this._response(requestId, sendMsg, uid); 119 | } 120 | }; 121 | 122 | // 构造发送数据包 123 | netTool._createPack = function(){ 124 | return { 125 | requestId : 0, 126 | action : "", 127 | msg : this._createMsg(), 128 | }; 129 | }; 130 | 131 | // 构造发送数据 132 | netTool._createMsg = function(){ 133 | return { 134 | state: 1, 135 | data: {}, 136 | }; 137 | }; 138 | 139 | // 处理消息 140 | netTool._handlerRequest = function(uid, action, msg){ 141 | for (i = 0; i < this._handlers.length; i++){ 142 | var handler = this._handlers[i]; 143 | if (handler.action == action){ 144 | var msg = handler.onRequest(uid, msg); 145 | return msg; 146 | } 147 | } 148 | 149 | var msg = this._createMsg(); 150 | msg.state = 0; 151 | msg.msg = "没有相应action!"; 152 | return msg; 153 | }; 154 | 155 | module.exports = netTool; 156 | -------------------------------------------------------------------------------- /assets/Script/GConnectMgr.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | }, 16 | 17 | // use this for initialization 18 | onLoad: function () { 19 | this.ADDRESS = "ws://localhost:8808";//"127.0.0.1:8808"; 20 | this.MINID = 1; 21 | this.MAXID = 1000; 22 | this._ws = null; 23 | this._currentReqId = this.MINID; 24 | this._handlers = new Array(); 25 | this._pushHandlers = new Array(); 26 | 27 | this.init(); 28 | }, 29 | 30 | init: function(){ 31 | cc.log("网络模块初始化!"); 32 | this.open(); 33 | 34 | var self = this; 35 | this._ws.onmessage = function (event) { 36 | var pack = JSON.parse(event.data); 37 | cc.log("[recv<--]: " + event.data); 38 | self.receive(pack); 39 | }; 40 | }, 41 | 42 | open: function(){ 43 | if (this._ws){ 44 | this.destroy(); 45 | } 46 | 47 | this._ws = new WebSocket(this.ADDRESS); 48 | }, 49 | 50 | destroyNet: function(){ 51 | if (this._ws){ 52 | this._ws.close(); 53 | this._ws = null; 54 | } 55 | }, 56 | 57 | send: function(onResponse, action, param){ 58 | if (this._ws == null){ 59 | cc.log("websocket == null"); 60 | return; 61 | } 62 | if (this._ws.readyState != 1){ 63 | cc.log("网络暂时无法通信!") 64 | return; 65 | } 66 | if (param == null){ 67 | param = ""; 68 | } 69 | 70 | var requestId = this._currentReqId; 71 | this.pushRequest(requestId, onResponse); 72 | this._currentReqId ++; 73 | if (this._currentReqId > this.MAXID){ 74 | this._currentReqId = this.MINID; 75 | } 76 | 77 | var pack = this.createPack(); 78 | pack.requestId = requestId; 79 | pack.action = action; 80 | pack.msg = param; 81 | 82 | this._ws.send(JSON.stringify(pack)); 83 | cc.log("[send-->]: " + JSON.stringify(pack)); 84 | }, 85 | 86 | receive: function(pack){ 87 | var requestId = pack.requestId; 88 | var action = pack.action; 89 | var msg = pack.msg; 90 | var state = msg.state; 91 | 92 | if (state == 0){ 93 | cc.log("[request error]: "+msg.msg); 94 | this.removeHandler(requestId); 95 | }else if(state == 1){ 96 | this.handleResponse(requestId, msg); 97 | }else if(state == 2){ 98 | this.handlePush(action, msg) 99 | } 100 | }, 101 | 102 | createPack: function(){ 103 | return { 104 | requestId : 0, 105 | action : "", 106 | msg : {}, 107 | }; 108 | }, 109 | 110 | createHandler: function(requestId, onResponse){ 111 | return { 112 | requestId: requestId, 113 | onResponse: onResponse, 114 | time: 0, 115 | }; 116 | }, 117 | 118 | createPushHandles: function(action, onPush){ 119 | var handlers = new Array(); 120 | handlers.push(onPush); 121 | return { 122 | action: action, 123 | handlers: handlers 124 | }; 125 | }, 126 | 127 | pushRequest: function(requestId, onResponse){ 128 | var handler = this.createHandler(requestId, onResponse); 129 | this._handlers.push(handler); 130 | }, 131 | 132 | handleResponse: function(requestId, msg){ 133 | for (i = 0; i < this._handlers.length; i++){ 134 | var handler = this._handlers[i]; 135 | if (handler.requestId == requestId){ 136 | handler.onResponse(msg); 137 | this._handlers.splice(i, 1); 138 | return; 139 | } 140 | } 141 | cc.log("数据包对应handler丢失!"); 142 | }, 143 | 144 | // 收到服务器推送消息,向各个事件监听器发送事件 145 | handlePush: function(action, msg){ 146 | for (var i = 0; i < this._pushHandlers.length; i++){ 147 | var actionHandlers = this._pushHandlers[i]; 148 | if (actionHandlers.action == action){ 149 | for (var j = 0; j < actionHandlers.handlers.length; j ++){ 150 | if (actionHandlers.handlers[j]){ 151 | actionHandlers.handlers[j](msg); 152 | } 153 | } 154 | return; 155 | } 156 | } 157 | cc.log("push数据包对应handler丢失!"); 158 | }, 159 | 160 | removeHandler: function(requestId){ 161 | for (i = 0; i < this._handlers.length; i++){ 162 | var handler = this._handlers[i]; 163 | if (handler.requestId == requestId){ 164 | this._handlers.splice(i, 1); 165 | return; 166 | } 167 | } 168 | }, 169 | 170 | // 注册推送事件监听器 171 | regPushEvent: function(action, handler){ 172 | // 已经存在此action对应的handler列表,直接加入 173 | for (var i = 0; i < this._pushHandlers.length; i++){ 174 | if (this._pushHandlers[i].action == action){ 175 | this._pushHandlers[i].handlers.push(handler); 176 | return; 177 | } 178 | } 179 | // 之前没有则创建 180 | this._pushHandlers.push(this.createPushHandles(action, handler)); 181 | }, 182 | // called every frame, uncomment this function to activate update callback 183 | // update: function (dt) { 184 | 185 | // }, 186 | }); 187 | -------------------------------------------------------------------------------- /assets/Script/Bubble.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | stayDuration: 2, 16 | skillLenth: 2, 17 | 18 | water_center_prefab:{ 19 | default: null, 20 | type: cc.Prefab 21 | }, 22 | water_left_f_prefab: { 23 | default: null, 24 | type: cc.Prefab 25 | }, 26 | water_left_prefab: { 27 | default: null, 28 | type: cc.Prefab 29 | }, 30 | water_right_f_prefab: { 31 | default: null, 32 | type: cc.Prefab 33 | }, 34 | water_right_prefab: { 35 | default: null, 36 | type: cc.Prefab 37 | }, 38 | water_up_f_prefab: { 39 | default: null, 40 | type: cc.Prefab 41 | }, 42 | water_up_prefab: { 43 | default: null, 44 | type: cc.Prefab 45 | }, 46 | water_down_f_prefab: { 47 | default: null, 48 | type: cc.Prefab 49 | }, 50 | water_down_prefab: { 51 | default: null, 52 | type: cc.Prefab 53 | }, 54 | }, 55 | 56 | staySkill: function(){ 57 | this.state = 0; 58 | this.stayTime = 0; 59 | }, 60 | 61 | boomSkill: function(){ 62 | this.judgeEffectArea(); 63 | this.drawEffectArea(); 64 | this.createEffect(); 65 | 66 | this.node.destroy(); 67 | }, 68 | 69 | judgeEffectArea: function(){ 70 | var bgLayer = this.map.bgLayer; 71 | var tiledMap = this.map.tiledMap; 72 | this.centerPos = this.map.convertToTilePos(this.node.getPosition()); 73 | var centerPos = this.centerPos; 74 | 75 | // up 76 | this.skillArea_up = 0; 77 | while(true){ 78 | if(this.skillArea_up + 1 > this.skillLenth){ 79 | break; 80 | } 81 | 82 | var scanTilePos = cc.v2(centerPos.x, centerPos.y - this.skillArea_up - 1); 83 | if(scanTilePos.y < 0){ 84 | break; 85 | } 86 | var GID = bgLayer.getTileGIDAt(scanTilePos); 87 | var property = tiledMap.getPropertiesForGID(GID); 88 | if(property.moveable == "false"){ 89 | break; 90 | } 91 | 92 | this.skillArea_up++; 93 | } 94 | 95 | // down 96 | this.skillArea_down = 0; 97 | while(true){ 98 | if(this.skillArea_down + 1 > this.skillLenth){ 99 | break; 100 | } 101 | 102 | var scanTilePos = cc.v2(centerPos.x, centerPos.y + this.skillArea_down + 1); 103 | if(scanTilePos.y > this.map.mapSize.height - 1){ 104 | break; 105 | } 106 | var GID = bgLayer.getTileGIDAt(scanTilePos); 107 | var property = tiledMap.getPropertiesForGID(GID); 108 | if(property.moveable == "false"){ 109 | break; 110 | } 111 | 112 | this.skillArea_down++; 113 | } 114 | 115 | // left 116 | this.skillArea_left = 0; 117 | while(true){ 118 | if(this.skillArea_left + 1 > this.skillLenth){ 119 | break; 120 | } 121 | 122 | var scanTilePos = cc.v2(centerPos.x - this.skillArea_left - 1, centerPos.y); 123 | if(scanTilePos.x < 0){ 124 | break; 125 | } 126 | var GID = bgLayer.getTileGIDAt(scanTilePos); 127 | var property = tiledMap.getPropertiesForGID(GID); 128 | if(property.moveable == "false"){ 129 | break; 130 | } 131 | 132 | this.skillArea_left++; 133 | } 134 | 135 | // right 136 | this.skillArea_right = 0; 137 | while(true){ 138 | if(this.skillArea_right + 1 > this.skillLenth){ 139 | break; 140 | } 141 | 142 | var scanTilePos = cc.v2(centerPos.x + this.skillArea_right + 1, centerPos.y); 143 | if(scanTilePos.x > this.map.mapSize.width - 1){ 144 | break; 145 | } 146 | var GID = bgLayer.getTileGIDAt(scanTilePos); 147 | var property = tiledMap.getPropertiesForGID(GID); 148 | if(property.moveable == "false"){ 149 | break; 150 | } 151 | 152 | this.skillArea_right++; 153 | } 154 | 155 | }, 156 | 157 | drawEffectArea: function(){ 158 | var c_water = cc.instantiate(this.water_center_prefab); 159 | var lf_water = cc.instantiate(this.water_left_f_prefab); 160 | var rf_water = cc.instantiate(this.water_right_f_prefab); 161 | var uf_water = cc.instantiate(this.water_up_f_prefab); 162 | var df_water = cc.instantiate(this.water_down_f_prefab); 163 | 164 | this.map.node.addChild(c_water); 165 | c_water.setPosition(this.node.getPosition()) 166 | 167 | for(var i = 1; i <= this.skillArea_left; i++){ 168 | if(i == this.skillArea_left){ 169 | c_water.addChild(lf_water); 170 | lf_water.setPosition(-i * this.map.tiledMap.getTileSize().width, 0); 171 | }else{ 172 | var l_water = cc.instantiate(this.water_left_prefab); 173 | c_water.addChild(l_water); 174 | l_water.setPosition(-i * this.map.tiledMap.getTileSize().width, 0); 175 | } 176 | } 177 | for(var i = 1; i <= this.skillArea_right; i++){ 178 | if(i == this.skillArea_right){ 179 | c_water.addChild(rf_water); 180 | rf_water.setPosition(i * this.map.tiledMap.getTileSize().width, 0); 181 | }else{ 182 | var r_water = cc.instantiate(this.water_right_prefab); 183 | c_water.addChild(r_water); 184 | r_water.setPosition(i * this.map.tiledMap.getTileSize().width, 0); 185 | } 186 | } 187 | for(var i = 1; i <= this.skillArea_up; i++){ 188 | if(i == this.skillArea_up){ 189 | c_water.addChild(uf_water); 190 | uf_water.setPosition(0, i * this.map.tiledMap.getTileSize().height); 191 | }else{ 192 | var u_water = cc.instantiate(this.water_up_prefab); 193 | c_water.addChild(u_water); 194 | u_water.setPosition(0, i * this.map.tiledMap.getTileSize().height); 195 | } 196 | } 197 | for(var i = 1; i <= this.skillArea_down; i++){ 198 | if(i == this.skillArea_down){ 199 | c_water.addChild(df_water); 200 | df_water.setPosition(0, -i * this.map.tiledMap.getTileSize().height); 201 | }else{ 202 | var d_water = cc.instantiate(this.water_down_prefab); 203 | c_water.addChild(d_water); 204 | d_water.setPosition(0, -i * this.map.tiledMap.getTileSize().height); 205 | } 206 | } 207 | 208 | c_water.runAction(cc.sequence(cc.fadeOut(0.5),cc.callFunc(function(){ 209 | c_water.destroy(); 210 | }))); 211 | }, 212 | 213 | createEffect: function(){ 214 | var player = this.map.player; 215 | var pos = this.map.convertToTilePos(player.getPosition()); 216 | 217 | var kill = false; 218 | if(pos.x == this.centerPos.x){ 219 | if(pos.y - this.centerPos.y >= -this.skillArea_up && pos.y - this.centerPos.y <= this.skillArea_down){ 220 | kill = true; 221 | } 222 | } 223 | else if(pos.y == this.centerPos.y){ 224 | if(pos.x - this.centerPos.x >= -this.skillArea_left && pos.x - this.centerPos.x <= this.skillArea_right){ 225 | kill = true; 226 | } 227 | } 228 | 229 | if(kill == true){ 230 | player.getComponent("Player").killed(); 231 | } 232 | }, 233 | 234 | // use this for initialization 235 | onLoad: function () { 236 | this.staySkill(); 237 | this.map = this.node.parent.getComponent("Map"); 238 | }, 239 | 240 | // called every frame, uncomment this function to activate update callback 241 | update: function (dt) { 242 | if(this.state == 0){ 243 | if(this.stayTime >= this.stayDuration){ 244 | this.boomSkill(); 245 | }else{ 246 | this.stayTime += dt; 247 | } 248 | } 249 | }, 250 | }); 251 | -------------------------------------------------------------------------------- /assets/Scene/helloworld.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_opacity": 255, 15 | "_color": { 16 | "__type__": "cc.Color", 17 | "r": 255, 18 | "g": 255, 19 | "b": 255, 20 | "a": 255 21 | }, 22 | "_cascadeOpacityEnabled": true, 23 | "_parent": null, 24 | "_anchorPoint": { 25 | "__type__": "cc.Vec2", 26 | "x": 0, 27 | "y": 0 28 | }, 29 | "_contentSize": { 30 | "__type__": "cc.Size", 31 | "width": 0, 32 | "height": 0 33 | }, 34 | "_children": [ 35 | { 36 | "__id__": 2 37 | } 38 | ], 39 | "_localZOrder": 0, 40 | "_globalZOrder": 0, 41 | "_tag": -1, 42 | "_opacityModifyRGB": false, 43 | "_id": "2d2f792f-a40c-49bb-a189-ed176a246e49", 44 | "autoReleaseAssets": false 45 | }, 46 | { 47 | "__type__": "cc.Node", 48 | "_name": "Canvas", 49 | "_objFlags": 0, 50 | "_opacity": 255, 51 | "_color": { 52 | "__type__": "cc.Color", 53 | "r": 252, 54 | "g": 252, 55 | "b": 252, 56 | "a": 255 57 | }, 58 | "_cascadeOpacityEnabled": true, 59 | "_parent": { 60 | "__id__": 1 61 | }, 62 | "_anchorPoint": { 63 | "__type__": "cc.Vec2", 64 | "x": 0.5, 65 | "y": 0.5 66 | }, 67 | "_contentSize": { 68 | "__type__": "cc.Size", 69 | "width": 1136, 70 | "height": 640 71 | }, 72 | "_children": [ 73 | { 74 | "__id__": 3 75 | }, 76 | { 77 | "__id__": 6 78 | } 79 | ], 80 | "_rotationX": 0, 81 | "_rotationY": 0, 82 | "_scaleX": 1, 83 | "_scaleY": 1, 84 | "_position": { 85 | "__type__": "cc.Vec2", 86 | "x": 568, 87 | "y": 320 88 | }, 89 | "_skewX": 0, 90 | "_skewY": 0, 91 | "_localZOrder": 0, 92 | "_globalZOrder": 0, 93 | "_tag": -1, 94 | "_opacityModifyRGB": false, 95 | "_id": "a286bbGknJLZpRpxROV6M94", 96 | "_active": true, 97 | "_components": [ 98 | { 99 | "__id__": 45 100 | } 101 | ], 102 | "_prefab": null, 103 | "groupIndex": 0 104 | }, 105 | { 106 | "__type__": "cc.Node", 107 | "_name": "Main", 108 | "_objFlags": 0, 109 | "_opacity": 255, 110 | "_color": { 111 | "__type__": "cc.Color", 112 | "r": 255, 113 | "g": 255, 114 | "b": 255, 115 | "a": 255 116 | }, 117 | "_cascadeOpacityEnabled": true, 118 | "_parent": { 119 | "__id__": 2 120 | }, 121 | "_anchorPoint": { 122 | "__type__": "cc.Vec2", 123 | "x": 0.5, 124 | "y": 0.5 125 | }, 126 | "_contentSize": { 127 | "__type__": "cc.Size", 128 | "width": 0, 129 | "height": 0 130 | }, 131 | "_children": [], 132 | "_rotationX": 0, 133 | "_rotationY": 0, 134 | "_scaleX": 1, 135 | "_scaleY": 1, 136 | "_position": { 137 | "__type__": "cc.Vec2", 138 | "x": 0, 139 | "y": 0 140 | }, 141 | "_skewX": 0, 142 | "_skewY": 0, 143 | "_localZOrder": 0, 144 | "_globalZOrder": 0, 145 | "_tag": -1, 146 | "_opacityModifyRGB": false, 147 | "_id": "0f6e829RWlIS4H85RnNi48+", 148 | "_active": true, 149 | "_components": [ 150 | { 151 | "__id__": 4 152 | }, 153 | { 154 | "__id__": 5 155 | } 156 | ], 157 | "_prefab": null, 158 | "groupIndex": 0 159 | }, 160 | { 161 | "__type__": "8c6d61ZTzhCdqeAtu6XIe3G", 162 | "_name": "", 163 | "_objFlags": 0, 164 | "node": { 165 | "__id__": 3 166 | }, 167 | "_enabled": true 168 | }, 169 | { 170 | "__type__": "994323Oo2FKnoIC55fuerS0", 171 | "_name": "", 172 | "_objFlags": 0, 173 | "node": { 174 | "__id__": 3 175 | }, 176 | "_enabled": true 177 | }, 178 | { 179 | "__type__": "cc.Node", 180 | "_name": "Room", 181 | "_objFlags": 0, 182 | "_opacity": 255, 183 | "_color": { 184 | "__type__": "cc.Color", 185 | "r": 255, 186 | "g": 255, 187 | "b": 255, 188 | "a": 255 189 | }, 190 | "_cascadeOpacityEnabled": true, 191 | "_parent": { 192 | "__id__": 2 193 | }, 194 | "_anchorPoint": { 195 | "__type__": "cc.Vec2", 196 | "x": 0.5, 197 | "y": 0.5 198 | }, 199 | "_contentSize": { 200 | "__type__": "cc.Size", 201 | "width": 0, 202 | "height": 0 203 | }, 204 | "_children": [ 205 | { 206 | "__id__": 7 207 | }, 208 | { 209 | "__id__": 10 210 | }, 211 | { 212 | "__id__": 12 213 | }, 214 | { 215 | "__id__": 17 216 | }, 217 | { 218 | "__id__": 22 219 | }, 220 | { 221 | "__id__": 27 222 | }, 223 | { 224 | "__id__": 32 225 | }, 226 | { 227 | "__id__": 37 228 | } 229 | ], 230 | "_rotationX": 0, 231 | "_rotationY": 0, 232 | "_scaleX": 1, 233 | "_scaleY": 1, 234 | "_position": { 235 | "__type__": "cc.Vec2", 236 | "x": 0, 237 | "y": 0 238 | }, 239 | "_skewX": 0, 240 | "_skewY": 0, 241 | "_localZOrder": 0, 242 | "_globalZOrder": 0, 243 | "_tag": -1, 244 | "_opacityModifyRGB": false, 245 | "_id": "25f0eFVci5Ku68GdkL7J8Ca", 246 | "_active": true, 247 | "_components": [ 248 | { 249 | "__id__": 42 250 | }, 251 | { 252 | "__id__": 43 253 | }, 254 | { 255 | "__id__": 44 256 | } 257 | ], 258 | "_prefab": null, 259 | "groupIndex": 0 260 | }, 261 | { 262 | "__type__": "cc.Node", 263 | "_name": "background", 264 | "_objFlags": 0, 265 | "_opacity": 255, 266 | "_color": { 267 | "__type__": "cc.Color", 268 | "r": 255, 269 | "g": 255, 270 | "b": 255, 271 | "a": 255 272 | }, 273 | "_cascadeOpacityEnabled": true, 274 | "_parent": { 275 | "__id__": 6 276 | }, 277 | "_anchorPoint": { 278 | "__type__": "cc.Vec2", 279 | "x": 0.5, 280 | "y": 0.5 281 | }, 282 | "_contentSize": { 283 | "__type__": "cc.Size", 284 | "width": 1136, 285 | "height": 800 286 | }, 287 | "_children": [], 288 | "_rotationX": 0, 289 | "_rotationY": 0, 290 | "_scaleX": 1, 291 | "_scaleY": 1, 292 | "_position": { 293 | "__type__": "cc.Vec2", 294 | "x": 0, 295 | "y": 0 296 | }, 297 | "_skewX": 0, 298 | "_skewY": 0, 299 | "_localZOrder": 0, 300 | "_globalZOrder": 0, 301 | "_tag": -1, 302 | "_opacityModifyRGB": false, 303 | "_id": "e2e0crkOLxGrpMxpbC4iQg1", 304 | "_active": true, 305 | "_components": [ 306 | { 307 | "__id__": 8 308 | }, 309 | { 310 | "__id__": 9 311 | } 312 | ], 313 | "_prefab": null, 314 | "groupIndex": 0 315 | }, 316 | { 317 | "__type__": "cc.Widget", 318 | "_name": "", 319 | "_objFlags": 0, 320 | "node": { 321 | "__id__": 7 322 | }, 323 | "_enabled": true, 324 | "isAlignOnce": true, 325 | "_target": null, 326 | "_alignFlags": 18, 327 | "_left": 380, 328 | "_right": 380, 329 | "_top": 60, 330 | "_bottom": 245, 331 | "_verticalCenter": 0, 332 | "_horizontalCenter": 0, 333 | "_isAbsLeft": true, 334 | "_isAbsRight": true, 335 | "_isAbsTop": true, 336 | "_isAbsBottom": true, 337 | "_isAbsHorizontalCenter": true, 338 | "_isAbsVerticalCenter": true, 339 | "_originalWidth": 200, 340 | "_originalHeight": 150 341 | }, 342 | { 343 | "__type__": "cc.Sprite", 344 | "_name": "", 345 | "_objFlags": 0, 346 | "node": { 347 | "__id__": 7 348 | }, 349 | "_enabled": true, 350 | "_spriteFrame": { 351 | "__uuid__": "bcef7278-22a7-407a-9d49-ff93ce9a9596" 352 | }, 353 | "_type": 1, 354 | "_sizeMode": 0, 355 | "_fillType": 0, 356 | "_fillCenter": { 357 | "__type__": "cc.Vec2", 358 | "x": 0, 359 | "y": 0 360 | }, 361 | "_fillStart": 0, 362 | "_fillRange": 0, 363 | "_isTrimmedMode": true, 364 | "_srcBlendFactor": 770, 365 | "_dstBlendFactor": 771, 366 | "_atlas": null 367 | }, 368 | { 369 | "__type__": "cc.Node", 370 | "_name": "bg_around", 371 | "_objFlags": 0, 372 | "_opacity": 255, 373 | "_color": { 374 | "__type__": "cc.Color", 375 | "r": 255, 376 | "g": 255, 377 | "b": 255, 378 | "a": 255 379 | }, 380 | "_cascadeOpacityEnabled": true, 381 | "_parent": { 382 | "__id__": 6 383 | }, 384 | "_anchorPoint": { 385 | "__type__": "cc.Vec2", 386 | "x": 0.5, 387 | "y": 0.5 388 | }, 389 | "_contentSize": { 390 | "__type__": "cc.Size", 391 | "width": 956, 392 | "height": 636 393 | }, 394 | "_children": [], 395 | "_rotationX": 0, 396 | "_rotationY": 0, 397 | "_scaleX": 1, 398 | "_scaleY": 1, 399 | "_position": { 400 | "__type__": "cc.Vec2", 401 | "x": 7, 402 | "y": -5 403 | }, 404 | "_skewX": 0, 405 | "_skewY": 0, 406 | "_localZOrder": 0, 407 | "_globalZOrder": 0, 408 | "_tag": -1, 409 | "_opacityModifyRGB": false, 410 | "_id": "8a713w0wP1BSKAJyveKyItQ", 411 | "_active": true, 412 | "_components": [ 413 | { 414 | "__id__": 11 415 | } 416 | ], 417 | "_prefab": null, 418 | "groupIndex": 0 419 | }, 420 | { 421 | "__type__": "cc.Sprite", 422 | "_name": "", 423 | "_objFlags": 0, 424 | "node": { 425 | "__id__": 10 426 | }, 427 | "_enabled": true, 428 | "_spriteFrame": { 429 | "__uuid__": "2c4ebdec-4c26-49e8-99ad-49ee36225b93" 430 | }, 431 | "_type": 1, 432 | "_sizeMode": 0, 433 | "_fillType": 0, 434 | "_fillCenter": { 435 | "__type__": "cc.Vec2", 436 | "x": 0, 437 | "y": 0 438 | }, 439 | "_fillStart": 0, 440 | "_fillRange": 0, 441 | "_isTrimmedMode": true, 442 | "_srcBlendFactor": 770, 443 | "_dstBlendFactor": 771, 444 | "_atlas": null 445 | }, 446 | { 447 | "__type__": "cc.Node", 448 | "_name": "tiled_map", 449 | "_objFlags": 0, 450 | "_opacity": 255, 451 | "_color": { 452 | "__type__": "cc.Color", 453 | "r": 255, 454 | "g": 255, 455 | "b": 255, 456 | "a": 255 457 | }, 458 | "_cascadeOpacityEnabled": true, 459 | "_parent": { 460 | "__id__": 6 461 | }, 462 | "_anchorPoint": { 463 | "__type__": "cc.Vec2", 464 | "x": 0, 465 | "y": 0 466 | }, 467 | "_contentSize": { 468 | "__type__": "cc.Size", 469 | "width": 640, 470 | "height": 360 471 | }, 472 | "_children": [ 473 | { 474 | "__id__": 13 475 | } 476 | ], 477 | "_rotationX": 0, 478 | "_rotationY": 0, 479 | "_scaleX": 1.4, 480 | "_scaleY": 1.4, 481 | "_position": { 482 | "__type__": "cc.Vec2", 483 | "x": -443, 484 | "y": -235 485 | }, 486 | "_skewX": 0, 487 | "_skewY": 0, 488 | "_localZOrder": 0, 489 | "_globalZOrder": 0, 490 | "_tag": -1, 491 | "_opacityModifyRGB": false, 492 | "_id": "b82d7Pc7y1KrJucRtHP+S7I", 493 | "_active": true, 494 | "_components": [ 495 | { 496 | "__id__": 15 497 | }, 498 | { 499 | "__id__": 16 500 | } 501 | ], 502 | "_prefab": null, 503 | "groupIndex": 0 504 | }, 505 | { 506 | "__type__": "cc.Node", 507 | "_name": "bg_layer", 508 | "_objFlags": 0, 509 | "_opacity": 255, 510 | "_color": { 511 | "__type__": "cc.Color", 512 | "r": 255, 513 | "g": 255, 514 | "b": 255, 515 | "a": 255 516 | }, 517 | "_cascadeOpacityEnabled": true, 518 | "_parent": { 519 | "__id__": 12 520 | }, 521 | "_anchorPoint": { 522 | "__type__": "cc.Vec2", 523 | "x": 0, 524 | "y": 0 525 | }, 526 | "_contentSize": { 527 | "__type__": "cc.Size", 528 | "width": 640, 529 | "height": 360 530 | }, 531 | "_children": [], 532 | "_rotationX": 0, 533 | "_rotationY": 0, 534 | "_scaleX": 1, 535 | "_scaleY": 1, 536 | "_position": { 537 | "__type__": "cc.Vec2", 538 | "x": 0, 539 | "y": 0 540 | }, 541 | "_skewX": 0, 542 | "_skewY": 0, 543 | "_localZOrder": 0, 544 | "_globalZOrder": 0, 545 | "_tag": -1, 546 | "_opacityModifyRGB": false, 547 | "_id": "99abb2F2m5FkZucI66MfJR/", 548 | "_active": true, 549 | "_components": [ 550 | { 551 | "__id__": 14 552 | } 553 | ], 554 | "_prefab": null, 555 | "groupIndex": 0 556 | }, 557 | { 558 | "__type__": "cc.TiledLayer", 559 | "_name": "", 560 | "_objFlags": 0, 561 | "node": { 562 | "__id__": 13 563 | }, 564 | "_enabled": true 565 | }, 566 | { 567 | "__type__": "cc.TiledMap", 568 | "_name": "", 569 | "_objFlags": 0, 570 | "node": { 571 | "__id__": 12 572 | }, 573 | "_enabled": true, 574 | "_tmxFile": { 575 | "__uuid__": "0d3c8e8f-edec-4674-9ac7-5a7786395869" 576 | } 577 | }, 578 | { 579 | "__type__": "0fe77J9CgxPXLI8Ev3M/klK", 580 | "_name": "", 581 | "_objFlags": 0, 582 | "node": { 583 | "__id__": 12 584 | }, 585 | "_enabled": true, 586 | "tiledMap": { 587 | "__id__": 15 588 | }, 589 | "bgLayer": { 590 | "__id__": 14 591 | } 592 | }, 593 | { 594 | "__type__": "cc.Node", 595 | "_name": "btn_up", 596 | "_objFlags": 0, 597 | "_opacity": 200, 598 | "_color": { 599 | "__type__": "cc.Color", 600 | "r": 255, 601 | "g": 255, 602 | "b": 255, 603 | "a": 255 604 | }, 605 | "_cascadeOpacityEnabled": true, 606 | "_parent": { 607 | "__id__": 6 608 | }, 609 | "_anchorPoint": { 610 | "__type__": "cc.Vec2", 611 | "x": 0.5, 612 | "y": 0.5 613 | }, 614 | "_contentSize": { 615 | "__type__": "cc.Size", 616 | "width": 100, 617 | "height": 40 618 | }, 619 | "_children": [ 620 | { 621 | "__id__": 18 622 | } 623 | ], 624 | "_rotationX": 0, 625 | "_rotationY": 0, 626 | "_scaleX": 0.6, 627 | "_scaleY": 1.7, 628 | "_position": { 629 | "__type__": "cc.Vec2", 630 | "x": -281, 631 | "y": -204 632 | }, 633 | "_skewX": 0, 634 | "_skewY": 0, 635 | "_localZOrder": 0, 636 | "_globalZOrder": 0, 637 | "_tag": -1, 638 | "_opacityModifyRGB": false, 639 | "_id": "d2133BkfN1Dl5TxLdmQZFgx", 640 | "_active": true, 641 | "_components": [ 642 | { 643 | "__id__": 20 644 | }, 645 | { 646 | "__id__": 21 647 | } 648 | ], 649 | "_prefab": null, 650 | "groupIndex": 0 651 | }, 652 | { 653 | "__type__": "cc.Node", 654 | "_name": "Label", 655 | "_objFlags": 0, 656 | "_opacity": 255, 657 | "_color": { 658 | "__type__": "cc.Color", 659 | "r": 0, 660 | "g": 0, 661 | "b": 0, 662 | "a": 255 663 | }, 664 | "_cascadeOpacityEnabled": true, 665 | "_parent": { 666 | "__id__": 17 667 | }, 668 | "_anchorPoint": { 669 | "__type__": "cc.Vec2", 670 | "x": 0.5, 671 | "y": 0.5 672 | }, 673 | "_contentSize": { 674 | "__type__": "cc.Size", 675 | "width": 100, 676 | "height": 40 677 | }, 678 | "_children": [], 679 | "_rotationX": 0, 680 | "_rotationY": 0, 681 | "_scaleX": 1, 682 | "_scaleY": 1, 683 | "_position": { 684 | "__type__": "cc.Vec2", 685 | "x": 0, 686 | "y": 0 687 | }, 688 | "_skewX": 0, 689 | "_skewY": 0, 690 | "_localZOrder": 0, 691 | "_globalZOrder": 0, 692 | "_tag": -1, 693 | "_opacityModifyRGB": false, 694 | "_id": "a7675wE5FNAB7ORimmrBsRP", 695 | "_active": true, 696 | "_components": [ 697 | { 698 | "__id__": 19 699 | } 700 | ], 701 | "_prefab": null, 702 | "groupIndex": 0 703 | }, 704 | { 705 | "__type__": "cc.Label", 706 | "_name": "", 707 | "_objFlags": 0, 708 | "node": { 709 | "__id__": 18 710 | }, 711 | "_enabled": true, 712 | "_useOriginalSize": false, 713 | "_actualFontSize": 30, 714 | "_fontSize": 30, 715 | "_lineHeight": 40, 716 | "_enableWrapText": false, 717 | "_N$file": null, 718 | "_isSystemFontUsed": true, 719 | "_spacingX": 0, 720 | "_N$string": "↑", 721 | "_N$horizontalAlign": 1, 722 | "_N$verticalAlign": 1, 723 | "_N$overflow": 1 724 | }, 725 | { 726 | "__type__": "cc.Sprite", 727 | "_name": "", 728 | "_objFlags": 0, 729 | "node": { 730 | "__id__": 17 731 | }, 732 | "_enabled": true, 733 | "_spriteFrame": { 734 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 735 | }, 736 | "_type": 1, 737 | "_sizeMode": 0, 738 | "_fillType": 0, 739 | "_fillCenter": { 740 | "__type__": "cc.Vec2", 741 | "x": 0, 742 | "y": 0 743 | }, 744 | "_fillStart": 0, 745 | "_fillRange": 0, 746 | "_isTrimmedMode": true, 747 | "_srcBlendFactor": 770, 748 | "_dstBlendFactor": 771, 749 | "_atlas": null 750 | }, 751 | { 752 | "__type__": "cc.Button", 753 | "_name": "", 754 | "_objFlags": 0, 755 | "node": { 756 | "__id__": 17 757 | }, 758 | "_enabled": true, 759 | "transition": 2, 760 | "pressedColor": { 761 | "__type__": "cc.Color", 762 | "r": 255, 763 | "g": 255, 764 | "b": 255, 765 | "a": 255 766 | }, 767 | "hoverColor": { 768 | "__type__": "cc.Color", 769 | "r": 255, 770 | "g": 255, 771 | "b": 255, 772 | "a": 255 773 | }, 774 | "duration": 0.1, 775 | "zoomScale": 1.2, 776 | "pressedSprite": { 777 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 778 | }, 779 | "hoverSprite": { 780 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 781 | }, 782 | "clickEvents": [], 783 | "_N$interactable": true, 784 | "_N$enableAutoGrayEffect": false, 785 | "_N$normalColor": { 786 | "__type__": "cc.Color", 787 | "r": 255, 788 | "g": 255, 789 | "b": 255, 790 | "a": 255 791 | }, 792 | "_N$disabledColor": { 793 | "__type__": "cc.Color", 794 | "r": 255, 795 | "g": 255, 796 | "b": 255, 797 | "a": 255 798 | }, 799 | "_N$normalSprite": { 800 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 801 | }, 802 | "_N$disabledSprite": { 803 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 804 | }, 805 | "_N$target": { 806 | "__id__": 17 807 | } 808 | }, 809 | { 810 | "__type__": "cc.Node", 811 | "_name": "btn_down", 812 | "_objFlags": 0, 813 | "_opacity": 200, 814 | "_color": { 815 | "__type__": "cc.Color", 816 | "r": 255, 817 | "g": 255, 818 | "b": 255, 819 | "a": 255 820 | }, 821 | "_cascadeOpacityEnabled": true, 822 | "_parent": { 823 | "__id__": 6 824 | }, 825 | "_anchorPoint": { 826 | "__type__": "cc.Vec2", 827 | "x": 0.5, 828 | "y": 0.5 829 | }, 830 | "_contentSize": { 831 | "__type__": "cc.Size", 832 | "width": 100, 833 | "height": 40 834 | }, 835 | "_children": [ 836 | { 837 | "__id__": 23 838 | } 839 | ], 840 | "_rotationX": 0, 841 | "_rotationY": 0, 842 | "_scaleX": 0.6, 843 | "_scaleY": 1.7, 844 | "_position": { 845 | "__type__": "cc.Vec2", 846 | "x": -282, 847 | "y": -280 848 | }, 849 | "_skewX": 0, 850 | "_skewY": 0, 851 | "_localZOrder": 0, 852 | "_globalZOrder": 0, 853 | "_tag": -1, 854 | "_opacityModifyRGB": false, 855 | "_id": "41da6I40hJHHLeU2DtqzD1V", 856 | "_active": true, 857 | "_components": [ 858 | { 859 | "__id__": 25 860 | }, 861 | { 862 | "__id__": 26 863 | } 864 | ], 865 | "_prefab": null, 866 | "groupIndex": 0 867 | }, 868 | { 869 | "__type__": "cc.Node", 870 | "_name": "Label", 871 | "_objFlags": 0, 872 | "_opacity": 255, 873 | "_color": { 874 | "__type__": "cc.Color", 875 | "r": 0, 876 | "g": 0, 877 | "b": 0, 878 | "a": 255 879 | }, 880 | "_cascadeOpacityEnabled": true, 881 | "_parent": { 882 | "__id__": 22 883 | }, 884 | "_anchorPoint": { 885 | "__type__": "cc.Vec2", 886 | "x": 0.5, 887 | "y": 0.5 888 | }, 889 | "_contentSize": { 890 | "__type__": "cc.Size", 891 | "width": 100, 892 | "height": 40 893 | }, 894 | "_children": [], 895 | "_rotationX": 0, 896 | "_rotationY": 0, 897 | "_scaleX": 1, 898 | "_scaleY": 1, 899 | "_position": { 900 | "__type__": "cc.Vec2", 901 | "x": 0, 902 | "y": 0 903 | }, 904 | "_skewX": 0, 905 | "_skewY": 0, 906 | "_localZOrder": 0, 907 | "_globalZOrder": 0, 908 | "_tag": -1, 909 | "_opacityModifyRGB": false, 910 | "_id": "2e679PJCkZO2Ii745qBLPeP", 911 | "_active": true, 912 | "_components": [ 913 | { 914 | "__id__": 24 915 | } 916 | ], 917 | "_prefab": null, 918 | "groupIndex": 0 919 | }, 920 | { 921 | "__type__": "cc.Label", 922 | "_name": "", 923 | "_objFlags": 0, 924 | "node": { 925 | "__id__": 23 926 | }, 927 | "_enabled": true, 928 | "_useOriginalSize": false, 929 | "_actualFontSize": 30, 930 | "_fontSize": 30, 931 | "_lineHeight": 40, 932 | "_enableWrapText": false, 933 | "_N$file": null, 934 | "_isSystemFontUsed": true, 935 | "_spacingX": 0, 936 | "_N$string": "↓", 937 | "_N$horizontalAlign": 1, 938 | "_N$verticalAlign": 1, 939 | "_N$overflow": 1 940 | }, 941 | { 942 | "__type__": "cc.Sprite", 943 | "_name": "", 944 | "_objFlags": 0, 945 | "node": { 946 | "__id__": 22 947 | }, 948 | "_enabled": true, 949 | "_spriteFrame": { 950 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 951 | }, 952 | "_type": 1, 953 | "_sizeMode": 0, 954 | "_fillType": 0, 955 | "_fillCenter": { 956 | "__type__": "cc.Vec2", 957 | "x": 0, 958 | "y": 0 959 | }, 960 | "_fillStart": 0, 961 | "_fillRange": 0, 962 | "_isTrimmedMode": true, 963 | "_srcBlendFactor": 770, 964 | "_dstBlendFactor": 771, 965 | "_atlas": null 966 | }, 967 | { 968 | "__type__": "cc.Button", 969 | "_name": "", 970 | "_objFlags": 0, 971 | "node": { 972 | "__id__": 22 973 | }, 974 | "_enabled": true, 975 | "transition": 2, 976 | "pressedColor": { 977 | "__type__": "cc.Color", 978 | "r": 255, 979 | "g": 255, 980 | "b": 255, 981 | "a": 255 982 | }, 983 | "hoverColor": { 984 | "__type__": "cc.Color", 985 | "r": 255, 986 | "g": 255, 987 | "b": 255, 988 | "a": 255 989 | }, 990 | "duration": 0.1, 991 | "zoomScale": 1.2, 992 | "pressedSprite": { 993 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 994 | }, 995 | "hoverSprite": { 996 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 997 | }, 998 | "clickEvents": [], 999 | "_N$interactable": true, 1000 | "_N$enableAutoGrayEffect": false, 1001 | "_N$normalColor": { 1002 | "__type__": "cc.Color", 1003 | "r": 255, 1004 | "g": 255, 1005 | "b": 255, 1006 | "a": 255 1007 | }, 1008 | "_N$disabledColor": { 1009 | "__type__": "cc.Color", 1010 | "r": 255, 1011 | "g": 255, 1012 | "b": 255, 1013 | "a": 255 1014 | }, 1015 | "_N$normalSprite": { 1016 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1017 | }, 1018 | "_N$disabledSprite": { 1019 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1020 | }, 1021 | "_N$target": { 1022 | "__id__": 22 1023 | } 1024 | }, 1025 | { 1026 | "__type__": "cc.Node", 1027 | "_name": "btn_left", 1028 | "_objFlags": 0, 1029 | "_opacity": 200, 1030 | "_color": { 1031 | "__type__": "cc.Color", 1032 | "r": 255, 1033 | "g": 255, 1034 | "b": 255, 1035 | "a": 255 1036 | }, 1037 | "_cascadeOpacityEnabled": true, 1038 | "_parent": { 1039 | "__id__": 6 1040 | }, 1041 | "_anchorPoint": { 1042 | "__type__": "cc.Vec2", 1043 | "x": 0.5, 1044 | "y": 0.5 1045 | }, 1046 | "_contentSize": { 1047 | "__type__": "cc.Size", 1048 | "width": 100, 1049 | "height": 40 1050 | }, 1051 | "_children": [ 1052 | { 1053 | "__id__": 28 1054 | } 1055 | ], 1056 | "_rotationX": 0, 1057 | "_rotationY": 0, 1058 | "_scaleX": 0.6, 1059 | "_scaleY": 1.7, 1060 | "_position": { 1061 | "__type__": "cc.Vec2", 1062 | "x": -358, 1063 | "y": -283 1064 | }, 1065 | "_skewX": 0, 1066 | "_skewY": 0, 1067 | "_localZOrder": 0, 1068 | "_globalZOrder": 0, 1069 | "_tag": -1, 1070 | "_opacityModifyRGB": false, 1071 | "_id": "31b913tothJfLCkfIFyWcek", 1072 | "_active": true, 1073 | "_components": [ 1074 | { 1075 | "__id__": 30 1076 | }, 1077 | { 1078 | "__id__": 31 1079 | } 1080 | ], 1081 | "_prefab": null, 1082 | "groupIndex": 0 1083 | }, 1084 | { 1085 | "__type__": "cc.Node", 1086 | "_name": "Label", 1087 | "_objFlags": 0, 1088 | "_opacity": 255, 1089 | "_color": { 1090 | "__type__": "cc.Color", 1091 | "r": 0, 1092 | "g": 0, 1093 | "b": 0, 1094 | "a": 255 1095 | }, 1096 | "_cascadeOpacityEnabled": true, 1097 | "_parent": { 1098 | "__id__": 27 1099 | }, 1100 | "_anchorPoint": { 1101 | "__type__": "cc.Vec2", 1102 | "x": 0.5, 1103 | "y": 0.5 1104 | }, 1105 | "_contentSize": { 1106 | "__type__": "cc.Size", 1107 | "width": 100, 1108 | "height": 40 1109 | }, 1110 | "_children": [], 1111 | "_rotationX": 0, 1112 | "_rotationY": 0, 1113 | "_scaleX": 1, 1114 | "_scaleY": 1, 1115 | "_position": { 1116 | "__type__": "cc.Vec2", 1117 | "x": 0, 1118 | "y": 0 1119 | }, 1120 | "_skewX": 0, 1121 | "_skewY": 0, 1122 | "_localZOrder": 0, 1123 | "_globalZOrder": 0, 1124 | "_tag": -1, 1125 | "_opacityModifyRGB": false, 1126 | "_id": "19135jH7JZOH75+hCWaA98Q", 1127 | "_active": true, 1128 | "_components": [ 1129 | { 1130 | "__id__": 29 1131 | } 1132 | ], 1133 | "_prefab": null, 1134 | "groupIndex": 0 1135 | }, 1136 | { 1137 | "__type__": "cc.Label", 1138 | "_name": "", 1139 | "_objFlags": 0, 1140 | "node": { 1141 | "__id__": 28 1142 | }, 1143 | "_enabled": true, 1144 | "_useOriginalSize": false, 1145 | "_actualFontSize": 30, 1146 | "_fontSize": 30, 1147 | "_lineHeight": 40, 1148 | "_enableWrapText": false, 1149 | "_N$file": null, 1150 | "_isSystemFontUsed": true, 1151 | "_spacingX": 0, 1152 | "_N$string": "←", 1153 | "_N$horizontalAlign": 1, 1154 | "_N$verticalAlign": 1, 1155 | "_N$overflow": 1 1156 | }, 1157 | { 1158 | "__type__": "cc.Sprite", 1159 | "_name": "", 1160 | "_objFlags": 0, 1161 | "node": { 1162 | "__id__": 27 1163 | }, 1164 | "_enabled": true, 1165 | "_spriteFrame": { 1166 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1167 | }, 1168 | "_type": 1, 1169 | "_sizeMode": 0, 1170 | "_fillType": 0, 1171 | "_fillCenter": { 1172 | "__type__": "cc.Vec2", 1173 | "x": 0, 1174 | "y": 0 1175 | }, 1176 | "_fillStart": 0, 1177 | "_fillRange": 0, 1178 | "_isTrimmedMode": true, 1179 | "_srcBlendFactor": 770, 1180 | "_dstBlendFactor": 771, 1181 | "_atlas": null 1182 | }, 1183 | { 1184 | "__type__": "cc.Button", 1185 | "_name": "", 1186 | "_objFlags": 0, 1187 | "node": { 1188 | "__id__": 27 1189 | }, 1190 | "_enabled": true, 1191 | "transition": 2, 1192 | "pressedColor": { 1193 | "__type__": "cc.Color", 1194 | "r": 255, 1195 | "g": 255, 1196 | "b": 255, 1197 | "a": 255 1198 | }, 1199 | "hoverColor": { 1200 | "__type__": "cc.Color", 1201 | "r": 255, 1202 | "g": 255, 1203 | "b": 255, 1204 | "a": 255 1205 | }, 1206 | "duration": 0.1, 1207 | "zoomScale": 1.2, 1208 | "pressedSprite": { 1209 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1210 | }, 1211 | "hoverSprite": { 1212 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1213 | }, 1214 | "clickEvents": [], 1215 | "_N$interactable": true, 1216 | "_N$enableAutoGrayEffect": false, 1217 | "_N$normalColor": { 1218 | "__type__": "cc.Color", 1219 | "r": 255, 1220 | "g": 255, 1221 | "b": 255, 1222 | "a": 255 1223 | }, 1224 | "_N$disabledColor": { 1225 | "__type__": "cc.Color", 1226 | "r": 255, 1227 | "g": 255, 1228 | "b": 255, 1229 | "a": 255 1230 | }, 1231 | "_N$normalSprite": { 1232 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1233 | }, 1234 | "_N$disabledSprite": { 1235 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1236 | }, 1237 | "_N$target": { 1238 | "__id__": 27 1239 | } 1240 | }, 1241 | { 1242 | "__type__": "cc.Node", 1243 | "_name": "btn_right", 1244 | "_objFlags": 0, 1245 | "_opacity": 200, 1246 | "_color": { 1247 | "__type__": "cc.Color", 1248 | "r": 255, 1249 | "g": 255, 1250 | "b": 255, 1251 | "a": 255 1252 | }, 1253 | "_cascadeOpacityEnabled": true, 1254 | "_parent": { 1255 | "__id__": 6 1256 | }, 1257 | "_anchorPoint": { 1258 | "__type__": "cc.Vec2", 1259 | "x": 0.5, 1260 | "y": 0.5 1261 | }, 1262 | "_contentSize": { 1263 | "__type__": "cc.Size", 1264 | "width": 100, 1265 | "height": 40 1266 | }, 1267 | "_children": [ 1268 | { 1269 | "__id__": 33 1270 | } 1271 | ], 1272 | "_rotationX": 0, 1273 | "_rotationY": 0, 1274 | "_scaleX": 0.6, 1275 | "_scaleY": 1.7, 1276 | "_position": { 1277 | "__type__": "cc.Vec2", 1278 | "x": -201, 1279 | "y": -278 1280 | }, 1281 | "_skewX": 0, 1282 | "_skewY": 0, 1283 | "_localZOrder": 0, 1284 | "_globalZOrder": 0, 1285 | "_tag": -1, 1286 | "_opacityModifyRGB": false, 1287 | "_id": "03b6d0u+2pG0bvFaPeEphLG", 1288 | "_active": true, 1289 | "_components": [ 1290 | { 1291 | "__id__": 35 1292 | }, 1293 | { 1294 | "__id__": 36 1295 | } 1296 | ], 1297 | "_prefab": null, 1298 | "groupIndex": 0 1299 | }, 1300 | { 1301 | "__type__": "cc.Node", 1302 | "_name": "Label", 1303 | "_objFlags": 0, 1304 | "_opacity": 255, 1305 | "_color": { 1306 | "__type__": "cc.Color", 1307 | "r": 0, 1308 | "g": 0, 1309 | "b": 0, 1310 | "a": 255 1311 | }, 1312 | "_cascadeOpacityEnabled": true, 1313 | "_parent": { 1314 | "__id__": 32 1315 | }, 1316 | "_anchorPoint": { 1317 | "__type__": "cc.Vec2", 1318 | "x": 0.5, 1319 | "y": 0.5 1320 | }, 1321 | "_contentSize": { 1322 | "__type__": "cc.Size", 1323 | "width": 100, 1324 | "height": 40 1325 | }, 1326 | "_children": [], 1327 | "_rotationX": 0, 1328 | "_rotationY": 0, 1329 | "_scaleX": 1, 1330 | "_scaleY": 1, 1331 | "_position": { 1332 | "__type__": "cc.Vec2", 1333 | "x": 0, 1334 | "y": 0 1335 | }, 1336 | "_skewX": 0, 1337 | "_skewY": 0, 1338 | "_localZOrder": 0, 1339 | "_globalZOrder": 0, 1340 | "_tag": -1, 1341 | "_opacityModifyRGB": false, 1342 | "_id": "689b2cK5a5Hr4f1Bt0UQUi/", 1343 | "_active": true, 1344 | "_components": [ 1345 | { 1346 | "__id__": 34 1347 | } 1348 | ], 1349 | "_prefab": null, 1350 | "groupIndex": 0 1351 | }, 1352 | { 1353 | "__type__": "cc.Label", 1354 | "_name": "", 1355 | "_objFlags": 0, 1356 | "node": { 1357 | "__id__": 33 1358 | }, 1359 | "_enabled": true, 1360 | "_useOriginalSize": false, 1361 | "_actualFontSize": 30, 1362 | "_fontSize": 30, 1363 | "_lineHeight": 40, 1364 | "_enableWrapText": false, 1365 | "_N$file": null, 1366 | "_isSystemFontUsed": true, 1367 | "_spacingX": 0, 1368 | "_N$string": "→", 1369 | "_N$horizontalAlign": 1, 1370 | "_N$verticalAlign": 1, 1371 | "_N$overflow": 1 1372 | }, 1373 | { 1374 | "__type__": "cc.Sprite", 1375 | "_name": "", 1376 | "_objFlags": 0, 1377 | "node": { 1378 | "__id__": 32 1379 | }, 1380 | "_enabled": true, 1381 | "_spriteFrame": { 1382 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1383 | }, 1384 | "_type": 1, 1385 | "_sizeMode": 0, 1386 | "_fillType": 0, 1387 | "_fillCenter": { 1388 | "__type__": "cc.Vec2", 1389 | "x": 0, 1390 | "y": 0 1391 | }, 1392 | "_fillStart": 0, 1393 | "_fillRange": 0, 1394 | "_isTrimmedMode": true, 1395 | "_srcBlendFactor": 770, 1396 | "_dstBlendFactor": 771, 1397 | "_atlas": null 1398 | }, 1399 | { 1400 | "__type__": "cc.Button", 1401 | "_name": "", 1402 | "_objFlags": 0, 1403 | "node": { 1404 | "__id__": 32 1405 | }, 1406 | "_enabled": true, 1407 | "transition": 2, 1408 | "pressedColor": { 1409 | "__type__": "cc.Color", 1410 | "r": 255, 1411 | "g": 255, 1412 | "b": 255, 1413 | "a": 255 1414 | }, 1415 | "hoverColor": { 1416 | "__type__": "cc.Color", 1417 | "r": 255, 1418 | "g": 255, 1419 | "b": 255, 1420 | "a": 255 1421 | }, 1422 | "duration": 0.1, 1423 | "zoomScale": 1.2, 1424 | "pressedSprite": { 1425 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1426 | }, 1427 | "hoverSprite": { 1428 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1429 | }, 1430 | "clickEvents": [], 1431 | "_N$interactable": true, 1432 | "_N$enableAutoGrayEffect": false, 1433 | "_N$normalColor": { 1434 | "__type__": "cc.Color", 1435 | "r": 255, 1436 | "g": 255, 1437 | "b": 255, 1438 | "a": 255 1439 | }, 1440 | "_N$disabledColor": { 1441 | "__type__": "cc.Color", 1442 | "r": 255, 1443 | "g": 255, 1444 | "b": 255, 1445 | "a": 255 1446 | }, 1447 | "_N$normalSprite": { 1448 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1449 | }, 1450 | "_N$disabledSprite": { 1451 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1452 | }, 1453 | "_N$target": { 1454 | "__id__": 32 1455 | } 1456 | }, 1457 | { 1458 | "__type__": "cc.Node", 1459 | "_name": "btn_skill", 1460 | "_objFlags": 0, 1461 | "_opacity": 200, 1462 | "_color": { 1463 | "__type__": "cc.Color", 1464 | "r": 255, 1465 | "g": 255, 1466 | "b": 255, 1467 | "a": 255 1468 | }, 1469 | "_cascadeOpacityEnabled": true, 1470 | "_parent": { 1471 | "__id__": 6 1472 | }, 1473 | "_anchorPoint": { 1474 | "__type__": "cc.Vec2", 1475 | "x": 0.5, 1476 | "y": 0.5 1477 | }, 1478 | "_contentSize": { 1479 | "__type__": "cc.Size", 1480 | "width": 100, 1481 | "height": 40 1482 | }, 1483 | "_children": [ 1484 | { 1485 | "__id__": 38 1486 | } 1487 | ], 1488 | "_rotationX": 0, 1489 | "_rotationY": 0, 1490 | "_scaleX": 1.8, 1491 | "_scaleY": 1.8, 1492 | "_position": { 1493 | "__type__": "cc.Vec2", 1494 | "x": 254, 1495 | "y": -276 1496 | }, 1497 | "_skewX": 0, 1498 | "_skewY": 0, 1499 | "_localZOrder": 0, 1500 | "_globalZOrder": 0, 1501 | "_tag": -1, 1502 | "_opacityModifyRGB": false, 1503 | "_id": "fcbbfekCIdHPozqQ+lcNak7", 1504 | "_active": true, 1505 | "_components": [ 1506 | { 1507 | "__id__": 40 1508 | }, 1509 | { 1510 | "__id__": 41 1511 | } 1512 | ], 1513 | "_prefab": null, 1514 | "groupIndex": 0 1515 | }, 1516 | { 1517 | "__type__": "cc.Node", 1518 | "_name": "Label", 1519 | "_objFlags": 0, 1520 | "_opacity": 255, 1521 | "_color": { 1522 | "__type__": "cc.Color", 1523 | "r": 0, 1524 | "g": 0, 1525 | "b": 0, 1526 | "a": 255 1527 | }, 1528 | "_cascadeOpacityEnabled": true, 1529 | "_parent": { 1530 | "__id__": 37 1531 | }, 1532 | "_anchorPoint": { 1533 | "__type__": "cc.Vec2", 1534 | "x": 0.5, 1535 | "y": 0.5 1536 | }, 1537 | "_contentSize": { 1538 | "__type__": "cc.Size", 1539 | "width": 100, 1540 | "height": 40 1541 | }, 1542 | "_children": [], 1543 | "_rotationX": 0, 1544 | "_rotationY": 0, 1545 | "_scaleX": 1, 1546 | "_scaleY": 1, 1547 | "_position": { 1548 | "__type__": "cc.Vec2", 1549 | "x": 0, 1550 | "y": 0 1551 | }, 1552 | "_skewX": 0, 1553 | "_skewY": 0, 1554 | "_localZOrder": 0, 1555 | "_globalZOrder": 0, 1556 | "_tag": -1, 1557 | "_opacityModifyRGB": false, 1558 | "_id": "c3264Zy/O5NIYD6BtMt3ZWI", 1559 | "_active": true, 1560 | "_components": [ 1561 | { 1562 | "__id__": 39 1563 | } 1564 | ], 1565 | "_prefab": null, 1566 | "groupIndex": 0 1567 | }, 1568 | { 1569 | "__type__": "cc.Label", 1570 | "_name": "", 1571 | "_objFlags": 0, 1572 | "node": { 1573 | "__id__": 38 1574 | }, 1575 | "_enabled": true, 1576 | "_useOriginalSize": false, 1577 | "_actualFontSize": 20, 1578 | "_fontSize": 20, 1579 | "_lineHeight": 40, 1580 | "_enableWrapText": false, 1581 | "_N$file": null, 1582 | "_isSystemFontUsed": true, 1583 | "_spacingX": 0, 1584 | "_N$string": "SPACE", 1585 | "_N$horizontalAlign": 1, 1586 | "_N$verticalAlign": 1, 1587 | "_N$overflow": 1 1588 | }, 1589 | { 1590 | "__type__": "cc.Sprite", 1591 | "_name": "", 1592 | "_objFlags": 0, 1593 | "node": { 1594 | "__id__": 37 1595 | }, 1596 | "_enabled": true, 1597 | "_spriteFrame": { 1598 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1599 | }, 1600 | "_type": 1, 1601 | "_sizeMode": 0, 1602 | "_fillType": 0, 1603 | "_fillCenter": { 1604 | "__type__": "cc.Vec2", 1605 | "x": 0, 1606 | "y": 0 1607 | }, 1608 | "_fillStart": 0, 1609 | "_fillRange": 0, 1610 | "_isTrimmedMode": true, 1611 | "_srcBlendFactor": 770, 1612 | "_dstBlendFactor": 771, 1613 | "_atlas": null 1614 | }, 1615 | { 1616 | "__type__": "cc.Button", 1617 | "_name": "", 1618 | "_objFlags": 0, 1619 | "node": { 1620 | "__id__": 37 1621 | }, 1622 | "_enabled": true, 1623 | "transition": 2, 1624 | "pressedColor": { 1625 | "__type__": "cc.Color", 1626 | "r": 255, 1627 | "g": 255, 1628 | "b": 255, 1629 | "a": 255 1630 | }, 1631 | "hoverColor": { 1632 | "__type__": "cc.Color", 1633 | "r": 255, 1634 | "g": 255, 1635 | "b": 255, 1636 | "a": 255 1637 | }, 1638 | "duration": 0.1, 1639 | "zoomScale": 1.2, 1640 | "pressedSprite": { 1641 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1642 | }, 1643 | "hoverSprite": { 1644 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1645 | }, 1646 | "clickEvents": [], 1647 | "_N$interactable": true, 1648 | "_N$enableAutoGrayEffect": false, 1649 | "_N$normalColor": { 1650 | "__type__": "cc.Color", 1651 | "r": 255, 1652 | "g": 255, 1653 | "b": 255, 1654 | "a": 255 1655 | }, 1656 | "_N$disabledColor": { 1657 | "__type__": "cc.Color", 1658 | "r": 255, 1659 | "g": 255, 1660 | "b": 255, 1661 | "a": 255 1662 | }, 1663 | "_N$normalSprite": { 1664 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1665 | }, 1666 | "_N$disabledSprite": { 1667 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1668 | }, 1669 | "_N$target": { 1670 | "__id__": 37 1671 | } 1672 | }, 1673 | { 1674 | "__type__": "280c3rsZJJKnZ9RqbALVwtK", 1675 | "_name": "", 1676 | "_objFlags": 0, 1677 | "node": { 1678 | "__id__": 6 1679 | }, 1680 | "_enabled": true, 1681 | "Main": { 1682 | "__id__": 3 1683 | }, 1684 | "Map": { 1685 | "__id__": 15 1686 | }, 1687 | "btn_up": { 1688 | "__id__": 21 1689 | }, 1690 | "btn_down": { 1691 | "__id__": 26 1692 | }, 1693 | "btn_left": { 1694 | "__id__": 31 1695 | }, 1696 | "btn_right": { 1697 | "__id__": 36 1698 | }, 1699 | "btn_skill": { 1700 | "__id__": 41 1701 | } 1702 | }, 1703 | { 1704 | "__type__": "0fe77J9CgxPXLI8Ev3M/klK", 1705 | "_name": "", 1706 | "_objFlags": 0, 1707 | "node": { 1708 | "__id__": 6 1709 | }, 1710 | "_enabled": true, 1711 | "tiledMap": null, 1712 | "bgLayer": null 1713 | }, 1714 | { 1715 | "__type__": "9bde9GEy1dGgbwxrpwjI7r+", 1716 | "_name": "", 1717 | "_objFlags": 0, 1718 | "node": { 1719 | "__id__": 6 1720 | }, 1721 | "_enabled": true, 1722 | "playerPrefab": { 1723 | "__uuid__": "74e37804-d41a-420f-a56c-7cf34e8d7392" 1724 | } 1725 | }, 1726 | { 1727 | "__type__": "cc.Canvas", 1728 | "_name": "", 1729 | "_objFlags": 0, 1730 | "node": { 1731 | "__id__": 2 1732 | }, 1733 | "_enabled": true, 1734 | "_designResolution": { 1735 | "__type__": "cc.Size", 1736 | "width": 1136, 1737 | "height": 640 1738 | }, 1739 | "_fitWidth": true, 1740 | "_fitHeight": false 1741 | } 1742 | ] --------------------------------------------------------------------------------