├── README.md ├── assets ├── Texture │ ├── bian.png │ ├── cocos.png │ ├── tank │ │ ├── tank.png │ │ ├── aimboom.png │ │ ├── tank.png.meta │ │ ├── aimboom.png.meta │ │ ├── aimboom.plist │ │ ├── aimboom.plist.meta │ │ └── tank.plist │ ├── ui │ │ ├── uipack.png │ │ ├── TextInput.png │ │ ├── common_bg.png │ │ ├── stage_title.png │ │ ├── TextInput.png.meta │ │ ├── uipack.png.meta │ │ ├── common_bg.png.meta │ │ └── stage_title.png.meta │ ├── HelloWorld.png │ ├── singleColor.png │ ├── Cocos2d-html5.png │ ├── ui.meta │ ├── tank.meta │ ├── bian.png.meta │ ├── cocos.png.meta │ ├── singleColor.png.meta │ ├── HelloWorld.png.meta │ └── Cocos2d-html5.png.meta ├── maps │ ├── map2 │ │ ├── sci_atlas.png │ │ ├── map1.tmx.meta │ │ ├── map2.tmx.meta │ │ ├── sci_atlas.png.meta │ │ ├── map2.tmx │ │ └── map1.tmx │ └── map2.meta ├── widget │ ├── joystick │ │ ├── dot.png │ │ ├── ring.png │ │ ├── joystickdot.png │ │ ├── joystickring.png │ │ ├── ring.js.meta │ │ ├── dot.png.meta │ │ ├── ring.png.meta │ │ ├── joystickdot.png.meta │ │ ├── joystickring.png.meta │ │ └── ring.js │ ├── joystick.meta │ ├── tank.meta │ └── tank │ │ ├── base.meta │ │ ├── tank.meta │ │ ├── base │ │ ├── BaseBullet.prefab.meta │ │ ├── NailTank.prefab.meta │ │ ├── Bullet.js.meta │ │ ├── BaseBullet.js.meta │ │ ├── NailTank.js.meta │ │ ├── Bullet.js │ │ ├── NailTank.js │ │ ├── BaseBullet.js │ │ └── NailTank.prefab │ │ └── tank │ │ ├── HeavyTankA.prefab.meta │ │ ├── HeavyTankB.prefab.meta │ │ ├── HeavyTankC.prefab.meta │ │ ├── MidTankA.prefab.meta │ │ ├── MidTankB.prefab.meta │ │ ├── MidTankC.prefab.meta │ │ ├── SmallTankA.prefab.meta │ │ ├── SmallTankB.prefab.meta │ │ ├── SmallTankC.prefab.meta │ │ ├── BaseTank.js.meta │ │ ├── BaseTank.js │ │ └── SmallTankA.prefab ├── animate │ ├── my.anim.meta │ ├── aimBoom.anim.meta │ ├── aimBoom.anim │ └── my.anim ├── Scene.meta ├── Script.meta ├── Texture.meta ├── bcx.meta ├── maps.meta ├── animate.meta ├── widget.meta ├── Scene │ ├── cover.fire.meta │ ├── game.fire.meta │ ├── lobby.fire.meta │ ├── tank.fire.meta │ ├── helloworld.fire.meta │ ├── lobby.fire │ └── helloworld.fire ├── Script │ ├── Cover.js.meta │ ├── EventCenter.js.meta │ ├── GameMain.js.meta │ ├── HelloWorld.js.meta │ ├── socket.io.js.meta │ ├── HelloWorld.js │ ├── EventCenter.js │ ├── Cover.js │ └── GameMain.js └── bcx │ ├── bcx.min.js.meta │ ├── core.min.js.meta │ ├── plugins.min.js.meta │ └── plugins.min.js ├── project.json ├── jsconfig.json ├── Dockerfile ├── settings ├── project.json ├── builder.json └── services.json └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # cocostank 2 | # need cocospay -------------------------------------------------------------------------------- /assets/Texture/bian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/bian.png -------------------------------------------------------------------------------- /assets/Texture/cocos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/cocos.png -------------------------------------------------------------------------------- /assets/Texture/tank/tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/tank/tank.png -------------------------------------------------------------------------------- /assets/Texture/ui/uipack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/ui/uipack.png -------------------------------------------------------------------------------- /assets/Texture/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/HelloWorld.png -------------------------------------------------------------------------------- /assets/Texture/singleColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/singleColor.png -------------------------------------------------------------------------------- /assets/maps/map2/sci_atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/maps/map2/sci_atlas.png -------------------------------------------------------------------------------- /assets/widget/joystick/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/widget/joystick/dot.png -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages", 4 | "version": "2.1.2" 5 | } -------------------------------------------------------------------------------- /assets/Texture/Cocos2d-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/Cocos2d-html5.png -------------------------------------------------------------------------------- /assets/Texture/tank/aimboom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/tank/aimboom.png -------------------------------------------------------------------------------- /assets/Texture/ui/TextInput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/ui/TextInput.png -------------------------------------------------------------------------------- /assets/Texture/ui/common_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/ui/common_bg.png -------------------------------------------------------------------------------- /assets/Texture/ui/stage_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/Texture/ui/stage_title.png -------------------------------------------------------------------------------- /assets/widget/joystick/ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/widget/joystick/ring.png -------------------------------------------------------------------------------- /assets/widget/joystick/joystickdot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/widget/joystick/joystickdot.png -------------------------------------------------------------------------------- /assets/animate/my.anim.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "b2c49f52-2875-428c-9ace-5040bb7d7444", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/widget/joystick/joystickring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cocos-BCX/wetank/HEAD/assets/widget/joystick/joystickring.png -------------------------------------------------------------------------------- /assets/animate/aimBoom.anim.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "958b4557-0546-46b3-95af-6aeed73396e2", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/maps/map2/map1.tmx.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.1", 3 | "uuid": "85cf332c-a9b0-4d50-8c8a-4f2cf13b0b44", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/maps/map2/map2.tmx.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.1", 3 | "uuid": "d8f54833-0fda-437b-a414-81f1f22dcc06", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /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/bcx.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "a6296b07-4c01-4164-8193-1bb86998b8b2", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/maps.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2084a121-0911-4e52-bbf1-3282d014bede", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Texture/ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ee33398c-ed8e-4028-a5f7-d05c3359277b", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/animate.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6644b7ec-f506-4455-808d-cb438a204f5f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/maps/map2.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "83ff2d4b-19f4-4354-9be5-00337106d10d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "faf59e61-c5a3-4c13-9fa9-5d85b219720d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Texture/tank.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7fd82355-b4f4-402b-b7cf-cb68d42c806e", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/joystick.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c30cdb2c-539e-4061-8271-35297bf7e22d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "873a439c-5315-468c-ac3b-5d5f163d5106", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/base.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2b765bce-487c-48d2-9092-77c0f074e1c7", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "80c3b2ca-b829-4476-a9b0-5bdf846344fd", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/cover.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "e71e1120-1585-44b7-b89c-6cb73b517806", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/game.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8b0f1dd2-72ef-4895-a7e0-d64d159c9ef3", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/lobby.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8393fcaa-a4d2-4671-af35-a99bfbedab5c", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/tank.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "72041173-bbc3-4bce-949c-cba710e0db7d", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/helloworld.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/base/BaseBullet.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3bae7b3f-fb7a-4396-944a-a411fba5d841", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/base/NailTank.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "01e579ef-cdea-4364-a89c-4e8af36f6f23", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/HeavyTankA.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "e88b447e-9984-4ce7-86e9-af7ecaaa4c4e", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/HeavyTankB.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7565fd47-5bdc-4be5-90cf-15191ac27ae9", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/HeavyTankC.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "5fcf7d5f-00ee-4953-9e45-43eff167ee96", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/MidTankA.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6bddf693-18da-437b-95f1-6c7295aaed5c", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/MidTankB.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "0ff98629-6dd4-4c4d-95e4-91cd74a671e2", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/MidTankC.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ca54f60f-db00-4b7f-9068-6853809119cf", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/SmallTankA.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "64562d62-1723-4698-9810-4bfae2ec6c0d", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/SmallTankB.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d822ba16-4bb0-44eb-9ff8-73d32c0570ef", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/SmallTankC.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3715de79-f4eb-4f27-99ce-a52b19e5d537", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Script/Cover.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "4f34bcfc-c3d8-4f61-9ccd-c8df7cace511", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/bcx/bcx.min.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "365232b1-4f8c-4da9-8e73-458b565c2b67", 4 | "isPlugin": true, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/bcx/core.min.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "e9511d3d-16de-4473-b19e-e17e248c4e4c", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/EventCenter.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "c4f7842c-4edd-4784-9781-ff3c305fab7b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/GameMain.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "65f835a6-dbe7-400f-9da7-d620eed432bf", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/HelloWorld.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 | } -------------------------------------------------------------------------------- /assets/Script/socket.io.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "fdd7a4fd-1508-4db3-8ada-38334dac28fc", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/bcx/plugins.min.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "f2c1b3f5-a77e-498a-b0b3-50da6f5b1783", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/widget/joystick/ring.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "4958d707-075f-4fcd-a0a9-1e0a25227ce2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/widget/tank/base/Bullet.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "773b169a-6c09-4355-b68c-1ae6abb7f44d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/widget/tank/base/BaseBullet.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "bda69b5c-19d0-43ac-b24e-7612452119e8", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/widget/tank/base/NailTank.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "94ee8408-45ce-4d24-8d71-83850e915141", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/widget/tank/tank/BaseTank.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "73d27e68-662d-41e4-9dcf-54af64bfe165", 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 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Using a compact OS 2 | FROM daocloud.io/nginx:1.11-alpine 3 | 4 | MAINTAINER Golfen Guo 5 | 6 | # Add 2048 stuff into Nginx server 7 | 8 | COPY ./build/web-mobile/ /usr/share/nginx/html/ 9 | #COPY nginx.conf /etc/nginx/nginx.conf 10 | 11 | 12 | EXPOSE 80 13 | 14 | # Start Nginx and keep it running background and start php 15 | CMD sed -i "s/ContainerID: /ContainerID: "$(hostname)"/g" /usr/share/nginx/html/index.html && nginx -g "daemon off;" 16 | -------------------------------------------------------------------------------- /assets/Script/HelloWorld.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | label: { 6 | default: null, 7 | type: cc.Label 8 | }, 9 | // defaults, set visually when attaching this script to the Canvas 10 | text: 'Hello, World!' 11 | }, 12 | 13 | // use this for initialization 14 | onLoad: function () { 15 | this.label.string = this.text; 16 | }, 17 | 18 | // called every frame 19 | update: function (dt) { 20 | 21 | }, 22 | }); 23 | -------------------------------------------------------------------------------- /assets/animate/aimBoom.anim: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.AnimationClip", 3 | "_name": "aimBoom", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_duration": 0.016666666666666666, 7 | "sample": 60, 8 | "speed": 1, 9 | "wrapMode": 1, 10 | "curveData": { 11 | "comps": { 12 | "cc.Sprite": { 13 | "spriteFrame": [ 14 | { 15 | "frame": 0, 16 | "value": { 17 | "__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061" 18 | } 19 | } 20 | ] 21 | } 22 | } 23 | }, 24 | "events": [] 25 | } -------------------------------------------------------------------------------- /assets/Texture/bian.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "83f56723-e1df-4486-90ea-bd5cfb32814b", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "bian": { 10 | "ver": "1.0.3", 11 | "uuid": "c03084cc-2ce2-4800-8fdb-48db8f758fb5", 12 | "rawTextureUuid": "83f56723-e1df-4486-90ea-bd5cfb32814b", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 200, 21 | "height": 200, 22 | "rawWidth": 200, 23 | "rawHeight": 200, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/cocos.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "c3c9bc19-ccb5-4398-9765-a03f8796ce76", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "cocos": { 10 | "ver": "1.0.3", 11 | "uuid": "ed2de6b6-c65b-4dda-a4d2-ba023779a1c4", 12 | "rawTextureUuid": "c3c9bc19-ccb5-4398-9765-a03f8796ce76", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": -2.5, 17 | "offsetY": 0, 18 | "trimX": 14, 19 | "trimY": 0, 20 | "width": 167, 21 | "height": 200, 22 | "rawWidth": 200, 23 | "rawHeight": 200, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/singleColor.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "singleColor": { 10 | "ver": "1.0.3", 11 | "uuid": "410fb916-8721-4663-bab8-34397391ace7", 12 | "rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 2, 21 | "height": 2, 22 | "rawWidth": 2, 23 | "rawHeight": 2, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/tank/tank.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "bcb1b53c-22b3-44b4-941a-623fb091f2cb", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "tank": { 10 | "ver": "1.0.3", 11 | "uuid": "9969413b-54ca-44ee-9148-6b3202aa9519", 12 | "rawTextureUuid": "bcb1b53c-22b3-44b4-941a-623fb091f2cb", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 1, 19 | "trimY": 0, 20 | "width": 1020, 21 | "height": 813, 22 | "rawWidth": 1022, 23 | "rawHeight": 813, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/widget/joystick/dot.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "84be9197-437d-4915-804f-7ff84bb4dab7", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "dot": { 10 | "ver": "1.0.3", 11 | "uuid": "e0f837eb-f41f-421a-8e32-128cb85039a6", 12 | "rawTextureUuid": "84be9197-437d-4915-804f-7ff84bb4dab7", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 176, 21 | "height": 176, 22 | "rawWidth": 176, 23 | "rawHeight": 176, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/widget/joystick/ring.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "451a680b-74c1-4134-a448-83000de25f2c", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "ring": { 10 | "ver": "1.0.3", 11 | "uuid": "b46b8733-20c7-4fd2-ace3-3dfa8ba0f67d", 12 | "rawTextureUuid": "451a680b-74c1-4134-a448-83000de25f2c", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 327, 21 | "height": 327, 22 | "rawWidth": 327, 23 | "rawHeight": 327, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/HelloWorld.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "HelloWorld": { 10 | "ver": "1.0.3", 11 | "uuid": "31bc895a-c003-4566-a9f3-2e54ae1c17dc", 12 | "rawTextureUuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 195, 21 | "height": 270, 22 | "rawWidth": 195, 23 | "rawHeight": 270, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/ui/TextInput.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "b38969e7-2483-4f48-8249-b942bdb63f62", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "TextInput": { 10 | "ver": "1.0.3", 11 | "uuid": "2d4e648f-4bec-4d14-bdea-1250631c2253", 12 | "rawTextureUuid": "b38969e7-2483-4f48-8249-b942bdb63f62", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 74, 21 | "height": 74, 22 | "rawWidth": 74, 23 | "rawHeight": 74, 24 | "borderTop": 15, 25 | "borderBottom": 25, 26 | "borderLeft": 19, 27 | "borderRight": 19, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/ui/uipack.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "9c2449e6-8f34-4f20-ba24-3d1c3284ef22", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "uipack": { 10 | "ver": "1.0.3", 11 | "uuid": "d6134ffb-44f4-41f6-88f6-8a0641c99e62", 12 | "rawTextureUuid": "9c2449e6-8f34-4f20-ba24-3d1c3284ef22", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0.5, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 2042, 21 | "height": 2045, 22 | "rawWidth": 2042, 23 | "rawHeight": 2046, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/maps/map2/sci_atlas.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "99539d46-9883-473f-bd0e-dec371adbeaa", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "sci_atlas": { 10 | "ver": "1.0.3", 11 | "uuid": "63dc7797-3bc0-409a-8c78-6092589f705f", 12 | "rawTextureUuid": "99539d46-9883-473f-bd0e-dec371adbeaa", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 512, 21 | "height": 512, 22 | "rawWidth": 512, 23 | "rawHeight": 512, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/tank/aimboom.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "812346d4-9cec-473f-b72d-26136ce76a28", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "aimboom": { 10 | "ver": "1.0.3", 11 | "uuid": "4527c6b2-2be6-49f7-bc4e-1b1241c627d1", 12 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": -1, 17 | "offsetY": 176.5, 18 | "trimX": 2, 19 | "trimY": 3, 20 | "width": 506, 21 | "height": 665, 22 | "rawWidth": 512, 23 | "rawHeight": 1024, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/ui/common_bg.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "43e75520-16aa-4f55-b910-bb445a01aed6", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "common_bg": { 10 | "ver": "1.0.3", 11 | "uuid": "5ee08e23-10cc-4d6d-bb5f-30b19d1d9a26", 12 | "rawTextureUuid": "43e75520-16aa-4f55-b910-bb445a01aed6", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 1920, 21 | "height": 1080, 22 | "rawWidth": 1920, 23 | "rawHeight": 1080, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/widget/joystick/joystickdot.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "d9a79545-ed36-4937-956a-1746ead58de1", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "joystickdot": { 10 | "ver": "1.0.3", 11 | "uuid": "3f4f94ee-5374-4e61-94bd-106202398c07", 12 | "rawTextureUuid": "d9a79545-ed36-4937-956a-1746ead58de1", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 73, 21 | "height": 78, 22 | "rawWidth": 73, 23 | "rawHeight": 78, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/Cocos2d-html5.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "b87f3abb-dc18-4d51-9331-a1b745a313bd", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "Cocos2d-html5": { 10 | "ver": "1.0.3", 11 | "uuid": "30fd5b65-0fa7-49f6-97fe-3c7aa7af29c3", 12 | "rawTextureUuid": "b87f3abb-dc18-4d51-9331-a1b745a313bd", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 3, 17 | "offsetY": -0.5, 18 | "trimX": 24, 19 | "trimY": 3, 20 | "width": 158, 21 | "height": 195, 22 | "rawWidth": 200, 23 | "rawHeight": 200, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/ui/stage_title.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "7d37053a-dbd1-44c0-9fc7-4989f986537c", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "stage_title": { 10 | "ver": "1.0.3", 11 | "uuid": "514d5d17-a738-45f1-9dcd-65c328807a6e", 12 | "rawTextureUuid": "7d37053a-dbd1-44c0-9fc7-4989f986537c", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 694, 21 | "height": 324, 22 | "rawWidth": 694, 23 | "rawHeight": 324, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 347, 27 | "borderRight": 347, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/widget/joystick/joystickring.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "73af1b9d-4c6b-40aa-ba2d-b4550c883d63", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "joystickring": { 10 | "ver": "1.0.3", 11 | "uuid": "ffa29a8d-0cac-46af-86bb-fc06b413a1a9", 12 | "rawTextureUuid": "73af1b9d-4c6b-40aa-ba2d-b4550c883d63", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 103, 21 | "height": 103, 22 | "rawWidth": 103, 23 | "rawHeight": 103, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets-sort-type": "name", 3 | "collision-matrix": [ 4 | [ 5 | true 6 | ] 7 | ], 8 | "design-resolution-height": 640, 9 | "design-resolution-width": 960, 10 | "excluded-modules": [ 11 | "Geom Utils", 12 | "3D", 13 | "3D Primitive" 14 | ], 15 | "facebook": { 16 | "appID": "", 17 | "audience": { 18 | "enable": false 19 | }, 20 | "enable": false, 21 | "live": { 22 | "enable": false 23 | } 24 | }, 25 | "fit-height": false, 26 | "fit-width": true, 27 | "group-list": [ 28 | "default" 29 | ], 30 | "last-module-event-record-time": 1563465048256, 31 | "simulator-orientation": false, 32 | "simulator-resolution": { 33 | "height": 640, 34 | "width": 960 35 | }, 36 | "start-scene": "e71e1120-1585-44b7-b89c-6cb73b517806", 37 | "use-customize-simulator": true, 38 | "use-project-simulator-setting": false 39 | } -------------------------------------------------------------------------------- /settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "android-instant": { 3 | "REMOTE_SERVER_ROOT": "", 4 | "host": "", 5 | "pathPattern": "", 6 | "recordPath": "", 7 | "scheme": "https", 8 | "skipRecord": false 9 | }, 10 | "appBundle": false, 11 | "baidugame": { 12 | "REMOTE_SERVER_ROOT": "", 13 | "appid": "testappid", 14 | "orientation": "portrait", 15 | "subContext": "" 16 | }, 17 | "encryptJs": true, 18 | "excludeScenes": [ 19 | "2d2f792f-a40c-49bb-a189-ed176a246e49", 20 | "8393fcaa-a4d2-4671-af35-a99bfbedab5c", 21 | "72041173-bbc3-4bce-949c-cba710e0db7d" 22 | ], 23 | "fb-instant-games": {}, 24 | "includeSDKBox": false, 25 | "inlineSpriteFrames": true, 26 | "inlineSpriteFrames_native": true, 27 | "md5Cache": true, 28 | "mergeStartScene": false, 29 | "optimizeHotUpdate": false, 30 | "orientation": { 31 | "landscapeLeft": true, 32 | "landscapeRight": true, 33 | "portrait": false, 34 | "upsideDown": false 35 | }, 36 | "packageName": "org.cocos2d.cocostank", 37 | "qqplay": { 38 | "REMOTE_SERVER_ROOT": "", 39 | "orientation": "portrait", 40 | "zip": false 41 | }, 42 | "startScene": "e71e1120-1585-44b7-b89c-6cb73b517806", 43 | "title": "cocostank", 44 | "webOrientation": "landscape", 45 | "wechatgame": { 46 | "REMOTE_SERVER_ROOT": "", 47 | "appid": "wx6ac3f5090a6b99c5", 48 | "orientation": "portrait", 49 | "subContext": "" 50 | }, 51 | "xxteaKey": "0db57b42-695b-4c", 52 | "zipCompressJs": true 53 | } -------------------------------------------------------------------------------- /assets/widget/tank/base/Bullet.js: -------------------------------------------------------------------------------- 1 | // Learn cc.Class: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html 3 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | cc.Class({ 12 | extends: cc.Component, 13 | 14 | properties: { 15 | bulletNode: { 16 | default: null, 17 | type: cc.Node, 18 | displayName: '子弹node', 19 | }, 20 | tailNode: { 21 | default: null, 22 | type: cc.Node, 23 | displayName: '尾部粒子', 24 | }, 25 | }, 26 | 27 | start () { 28 | 29 | }, 30 | setBulletState(state){ 31 | if(this.bulletNode&&this.tailNode){ 32 | if(state=='idle'){ 33 | this.bulletNode.active=true; 34 | this.tailNode.active=false; 35 | }else if(state=='boom'){ 36 | this.bulletNode.active=false; 37 | this.tailNode.active=true; 38 | } 39 | } 40 | }, 41 | hide(){ 42 | if(this.bulletNode&&this.tailNode){ 43 | this.bulletNode.active=false; 44 | this.tailNode.active=false; 45 | } 46 | }, 47 | onDestroy(){ 48 | console.log("destroy"); 49 | }, 50 | 51 | // update (dt) {}, 52 | }); 53 | -------------------------------------------------------------------------------- /.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/ -------------------------------------------------------------------------------- /assets/widget/tank/base/NailTank.js: -------------------------------------------------------------------------------- 1 | // Learn cc.Class: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html 3 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | cc.Class({ 12 | extends: cc.Component, 13 | 14 | properties: { 15 | rootNode: { 16 | default: null, 17 | type: cc.Node, 18 | displayName: '根node', 19 | }, 20 | enemy: { 21 | default: null, 22 | type: cc.Sprite, 23 | displayName: 'enemy图片', 24 | }, 25 | me: { 26 | default: null, 27 | type: cc.Sprite, 28 | displayName: 'me图片', 29 | }, 30 | }, 31 | 32 | // LIFE-CYCLE CALLBACKS: 33 | 34 | // onLoad () {}, 35 | 36 | start () { 37 | 38 | }, 39 | 40 | setNailType(type){ 41 | if(type=="me"){ 42 | this.enemy.node.active=false; 43 | this.me.node.active=true; 44 | }else if(type=="enemy"){ 45 | this.enemy.node.active=true; 46 | this.me.node.active=false; 47 | } 48 | }, 49 | setPos(x,y){ 50 | this.rootNode.setPosition(x,y); 51 | }, 52 | getPos(){ 53 | return this.rootNode.position; 54 | }, 55 | setAngle(a){ 56 | this.rootNode.rotation=a; 57 | }, 58 | getAngle(){ 59 | return this.rootNode.rotation; 60 | }, 61 | // update (dt) {}, 62 | }); 63 | -------------------------------------------------------------------------------- /assets/Script/EventCenter.js: -------------------------------------------------------------------------------- 1 | // Learn cc.Class: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html 3 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | const io = require('./socket.io'); 11 | const bcxConfig = { 12 | default_ws_node: "ws://47.93.62.96:8049", 13 | ws_node_list: [{ 14 | url: "ws://39.106.126.54:8049", 15 | name: "COCOS3.0节点2" 16 | }, 17 | { 18 | url: "ws://47.93.62.96:8049", 19 | name: "COCOS3.0节点1" 20 | } 21 | ], 22 | networks: [{ 23 | core_asset: "COCOS", 24 | chain_id: "7d89b84f22af0b150780a2b121aa6c715b19261c8b7fe0fda3a564574ed7d3e9" 25 | }], 26 | faucet_url: "http://47.93.62.96:8041", 27 | auto_reconnect: true, 28 | check_cached_nodes_data: false 29 | }; 30 | 31 | 32 | cc.Class({ 33 | extends: cc.Component, 34 | 35 | properties: { 36 | 37 | }, 38 | 39 | // LIFE-CYCLE CALLBACKS: 40 | 41 | onLoad() { 42 | cc.game.addPersistRootNode(this.node); 43 | 44 | 45 | const bcx = new BCX(bcxConfig); 46 | bcx.init().then(res=>{ 47 | if (1 != res.code) { 48 | console.log("ERR, BCX connect failed:" + res.code); 49 | } else { 50 | console.log("SUC, BCX connected"); 51 | } 52 | }); 53 | 54 | // var mySocket = io.connect('http://localhost:10800'); 55 | 56 | var mySocket = io.connect('http://sh.suishizhuan.com:10800'); 57 | 58 | window.mySocket = mySocket; 59 | mySocket.on('connect', function () { 60 | cc.director.emit('socketConnect', "connect"); 61 | console.log("连接成功"); 62 | }); 63 | mySocket.on('disconnect', function () { 64 | cc.director.emit('socketConnect', "disconnect"); 65 | console.log("连接断开"); 66 | mySocket.open(); 67 | }); 68 | 69 | 70 | }, 71 | 72 | start() { 73 | 74 | }, 75 | 76 | // update (dt) {}, 77 | }); -------------------------------------------------------------------------------- /assets/animate/my.anim: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.AnimationClip", 3 | "_name": "my", 4 | "_objFlags": 0, 5 | "_native": "", 6 | "_duration": 1.15, 7 | "sample": 20, 8 | "speed": 1, 9 | "wrapMode": "22", 10 | "curveData": { 11 | "comps": { 12 | "cc.Sprite": { 13 | "spriteFrame": [ 14 | { 15 | "frame": 0, 16 | "value": { 17 | "__uuid__": "743e5a54-ee2e-4a90-a4e6-0dd650e11dea" 18 | } 19 | }, 20 | { 21 | "frame": 0.1, 22 | "value": { 23 | "__uuid__": "d205a391-0434-4620-898d-19d515b79083" 24 | } 25 | }, 26 | { 27 | "frame": 0.2, 28 | "value": { 29 | "__uuid__": "1611f5f0-ac01-40fb-9169-afdf72b672e5" 30 | } 31 | }, 32 | { 33 | "frame": 0.3, 34 | "value": { 35 | "__uuid__": "1c46ac97-957e-4d59-bcfc-deba7c621b70" 36 | } 37 | }, 38 | { 39 | "frame": 0.4, 40 | "value": { 41 | "__uuid__": "5f7f4941-6bde-4dac-ba8c-6fe0fc57efae" 42 | } 43 | }, 44 | { 45 | "frame": 0.5, 46 | "value": { 47 | "__uuid__": "277e000b-655d-4def-bb46-69b2bed8c13e" 48 | } 49 | }, 50 | { 51 | "frame": 0.6, 52 | "value": { 53 | "__uuid__": "3d8b5234-bdaa-43d6-8a70-c89daa5e7314" 54 | } 55 | }, 56 | { 57 | "frame": 0.7, 58 | "value": { 59 | "__uuid__": "984f0948-d2cd-4ad1-ad36-88f10d33dc74" 60 | } 61 | }, 62 | { 63 | "frame": 0.8, 64 | "value": { 65 | "__uuid__": "f8de7470-00f3-4512-8633-644c10060158" 66 | } 67 | }, 68 | { 69 | "frame": 0.9, 70 | "value": { 71 | "__uuid__": "34e7f743-9fe6-4a0c-91de-9b89065a185c" 72 | } 73 | }, 74 | { 75 | "frame": 1, 76 | "value": { 77 | "__uuid__": "ce531f35-6c0b-404e-8126-78928c924b76" 78 | } 79 | }, 80 | { 81 | "frame": 1.1, 82 | "value": { 83 | "__uuid__": "bdd73099-0385-48cb-a253-a0ab01617c0d" 84 | } 85 | } 86 | ] 87 | } 88 | } 89 | }, 90 | "events": [] 91 | } -------------------------------------------------------------------------------- /assets/maps/map2/map2.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | eJyN11uS2zAMRFHty3pw/6tKPgZVR3foVD5cskQRBBpAo/Ucx3H//X24Xn9/J89Ofou15+e6fvZ8WJ935z3v5537Z+36+T28O78r6/o19mZtbE8cD2ecrNXvsTN7Zp97L54vbIyfT2zr/4ndh7Mu1ge/m/UPz8X+Pn7HeONjsWzcs+eMvZVzxF0szO+12WdexO46ftfYfbx9OHln5RzxtDY/x7u2xPrkemNrfLl5x7yt411vz/E7h83ZFVvFoD3zHPt4ip++20/Nmb/WqzYnhv5f+HBt7HzyzDgXe8aONVru0Kdd37V/xqY53cUlfuZbXMYHa3N8a/zWYfEyjtZKa0Hb5bn2rTlzfceJJ3utkcVzYxwcB3d9vo83zvJO+9/esw/EpWfrd+u7fVOuvY43zk/2G0t521p2VuibNfdwlvZuzilPdUZZD+Wqz/GOV3/Ko/Lrrg52dsyL+XjybOpwxW5x3HGd8XS23/kv5ruZLk882JJjisVir5zhuWNHXPVPjFub9uyzsV/fxHYdb3/lws6ccqOz1tkvdvbktxo2BudrZ/Kc9eS+ud3VqHPXGNvDO/udAeahNeb1ylr5aGw+2eeZ+ma+XWvu593Jk/O3degMufLOFXv2WWduc+RMUj+Z03l3bfCTN7/pcv1sbOaxs/DO/8U5g1l5oBpBH3acKTaLe2MzJ3Otrlj5L2dM7NfxPt/aNi+dgXLYt3h3s6P6oBp0HW8frGnxEc+5nzPEdnIiB9q39lZ5rDXn+hO7Yqb2El/x2NWZdV8+K//u6l+udr4Y64dz5nfleTFszVVD/4vv9FW8FmfsamQR///oUf1yvba0Oc/VUPZovynaE+apvewc8fwVm9q5Y796obW2suYc7f2uj/Svmtj6k4u+6Ql9rZZWAz15r5w6MZWjGnu5wTzvelv/7s1Vm3fslfv0cR3vupIvi8tnY0ffqrva99UencHVQ5MjeVqfPXPu239yhbz48G5xFpueW5/c41o1+K5nu9YZuONR+fPMffVF9fL4L+/Kq9UJ3+anuOmrurxaTyz0xXoqN56xpSbTpmfPvrlaD/2W0dd1vM/d6WD/2/diOH5VI3TuT+zyUueEnGF+7RGxEINivJtzPbv+mpfqt+I1Z+60ohxgPcxeZ9X4KhYLW+V03xcX63bl3l4tv/QboRq8OFqX8k3Pr4br1V4sB8u13SeenWfW8U7b6Kf10hlkzcpD9n/nnT52ro4d8awGMKYdP67jHZc50b6aq5pmbNSPzj332TfiLx7i2lljbK1De1xMOwvtqXNjt7HaI4ur/GpP25trc559Yj7EVh+q26ur9PuOPetWzNbxrrlqil0fWj99v2vV6n2v3xzWfmNWP1if7mtdLc5Z2OnMcv3Jvt3MV7dUD5a/z81+sbNvW/ed3et45621ucPHXDRe3z+P3zmyDhfPi/OzsdOZIx9oq7whp+2wqrYtL8u71Wa+7/dR547z0Xxex+8zyxWTn/aR+Zv/1Vu7flrH28dvc9e+2/FXtXDjsv/7XeKeatvOAnHa9f1OK6zjXW9ztnPTObE7q7Vl3O3j8kW1gHE7T4q5mJZTtSHug4vnyiPWQXWHGrJaUs5vrVp/O33QfjOObzmrP3PWnWfV19aLNWe/OvN6vnFWQ4/N9ld9UBPUlx3Pnpv/5lJ+EZfmatbvzb6xeWa/vb+wVcyc9zuu+9bb8sqZd9o7zfX8ioPfYdUFjUFekfuqN/p9op/reNfIyh5jaR9Xp6tNiku1vNfB1BzMmn3a+mj+rEux2HG02LtvYlNj/UtL9Pvk2wwXQzVzNdydM+7YX7lXa7X2Fs87H/TJGSce+iLenVHF0vPX8a43Y7Q+Tp7VD/Ox0w9zjr3xid1qvZ1O6txqXXn2Hy2DWQA= 9 | 10 | 11 | 12 | 13 | eJztmssOgyAQRWfVR/puf6Hppumuten//1ghSjpBRAZGOqI3uRsGCUcBB7QCgKoQf4CmN7H+kNJ9NxxUSeLQksSR0qYkjhSVzPF2WLpin4c0zRyyFMMhcb50cfTNcWksKeOKm4XaHq4/5fkhUTOHLM0cbR2VDw6femIc4uRYK7+Ur8o35E0Tu1mumhiHuDmeygvlJfJF+WyVraBe/yVzhPRN183JQXnHDs3h60vpHDF7QjMHLlb5B9rnSl11u/oA0O4DjnM+D7227qC9lro4uur6NOVxFSPJ6xVFpXFsoR77xiYvwWV7yMMRs9czeckD+Q6/vORuxXLkJTEcdu7hy0twjEOcHP/UWPYfffdVKofr3e3TzDGsxs7hyk9DctVcHClnhSHXT4XDdz3lDDuVo09SOagqmWNsOYkWhYOLj9JOaF3Mkesb1NAcKW1S+xZyzyjf7qW9z21ROaj/LUkS/m+pBH8BG7JLIg== 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /assets/widget/tank/base/BaseBullet.js: -------------------------------------------------------------------------------- 1 | // Learn cc.Class: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html 3 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | const Bullet = require('./Bullet'); 11 | 12 | cc.Class({ 13 | extends: cc.Component, 14 | 15 | properties: { 16 | rootNode: { 17 | default: null, 18 | type: cc.Node, 19 | displayName: '根node', 20 | }, 21 | bulletComponent: { 22 | default: null, 23 | type: Bullet, 24 | displayName: 'bulletComponent', 25 | }, 26 | sm: { 27 | default: null, 28 | type: Bullet, 29 | displayName: 'sm', 30 | }, 31 | md: { 32 | default: null, 33 | type: Bullet, 34 | displayName: 'md', 35 | }, 36 | hv: { 37 | default: null, 38 | type: Bullet, 39 | displayName: 'hv', 40 | }, 41 | ls: { 42 | default: null, 43 | type: Bullet, 44 | displayName: 'ls', 45 | }, 46 | pz: { 47 | default: null, 48 | type: Bullet, 49 | displayName: 'pz', 50 | }, 51 | rk: { 52 | default: null, 53 | type: Bullet, 54 | displayName: 'rk', 55 | }, 56 | 57 | }, 58 | 59 | start () { 60 | 61 | }, 62 | setSkin(skin){ 63 | if(skin=='sm'){ 64 | this.bulletComponent=this.sm; 65 | } 66 | if(skin=='md'){ 67 | this.bulletComponent=this.md; 68 | } 69 | if(skin=='hv'){ 70 | this.bulletComponent=this.hv; 71 | } 72 | if(skin=='ls'){ 73 | this.bulletComponent=this.ls; 74 | } 75 | if(skin=='pz'){ 76 | this.bulletComponent=this.pz; 77 | } 78 | if(skin=='rk'){ 79 | this.bulletComponent=this.rk; 80 | } 81 | if(this.bulletComponent==null){ 82 | this.bulletComponent=this.sm; 83 | } 84 | this.bulletComponent.node.active=true; 85 | }, 86 | setPos(x,y){ 87 | if(this.rootNode){ 88 | this.rootNode.setPosition(x,y); 89 | } 90 | }, 91 | setAngle(a){ 92 | if(this.rootNode){ 93 | this.rootNode.rotation=a; 94 | } 95 | }, 96 | setBulletState(state){ 97 | if(this.bulletComponent){ 98 | this.bulletComponent.setBulletState(state); 99 | } 100 | }, 101 | hide(){ 102 | if(this.bulletComponent){ 103 | this.bulletComponent.node.active=false; 104 | this.bulletComponent.hide(); 105 | this.bulletComponent=null; 106 | } 107 | }, 108 | onDestroy(){ 109 | console.log("destroy"); 110 | }, 111 | 112 | // update (dt) {}, 113 | }); 114 | -------------------------------------------------------------------------------- /assets/widget/tank/tank/BaseTank.js: -------------------------------------------------------------------------------- 1 | // Learn cc.Class: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html 3 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | cc.Class({ 12 | extends: cc.Component, 13 | 14 | properties: { 15 | rootNode: { 16 | default: null, 17 | type: cc.Node, 18 | displayName: '根node', 19 | }, 20 | tankNode: { 21 | default: null, 22 | type: cc.Node, 23 | displayName: '坦克节点', 24 | }, 25 | tankHp: { 26 | default: null, 27 | type: cc.ProgressBar, 28 | displayName: '坦克生命值', 29 | }, 30 | light: { 31 | default: null, 32 | type: cc.Sprite, 33 | displayName: '坦克底部光颜色', 34 | }, 35 | userNameTxt: { 36 | default: null, 37 | type: cc.Label, 38 | displayName: '玩家名称', 39 | }, 40 | gridInfoTxt: { 41 | default: null, 42 | type: cc.Label, 43 | displayName: 'gridInfo', 44 | }, 45 | tower: { 46 | default: null, 47 | type: cc.Node, 48 | displayName: '炮塔', 49 | } 50 | }, 51 | 52 | onLoad () { 53 | var that=this; 54 | that.light.node.on(cc.Node.EventType.TOUCH_START, that._touchStartEvent, that); 55 | that.light.node.on(cc.Node.EventType.TOUCH_END, that._touchEndEvent, that); 56 | }, 57 | 58 | start () { 59 | 60 | }, 61 | 62 | _touchStartEvent: function (event) { 63 | event.stopPropagation(); 64 | return false; 65 | }, 66 | 67 | _touchEndEvent(event){ 68 | event.stopPropagation(); 69 | cc.director.emit("aimTank",this); 70 | }, 71 | 72 | setPos(x,y){ 73 | if(this.rootNode){ 74 | this.rootNode.setPosition(x,y); 75 | } 76 | }, 77 | getPos(){ 78 | if(this.rootNode){ 79 | return this.rootNode.position; 80 | } 81 | return null; 82 | }, 83 | setAngle(a){ 84 | if(this.tankNode){ 85 | this.tankNode.rotation=a; 86 | } 87 | }, 88 | getAngle(){ 89 | if(this.tankNode){ 90 | return this.tankNode.rotation; 91 | } 92 | return null; 93 | }, 94 | 95 | setTowerAngle(a){ 96 | if(this.tower){ 97 | this.tower.rotation=a; 98 | } 99 | }, 100 | 101 | getTowerAngle(){ 102 | if(this.tower){ 103 | return this.tower.rotation; 104 | } 105 | return null; 106 | }, 107 | 108 | setGridInfo(gx,gy){ 109 | if(this.gridInfoTxt!=null&&gx!=null&&gy!=null){ 110 | this.gridInfoTxt.string=gx+","+gy; 111 | } 112 | }, 113 | 114 | setUserName(userName){ 115 | if(this.userNameTxt){ 116 | this.userNameTxt.node.active=true; 117 | this.userNameTxt.string=userName; 118 | } 119 | }, 120 | getUserName(){ 121 | return this.userNameTxt.string; 122 | }, 123 | 124 | setHp(hp){ 125 | if(this.tankHp){ 126 | this.tankHp.progress=hp; 127 | } 128 | }, 129 | 130 | setBackColor(color){ 131 | if(this.light){ 132 | this.light.node.color=color; 133 | } 134 | }, 135 | }); 136 | -------------------------------------------------------------------------------- /assets/maps/map2/map1.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | eJx911uO6zoMRFHNy3Gi+Y/qngs0geUddX8YcWyJ4qNYLF9rrc+/6/Vzvf9d+991/zzfP8///3/9PHtzf/38v39+592dd2N79r9Yv9n3wrZ7Przb2N68+2Bjs87f8fNmn77f7L8Td+M1xg9njF+btXs9/btZs/N+8j6+fLje+T8xdP07z6yL+/SlufG8sXcl96cczLsX/+uPONr8f3NGMXCxf97f6+nb5PK1njHOM+vrHuMS55OHzfvx6V7fuNqxc/9ia2K+1/P8az1jPuFs9t+sn2fj3xUbcz/56PM5++Z+fBy7xnBznc6Y/WLstZ5x7pzhnpNvp/f3euJOrpr/2rfv2wPv9cTLhzPM76nnjE1ce+7YtL9PPS3n2Lva14dZMz5Yf3Mst8hpxWQx+IndYkBOu3KWPrxyb08b6/gnH4sxz6rN5qFYKbdNHebMTb5rx1rMus4F/W5Pd8/4dsJDZ065yz3yUDFw8yuO9nr6LdadhXt957L8O3HZAzfr9/rGTWeIvKQf6oW9njkTF8WIuRIzxcEmF8WDOZNnTn3nM/NdrOq39ZBj7N9yin05eZ0Yq0N83vktv8yZYkt+/y2GztLmtf6etKHzVB5tbPZTtV57wNrs7Jm1Gxv6JB9WYxnPtZ75ab3G7/a9GLRnxueedWevPstj1R/ViPa8uay2EGcv7LWvTrNk7Bcjez2xtdczZ55jf504y/PMbf0y5hOXOPvN96zX3glfxauacMf+zvvOzYnJXrAmxu/+6uordjvbf/vGkXvta+e4OrCcVJ0htvf6xoK5s+/qp/NFfm597e3rsNeZoY362Xw2N841c2z+jbcaTq1XrTTnFx+ufWW/XCYm2usnjLUWO2uu2LZvxX373WfF1cZO54Gc1Lm8s674nbVi1z6qRvS+Of2rz8pZxjy+lhPtkc55c18sVi9Vf4k9c3XSafd69sOsLa87d6uvpi/s9c6RnfvOkNfBprw4+XKeXXlWvdE6lPus2WbN+KeWkj/u9fStnCI3lyuNu7kuJ540gPaLy3lnrMZ+6jU1YGei6+TVk3bb6zu/1y+2T/eNr9rUPpOz5Vv5/fXL2up3MXKaqSdNsmPHddWu9rm1nr3Wo99W3s8aeWnOcxao68RqZ9Dp+2XOPM37Oc+YivnOi87hvZ61fx3+t7fNu/zfXHUOqoeN+XPY15iay1NfyG32urOl2Gj/qpU823VzluvbV82PsbwO986fYmavZw4923nTHu4Zas6JRX5wVk3dzW/n2Em3utY8e5780jjsTeehvhurv57Zedh51XlaLdO+PuWs3x3OJTn4NA/E1qnnywebM16Hte3N09z0fP00P+U+ca3f6tLqcOuhXjrp93K+MYjjHTvmsb0tLs1VNVV11p29s+7Eb96L4erhv3RY56SxzZ72W3WI1+xT38iJ1tNai2NrvNd3/sW1HFWsWtfqj/FRfz1jZ197t3xmXuyV6kNt7fWsoTnrTBLr8uFe3zmq9irnWU/nqDXQP7n1yt7ipRq4Z9ivjUvu2ut5pnE0tvqrb9bmxIXitrrYvi7nnuL9HM45zVkx2Hm91zcWzZe5r56u7jrpGjFsLsoX8oM18Mxi5XO49nr62LxMLMVm5+TYeWWd+5rvzryJzdzrd33rbOm7zjw53rq2H+UF/fQqN554vhx80o6/fevY7+rC4tO5VI61h9u7Jz0vbuad+S33a0vtpd97PXvGXt2pQ2MwP8ZffhGnp28C9YTapXqxtfOMcovx2Xf6f8eOs6Xacq9nvgYnJ76zbvVjx6bYFWOf9Yy7urjY6TeAOVAH7+zTjjXqPOw3h7rHuotDc2Oe5RW1a3tdjptcFCedz+11MSFON7/2cs+6Dza01ZzKxdWsxrZZW01iXYxrfC2P97uluTnNixMuOl/l7StnFdf6eNISrpOfzPk752yevdezVvLwaV7Iha1N+XDO115nc+sizv/q0yvr1XxqEftJ/q2mNxfVs+2dzrt+S6jfjVEOsjav2DD+zqJ31rR+zqnySeOfePTPM/d61r0cXh7ybHPRWe8cL17HH303X2qi8e8de81xufE63J/wUwyPX+3ZzhX5pfPAOu/1xHdrPf5Vk8kDp750Jrf21kOf5AlzY38Zz+TfWssXrm992zvav9d3TfXTc8v77dPa3vhy0omdzdVk5uc078zp/C8fttb2SHvNWjhT1It3bMtN2ikmJmcn3V3NPWurU2eNeZ54xPl7fefLuTnX9cc+cb15NzH0XbVW+Ub9M3s6Kxuvef7kDPMntjd77OHxyXz1uWd1tquPWqvrYN+Z9Mq61nnyZ+ydG9be3FhT19ozp2+RrnH2G5e1be9ObNaytS4f2XMnrm1OfotVnuxc7Bz/5Dpxt73f8/02mLiqgYrL8ooz0nlgXa3dicvFWWdgvwnEqZh6x175yOevnNVvH9eecikfqCVOemFyPrblVbm53FRNZ76dLcXyK7bUPfZvZ1T9LM+1ryZG+cDerg9iSoz9pZ/++v4aG+a98/W9vrHaHIkx4zDO4vk0Wz2zs2xyL4bMwZt19nP1tzxXjWmsnfGdQe2N5stZ59nlpddhTfWJtjsPf9MP6rTO/PKH8bqmfKM/J31Rvdj3+2Cnteu9vpi/asBPznBeVbeVB8tH9mA5xjk0a6xR59aJd4t1cTXr7oPtk37Q1+buWt9Y9t68Fg/6dR3OO/W1/ztjWov2lL6fOF0cW6f29Ck37XW1anVAa9AZL3d1TtTX8s5e37gsH1fr+K746XyUW7rO3HcWlnPE3m/arXryPjxvj/abafOumn7wudcTm+qH8tes7Tw7zSn3zL7xZ3P/ie2NjVlnjsxn54z4Penknauc8jrsad+NP/PMPjfHzp3qpWLeWWUeOnOrIYpF66df6kXxYE73+sbQxGoPqxVO+kA95yw9zY7u93211W9cJh9MDPLVzv7quvJ3Z5AxyTPqkObAnJ503dguZ8j94sU49U+fOn86FzZ7qhs6q5oT8eHc2+vZEyf/XSP+qtHaZ9VC1X+eYa92fsl98py9ute3VjbenavcPs+rQ96/2NT/eaaduYzHfP1//Qfqhtg2 9 | 10 | 11 | 12 | 13 | eJzt28kOgjAUheGuHOIsr2DYEHcO6fu/mG2EWGsRFijc2/9LTkxoY3oEQmPUmnzZsReASbFBtOnTzUavmvTplvv5R5rEz2zINefaX/I9I3ntAAAAAABItHfZJXLoGNNi6XJ1ObmUQVb1WBnlVo9p4TteXGYu8yCFyzE6tnC5G539+3Tyc+lPf039m3u8iI6nvp9tmyuZf8ZtzOczLdW/ba5kuV//9Ke/7782z3u7SbP/DY9tjc7+fv97DlKZ1/63isa07X/jPe63/W84BgAAAAAAfk/yb4iHXLvU/lN8r3+RuOaxSb7fu/D/t/fXtjk5n3/kJ+frwXd/AD3/GIc= 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /assets/Scene/lobby.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_parent": null, 15 | "_children": [ 16 | { 17 | "__id__": 2 18 | } 19 | ], 20 | "_active": true, 21 | "_level": 0, 22 | "_components": [], 23 | "_prefab": null, 24 | "_opacity": 255, 25 | "_color": { 26 | "__type__": "cc.Color", 27 | "r": 255, 28 | "g": 255, 29 | "b": 255, 30 | "a": 255 31 | }, 32 | "_contentSize": { 33 | "__type__": "cc.Size", 34 | "width": 0, 35 | "height": 0 36 | }, 37 | "_anchorPoint": { 38 | "__type__": "cc.Vec2", 39 | "x": 0, 40 | "y": 0 41 | }, 42 | "_scale": { 43 | "__type__": "cc.Vec3", 44 | "x": 0.490625, 45 | "y": 0.490625, 46 | "z": 1 47 | }, 48 | "_quat": { 49 | "__type__": "cc.Quat", 50 | "x": 0, 51 | "y": 0, 52 | "z": 0, 53 | "w": 1 54 | }, 55 | "_zIndex": 0, 56 | "groupIndex": 0, 57 | "autoReleaseAssets": false, 58 | "_id": "8393fcaa-a4d2-4671-af35-a99bfbedab5c" 59 | }, 60 | { 61 | "__type__": "cc.Node", 62 | "_name": "Canvas", 63 | "_objFlags": 0, 64 | "_parent": { 65 | "__id__": 1 66 | }, 67 | "_children": [ 68 | { 69 | "__id__": 3 70 | } 71 | ], 72 | "_active": true, 73 | "_level": 0, 74 | "_components": [ 75 | { 76 | "__id__": 5 77 | } 78 | ], 79 | "_prefab": null, 80 | "_opacity": 255, 81 | "_color": { 82 | "__type__": "cc.Color", 83 | "r": 255, 84 | "g": 255, 85 | "b": 255, 86 | "a": 255 87 | }, 88 | "_contentSize": { 89 | "__type__": "cc.Size", 90 | "width": 960, 91 | "height": 640 92 | }, 93 | "_anchorPoint": { 94 | "__type__": "cc.Vec2", 95 | "x": 0.5, 96 | "y": 0.5 97 | }, 98 | "_position": { 99 | "__type__": "cc.Vec3", 100 | "x": 480, 101 | "y": 320, 102 | "z": 0 103 | }, 104 | "_scale": { 105 | "__type__": "cc.Vec3", 106 | "x": 1, 107 | "y": 1, 108 | "z": 1 109 | }, 110 | "_rotationX": 0, 111 | "_rotationY": 0, 112 | "_skewX": 0, 113 | "_skewY": 0, 114 | "_zIndex": 0, 115 | "groupIndex": 0, 116 | "_id": "55Yt5IJl1DN4bTvtGvohDQ", 117 | "_eulerAngles": { 118 | "__type__": "cc.Vec3", 119 | "x": 0, 120 | "y": 0, 121 | "z": 0 122 | } 123 | }, 124 | { 125 | "__type__": "cc.Node", 126 | "_name": "Main Camera", 127 | "_objFlags": 0, 128 | "_parent": { 129 | "__id__": 2 130 | }, 131 | "_children": [], 132 | "_active": true, 133 | "_level": 1, 134 | "_components": [ 135 | { 136 | "__id__": 4 137 | } 138 | ], 139 | "_prefab": null, 140 | "_opacity": 255, 141 | "_color": { 142 | "__type__": "cc.Color", 143 | "r": 255, 144 | "g": 255, 145 | "b": 255, 146 | "a": 255 147 | }, 148 | "_contentSize": { 149 | "__type__": "cc.Size", 150 | "width": 0, 151 | "height": 0 152 | }, 153 | "_anchorPoint": { 154 | "__type__": "cc.Vec2", 155 | "x": 0.5, 156 | "y": 0.5 157 | }, 158 | "_position": { 159 | "__type__": "cc.Vec3", 160 | "x": 0, 161 | "y": 0, 162 | "z": 0 163 | }, 164 | "_scale": { 165 | "__type__": "cc.Vec3", 166 | "x": 1, 167 | "y": 1, 168 | "z": 1 169 | }, 170 | "_rotationX": 0, 171 | "_rotationY": 0, 172 | "_skewX": 0, 173 | "_skewY": 0, 174 | "_zIndex": 0, 175 | "groupIndex": 0, 176 | "_id": "6blZ7B/E9COI0+FLvWl7O1", 177 | "_eulerAngles": { 178 | "__type__": "cc.Vec3", 179 | "x": 0, 180 | "y": 0, 181 | "z": 0 182 | } 183 | }, 184 | { 185 | "__type__": "cc.Camera", 186 | "_name": "", 187 | "_objFlags": 0, 188 | "node": { 189 | "__id__": 3 190 | }, 191 | "_enabled": true, 192 | "_cullingMask": 4294967295, 193 | "_clearFlags": 7, 194 | "_backgroundColor": { 195 | "__type__": "cc.Color", 196 | "r": 0, 197 | "g": 0, 198 | "b": 0, 199 | "a": 255 200 | }, 201 | "_depth": -1, 202 | "_zoomRatio": 1, 203 | "_targetTexture": null, 204 | "_id": "48wnLc7wVHUI2FEFuHaEAp" 205 | }, 206 | { 207 | "__type__": "cc.Canvas", 208 | "_name": "", 209 | "_objFlags": 0, 210 | "node": { 211 | "__id__": 2 212 | }, 213 | "_enabled": true, 214 | "_designResolution": { 215 | "__type__": "cc.Size", 216 | "width": 960, 217 | "height": 640 218 | }, 219 | "_fitWidth": false, 220 | "_fitHeight": true, 221 | "_id": "a2QGpOtn5OALCOkg/x77xy" 222 | } 223 | ] -------------------------------------------------------------------------------- /assets/bcx/plugins.min.js: -------------------------------------------------------------------------------- 1 | !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n=arguments.length||arguments[0],function(t){return function(t,e){return new Proxy(t,e)}(t,{get:function(t,n){return"function"==typeof t[n]?function(){for(var r=arguments.length,o=Array(r),u=0;u", 12 | "service_type": "3", 13 | "service_type_zh": "公司和个人游戏", 14 | "support_platform": [ 15 | "Android", 16 | "iOS", 17 | "HTML5" 18 | ], 19 | "package_download_url": "http://download.cocos.com/CocosServices/plugins/service-analytics/1.2.0_2.1.0.zip", 20 | "package_version_desc": "1、优化SDK,修复H5-SDK 与多个小游戏平台适配问题,删除和优化init事件无用接口
2、 如有相关问题咨询或者需求, 可以联系我们技术支持邮箱 support-cocos@cocos.com", 21 | "service_component_name": "service-analytics", 22 | "package_versions": [ 23 | "1.0.0_1.0.5", 24 | "1.1.2_2.0.0", 25 | "1.1.3_2.0.1", 26 | "1.1.4_2.0.1", 27 | "1.1.5_2.0.1", 28 | "1.1.6_2.0.1_2.0.2", 29 | "1.1.7_2.0.3", 30 | "1.1.8_2.0.4", 31 | "1.1.9_2.1.0", 32 | "1.2.0_2.1.0" 33 | ], 34 | "build_platform": [ 35 | "web-mobile", 36 | "web-desktop", 37 | "wechatgame", 38 | "android", 39 | "ios", 40 | "fb-instant-games", 41 | "android-instant", 42 | "baidugame", 43 | "quickgame", 44 | "qgame", 45 | "qqplay", 46 | "huawei" 47 | ], 48 | "require_verify": 0, 49 | "service_price": "", 50 | "packpage_version_desc": "", 51 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 52 | }, 53 | { 54 | "service_id": "241", 55 | "service_name": "Matchvs", 56 | "service_icon": "https://account.cocos.com/client/14406719a07eb3d714d36e5edc6e06fa.png", 57 | "service_desc": "通过SDK接入快速实现联网功能、帧同步、国内外多节点、服务器独立部署、gameServer自定义游戏服务端逻辑。\n技术支持群QQ群:822523258", 58 | "service_title": "专业成熟的移动游戏联网与服务端解决方案", 59 | "service_guide_url": "http://doc.matchvs.com/QuickStart/QuickStart-CocosCreator", 60 | "service_sample_url": "http://www.matchvs.com/serviceCourse", 61 | "service_dev_url": "http://www.matchvs.com/cocosLogin", 62 | "service_type": "3", 63 | "service_type_zh": "公司和个人游戏", 64 | "support_platform": [ 65 | "Android", 66 | "iOS", 67 | "HTML5" 68 | ], 69 | "package_download_url": "http://download.cocos.com/CocosServices/plugins/service-matchvs/1.0.9_3.7.9.9.zip", 70 | "package_version_desc": "更新日期:2019-07-18
更新内容:
1、修复多节点登录返回值错误
2、修复FaceBook平台受限安全策略的问题", 71 | "service_component_name": "service-matchvs", 72 | "package_versions": [ 73 | "1.0.3_3.7.6.4", 74 | "1.0.5_3.7.7.3", 75 | "1.0.6_3.7.9.2", 76 | "1.0.7_3.7.9.6", 77 | "1.0.9_3.7.9.9" 78 | ], 79 | "build_platform": [ 80 | "web-mobile", 81 | "web-desktop", 82 | "fb-instant-games", 83 | "wechatgame", 84 | "wechatgame-subcontext", 85 | "qqplay", 86 | "android", 87 | "android-instant", 88 | "ios", 89 | "mac", 90 | "quickgame", 91 | "qgame", 92 | "huawei" 93 | ], 94 | "require_verify": 0, 95 | "service_price": "该服务按使用量计费,计费规则,所产生的费用将由第三方从您的 Cocos 账户余额 中扣除。", 96 | "packpage_version_desc": "", 97 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 98 | }, 99 | { 100 | "service_id": "242", 101 | "service_name": "Agora Voice", 102 | "service_icon": "https://account.cocos.com/uploads/client_icon/2019-07-16/273952d155b4cdb72d2b1bc61de91ade.png", 103 | "service_desc": "稳定、低耗、76ms超低延时、全球200+数据中心覆盖;变声器、超高音质、听声辩位等丰富玩法极速接入;全平台支持:Android、iOS、Web。\n技术支持群QQ群:799099183\n", 104 | "service_title": "游戏内置实时语音", 105 | "service_guide_url": "https://docs.agora.io/cn/Interactive Gaming/game_c?platform=Cocos Creator", 106 | "service_sample_url": "https://github.com/AgoraIO/Voice-Call-for-Mobile-Gaming/tree/master/Basic-Voice-Call-for-Gaming/Hello-CocosCreator-Voice-Agora", 107 | "service_dev_url": "https://sso.agora.io/api/oauth/cocos/login", 108 | "service_type": "3", 109 | "service_type_zh": "公司和个人游戏", 110 | "support_platform": [ 111 | "Android", 112 | "iOS", 113 | "HTML5" 114 | ], 115 | "package_download_url": "http://download.cocos.com/CocosServices/plugins/service-agora/1.0.2_2.2.3.20_2.5.2.zip", 116 | "package_version_desc": "解决Bug:onAudioVolumeIndication 回调收不到.", 117 | "service_component_name": "service-agora", 118 | "package_versions": [ 119 | "1.0.1_2.2.3.20_2.5.2", 120 | "1.0.2_2.2.3.20_2.5.2" 121 | ], 122 | "build_platform": [ 123 | "web-mobile", 124 | "web-desktop", 125 | "android", 126 | "ios" 127 | ], 128 | "require_verify": 1, 129 | "service_price": "该服务按使用量计费,计费规则,所产生的费用将由第三方从您的 Cocos 账户余额 中扣除。", 130 | "packpage_version_desc": "", 131 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 132 | } 133 | ], 134 | "game": { 135 | "name": "未知游戏", 136 | "appid": "UNKNOW" 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /assets/widget/tank/base/NailTank.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "data": { 8 | "__id__": 1 9 | }, 10 | "optimizationPolicy": 0, 11 | "asyncLoadAssets": false 12 | }, 13 | { 14 | "__type__": "cc.Node", 15 | "_name": "NailTank", 16 | "_objFlags": 0, 17 | "_parent": null, 18 | "_children": [ 19 | { 20 | "__id__": 2 21 | }, 22 | { 23 | "__id__": 5 24 | } 25 | ], 26 | "_active": true, 27 | "_level": 1, 28 | "_components": [ 29 | { 30 | "__id__": 8 31 | } 32 | ], 33 | "_prefab": { 34 | "__id__": 9 35 | }, 36 | "_opacity": 255, 37 | "_color": { 38 | "__type__": "cc.Color", 39 | "r": 255, 40 | "g": 255, 41 | "b": 255, 42 | "a": 255 43 | }, 44 | "_contentSize": { 45 | "__type__": "cc.Size", 46 | "width": 0, 47 | "height": 0 48 | }, 49 | "_anchorPoint": { 50 | "__type__": "cc.Vec2", 51 | "x": 0.5, 52 | "y": 0.5 53 | }, 54 | "_position": { 55 | "__type__": "cc.Vec3", 56 | "x": 0, 57 | "y": 245, 58 | "z": 0 59 | }, 60 | "_scale": { 61 | "__type__": "cc.Vec3", 62 | "x": 1, 63 | "y": 1, 64 | "z": 1 65 | }, 66 | "_rotationX": 0, 67 | "_rotationY": 0, 68 | "_skewX": 0, 69 | "_skewY": 0, 70 | "groupIndex": 0, 71 | "_id": "", 72 | "_eulerAngles": { 73 | "__type__": "cc.Vec3", 74 | "x": 0, 75 | "y": 0, 76 | "z": 0 77 | } 78 | }, 79 | { 80 | "__type__": "cc.Node", 81 | "_name": "enemy", 82 | "_objFlags": 0, 83 | "_parent": { 84 | "__id__": 1 85 | }, 86 | "_children": [], 87 | "_active": true, 88 | "_level": 2, 89 | "_components": [ 90 | { 91 | "__id__": 3 92 | } 93 | ], 94 | "_prefab": { 95 | "__id__": 4 96 | }, 97 | "_opacity": 255, 98 | "_color": { 99 | "__type__": "cc.Color", 100 | "r": 255, 101 | "g": 255, 102 | "b": 255, 103 | "a": 255 104 | }, 105 | "_contentSize": { 106 | "__type__": "cc.Size", 107 | "width": 35, 108 | "height": 44 109 | }, 110 | "_anchorPoint": { 111 | "__type__": "cc.Vec2", 112 | "x": 0.5, 113 | "y": 0.5 114 | }, 115 | "_position": { 116 | "__type__": "cc.Vec3", 117 | "x": 0, 118 | "y": 0, 119 | "z": 0 120 | }, 121 | "_scale": { 122 | "__type__": "cc.Vec3", 123 | "x": 0.5, 124 | "y": 0.5, 125 | "z": 1 126 | }, 127 | "_rotationX": 0, 128 | "_rotationY": 0, 129 | "_skewX": 0, 130 | "_skewY": 0, 131 | "groupIndex": 0, 132 | "_id": "", 133 | "_eulerAngles": { 134 | "__type__": "cc.Vec3", 135 | "x": 0, 136 | "y": 0, 137 | "z": 0 138 | } 139 | }, 140 | { 141 | "__type__": "cc.Sprite", 142 | "_name": "", 143 | "_objFlags": 0, 144 | "node": { 145 | "__id__": 2 146 | }, 147 | "_enabled": true, 148 | "_spriteFrame": { 149 | "__uuid__": "40fb76c2-a242-4e12-8422-a01456e05466" 150 | }, 151 | "_type": 0, 152 | "_sizeMode": 1, 153 | "_fillType": 0, 154 | "_fillCenter": { 155 | "__type__": "cc.Vec2", 156 | "x": 0, 157 | "y": 0 158 | }, 159 | "_fillStart": 0, 160 | "_fillRange": 0, 161 | "_isTrimmedMode": true, 162 | "_state": 0, 163 | "_atlas": { 164 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 165 | }, 166 | "_srcBlendFactor": 770, 167 | "_dstBlendFactor": 771, 168 | "_id": "" 169 | }, 170 | { 171 | "__type__": "cc.PrefabInfo", 172 | "root": { 173 | "__id__": 1 174 | }, 175 | "asset": { 176 | "__uuid__": "01e579ef-cdea-4364-a89c-4e8af36f6f23" 177 | }, 178 | "fileId": "cfdmtrOF5Gd5pXEP1VYFvD", 179 | "sync": false 180 | }, 181 | { 182 | "__type__": "cc.Node", 183 | "_name": "me", 184 | "_objFlags": 0, 185 | "_parent": { 186 | "__id__": 1 187 | }, 188 | "_children": [], 189 | "_active": false, 190 | "_level": 2, 191 | "_components": [ 192 | { 193 | "__id__": 6 194 | } 195 | ], 196 | "_prefab": { 197 | "__id__": 7 198 | }, 199 | "_opacity": 255, 200 | "_color": { 201 | "__type__": "cc.Color", 202 | "r": 255, 203 | "g": 255, 204 | "b": 255, 205 | "a": 255 206 | }, 207 | "_contentSize": { 208 | "__type__": "cc.Size", 209 | "width": 35, 210 | "height": 44 211 | }, 212 | "_anchorPoint": { 213 | "__type__": "cc.Vec2", 214 | "x": 0.5, 215 | "y": 0.5 216 | }, 217 | "_position": { 218 | "__type__": "cc.Vec3", 219 | "x": 0, 220 | "y": 0, 221 | "z": 0 222 | }, 223 | "_scale": { 224 | "__type__": "cc.Vec3", 225 | "x": 0.5, 226 | "y": 0.5, 227 | "z": 1 228 | }, 229 | "_rotationX": 0, 230 | "_rotationY": 0, 231 | "_skewX": 0, 232 | "_skewY": 0, 233 | "groupIndex": 0, 234 | "_id": "", 235 | "_eulerAngles": { 236 | "__type__": "cc.Vec3", 237 | "x": 0, 238 | "y": 0, 239 | "z": 0 240 | } 241 | }, 242 | { 243 | "__type__": "cc.Sprite", 244 | "_name": "", 245 | "_objFlags": 0, 246 | "node": { 247 | "__id__": 5 248 | }, 249 | "_enabled": true, 250 | "_spriteFrame": { 251 | "__uuid__": "b5577c95-3003-4749-bd7e-f01fb751a45a" 252 | }, 253 | "_type": 0, 254 | "_sizeMode": 1, 255 | "_fillType": 0, 256 | "_fillCenter": { 257 | "__type__": "cc.Vec2", 258 | "x": 0, 259 | "y": 0 260 | }, 261 | "_fillStart": 0, 262 | "_fillRange": 0, 263 | "_isTrimmedMode": true, 264 | "_state": 0, 265 | "_atlas": { 266 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 267 | }, 268 | "_srcBlendFactor": 770, 269 | "_dstBlendFactor": 771, 270 | "_id": "" 271 | }, 272 | { 273 | "__type__": "cc.PrefabInfo", 274 | "root": { 275 | "__id__": 1 276 | }, 277 | "asset": { 278 | "__uuid__": "01e579ef-cdea-4364-a89c-4e8af36f6f23" 279 | }, 280 | "fileId": "c2Q0BPJSRL4oQNmZ1EMxL3", 281 | "sync": false 282 | }, 283 | { 284 | "__type__": "94ee8QIRc5NJI1xg4UOkVFB", 285 | "_name": "", 286 | "_objFlags": 0, 287 | "node": { 288 | "__id__": 1 289 | }, 290 | "_enabled": true, 291 | "rootNode": { 292 | "__id__": 1 293 | }, 294 | "enemy": { 295 | "__id__": 3 296 | }, 297 | "me": { 298 | "__id__": 6 299 | }, 300 | "_id": "" 301 | }, 302 | { 303 | "__type__": "cc.PrefabInfo", 304 | "root": { 305 | "__id__": 1 306 | }, 307 | "asset": { 308 | "__uuid__": "01e579ef-cdea-4364-a89c-4e8af36f6f23" 309 | }, 310 | "fileId": "8cfUabp05JN5l1WeOl8S8U", 311 | "sync": false 312 | } 313 | ] -------------------------------------------------------------------------------- /assets/Texture/tank/aimboom.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | 1.png 8 | 9 | frame 10 | {{2,534},{134,138}} 11 | offset 12 | {-3,1} 13 | rotated 14 | 15 | sourceColorRect 16 | {{20,20},{134,138}} 17 | sourceSize 18 | {180,180} 19 | 20 | 10.png 21 | 22 | frame 23 | {{2,400},{132,156}} 24 | offset 25 | {-2,0} 26 | rotated 27 | 28 | sourceColorRect 29 | {{22,12},{132,156}} 30 | sourceSize 31 | {180,180} 32 | 33 | 11.png 34 | 35 | frame 36 | {{184,2},{132,180}} 37 | offset 38 | {-2,0} 39 | rotated 40 | 41 | sourceColorRect 42 | {{22,0},{132,180}} 43 | sourceSize 44 | {180,180} 45 | 46 | 12.png 47 | 48 | frame 49 | {{358,138},{132,150}} 50 | offset 51 | {-2,-1} 52 | rotated 53 | 54 | sourceColorRect 55 | {{22,16},{132,150}} 56 | sourceSize 57 | {180,180} 58 | 59 | 2.png 60 | 61 | frame 62 | {{2,268},{174,130}} 63 | offset 64 | {-1,-1} 65 | rotated 66 | 67 | sourceColorRect 68 | {{2,26},{174,130}} 69 | sourceSize 70 | {180,180} 71 | 72 | 3.png 73 | 74 | frame 75 | {{182,136},{174,132}} 76 | offset 77 | {-1,0} 78 | rotated 79 | 80 | sourceColorRect 81 | {{2,24},{174,132}} 82 | sourceSize 83 | {180,180} 84 | 85 | 4.png 86 | 87 | frame 88 | {{366,2},{134,138}} 89 | offset 90 | {1,1} 91 | rotated 92 | 93 | sourceColorRect 94 | {{24,20},{134,138}} 95 | sourceSize 96 | {180,180} 97 | 98 | 5.png 99 | 100 | frame 101 | {{2,136},{130,178}} 102 | offset 103 | {0,0} 104 | rotated 105 | 106 | sourceColorRect 107 | {{25,1},{130,178}} 108 | sourceSize 109 | {180,180} 110 | 111 | 6.png 112 | 113 | frame 114 | {{178,270},{130,168}} 115 | offset 116 | {0,0} 117 | rotated 118 | 119 | sourceColorRect 120 | {{25,6},{130,168}} 121 | sourceSize 122 | {180,180} 123 | 124 | 7.png 125 | 126 | frame 127 | {{160,402},{146,134}} 128 | offset 129 | {-1,-2} 130 | rotated 131 | 132 | sourceColorRect 133 | {{16,25},{146,134}} 134 | sourceSize 135 | {180,180} 136 | 137 | 8.png 138 | 139 | frame 140 | {{2,2},{180,132}} 141 | offset 142 | {0,-1} 143 | rotated 144 | 145 | sourceColorRect 146 | {{0,25},{180,132}} 147 | sourceSize 148 | {180,180} 149 | 150 | 9.png 151 | 152 | frame 153 | {{348,272},{158,132}} 154 | offset 155 | {0,-1} 156 | rotated 157 | 158 | sourceColorRect 159 | {{11,25},{158,132}} 160 | sourceSize 161 | {180,180} 162 | 163 | 164 | metadata 165 | 166 | format 167 | 2 168 | realTextureFileName 169 | aimboom.png 170 | size 171 | {512,1024} 172 | smartupdate 173 | $TexturePacker:SmartUpdate:41b2dda73fb47c7091b679c8dc151471:1/1$ 174 | textureFileName 175 | aimboom.png 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /assets/Texture/tank/aimboom.plist.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.4", 3 | "uuid": "2b02d841-74b3-4cbe-87cf-629ca4b3d233", 4 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 5 | "size": { 6 | "width": 512, 7 | "height": 1024 8 | }, 9 | "type": "Texture Packer", 10 | "subMetas": { 11 | "1.png": { 12 | "ver": "1.0.3", 13 | "uuid": "743e5a54-ee2e-4a90-a4e6-0dd650e11dea", 14 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 15 | "trimType": "auto", 16 | "trimThreshold": 1, 17 | "rotated": true, 18 | "offsetX": -3, 19 | "offsetY": 1, 20 | "trimX": 2, 21 | "trimY": 534, 22 | "width": 134, 23 | "height": 138, 24 | "rawWidth": 180, 25 | "rawHeight": 180, 26 | "borderTop": 0, 27 | "borderBottom": 0, 28 | "borderLeft": 0, 29 | "borderRight": 0, 30 | "spriteType": "normal", 31 | "subMetas": {} 32 | }, 33 | "10.png": { 34 | "ver": "1.0.3", 35 | "uuid": "34e7f743-9fe6-4a0c-91de-9b89065a185c", 36 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 37 | "trimType": "auto", 38 | "trimThreshold": 1, 39 | "rotated": true, 40 | "offsetX": -2, 41 | "offsetY": 0, 42 | "trimX": 2, 43 | "trimY": 400, 44 | "width": 132, 45 | "height": 156, 46 | "rawWidth": 180, 47 | "rawHeight": 180, 48 | "borderTop": 0, 49 | "borderBottom": 0, 50 | "borderLeft": 0, 51 | "borderRight": 0, 52 | "spriteType": "normal", 53 | "subMetas": {} 54 | }, 55 | "11.png": { 56 | "ver": "1.0.3", 57 | "uuid": "ce531f35-6c0b-404e-8126-78928c924b76", 58 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 59 | "trimType": "auto", 60 | "trimThreshold": 1, 61 | "rotated": true, 62 | "offsetX": -2, 63 | "offsetY": 0, 64 | "trimX": 184, 65 | "trimY": 2, 66 | "width": 132, 67 | "height": 180, 68 | "rawWidth": 180, 69 | "rawHeight": 180, 70 | "borderTop": 0, 71 | "borderBottom": 0, 72 | "borderLeft": 0, 73 | "borderRight": 0, 74 | "spriteType": "normal", 75 | "subMetas": {} 76 | }, 77 | "12.png": { 78 | "ver": "1.0.3", 79 | "uuid": "bdd73099-0385-48cb-a253-a0ab01617c0d", 80 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 81 | "trimType": "auto", 82 | "trimThreshold": 1, 83 | "rotated": true, 84 | "offsetX": -2, 85 | "offsetY": -1, 86 | "trimX": 358, 87 | "trimY": 138, 88 | "width": 132, 89 | "height": 150, 90 | "rawWidth": 180, 91 | "rawHeight": 180, 92 | "borderTop": 0, 93 | "borderBottom": 0, 94 | "borderLeft": 0, 95 | "borderRight": 0, 96 | "spriteType": "normal", 97 | "subMetas": {} 98 | }, 99 | "2.png": { 100 | "ver": "1.0.3", 101 | "uuid": "d205a391-0434-4620-898d-19d515b79083", 102 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 103 | "trimType": "auto", 104 | "trimThreshold": 1, 105 | "rotated": false, 106 | "offsetX": -1, 107 | "offsetY": -1, 108 | "trimX": 2, 109 | "trimY": 268, 110 | "width": 174, 111 | "height": 130, 112 | "rawWidth": 180, 113 | "rawHeight": 180, 114 | "borderTop": 0, 115 | "borderBottom": 0, 116 | "borderLeft": 0, 117 | "borderRight": 0, 118 | "spriteType": "normal", 119 | "subMetas": {} 120 | }, 121 | "3.png": { 122 | "ver": "1.0.3", 123 | "uuid": "1611f5f0-ac01-40fb-9169-afdf72b672e5", 124 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 125 | "trimType": "auto", 126 | "trimThreshold": 1, 127 | "rotated": false, 128 | "offsetX": -1, 129 | "offsetY": 0, 130 | "trimX": 182, 131 | "trimY": 136, 132 | "width": 174, 133 | "height": 132, 134 | "rawWidth": 180, 135 | "rawHeight": 180, 136 | "borderTop": 0, 137 | "borderBottom": 0, 138 | "borderLeft": 0, 139 | "borderRight": 0, 140 | "spriteType": "normal", 141 | "subMetas": {} 142 | }, 143 | "4.png": { 144 | "ver": "1.0.3", 145 | "uuid": "1c46ac97-957e-4d59-bcfc-deba7c621b70", 146 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 147 | "trimType": "auto", 148 | "trimThreshold": 1, 149 | "rotated": true, 150 | "offsetX": 1, 151 | "offsetY": 1, 152 | "trimX": 366, 153 | "trimY": 2, 154 | "width": 134, 155 | "height": 138, 156 | "rawWidth": 180, 157 | "rawHeight": 180, 158 | "borderTop": 0, 159 | "borderBottom": 0, 160 | "borderLeft": 0, 161 | "borderRight": 0, 162 | "spriteType": "normal", 163 | "subMetas": {} 164 | }, 165 | "5.png": { 166 | "ver": "1.0.3", 167 | "uuid": "5f7f4941-6bde-4dac-ba8c-6fe0fc57efae", 168 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 169 | "trimType": "auto", 170 | "trimThreshold": 1, 171 | "rotated": true, 172 | "offsetX": 0, 173 | "offsetY": 0, 174 | "trimX": 2, 175 | "trimY": 136, 176 | "width": 130, 177 | "height": 178, 178 | "rawWidth": 180, 179 | "rawHeight": 180, 180 | "borderTop": 0, 181 | "borderBottom": 0, 182 | "borderLeft": 0, 183 | "borderRight": 0, 184 | "spriteType": "normal", 185 | "subMetas": {} 186 | }, 187 | "6.png": { 188 | "ver": "1.0.3", 189 | "uuid": "277e000b-655d-4def-bb46-69b2bed8c13e", 190 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 191 | "trimType": "auto", 192 | "trimThreshold": 1, 193 | "rotated": true, 194 | "offsetX": 0, 195 | "offsetY": 0, 196 | "trimX": 178, 197 | "trimY": 270, 198 | "width": 130, 199 | "height": 168, 200 | "rawWidth": 180, 201 | "rawHeight": 180, 202 | "borderTop": 0, 203 | "borderBottom": 0, 204 | "borderLeft": 0, 205 | "borderRight": 0, 206 | "spriteType": "normal", 207 | "subMetas": {} 208 | }, 209 | "7.png": { 210 | "ver": "1.0.3", 211 | "uuid": "3d8b5234-bdaa-43d6-8a70-c89daa5e7314", 212 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 213 | "trimType": "auto", 214 | "trimThreshold": 1, 215 | "rotated": false, 216 | "offsetX": -1, 217 | "offsetY": -2, 218 | "trimX": 160, 219 | "trimY": 402, 220 | "width": 146, 221 | "height": 134, 222 | "rawWidth": 180, 223 | "rawHeight": 180, 224 | "borderTop": 0, 225 | "borderBottom": 0, 226 | "borderLeft": 0, 227 | "borderRight": 0, 228 | "spriteType": "normal", 229 | "subMetas": {} 230 | }, 231 | "8.png": { 232 | "ver": "1.0.3", 233 | "uuid": "984f0948-d2cd-4ad1-ad36-88f10d33dc74", 234 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 235 | "trimType": "auto", 236 | "trimThreshold": 1, 237 | "rotated": false, 238 | "offsetX": 0, 239 | "offsetY": -1, 240 | "trimX": 2, 241 | "trimY": 2, 242 | "width": 180, 243 | "height": 132, 244 | "rawWidth": 180, 245 | "rawHeight": 180, 246 | "borderTop": 0, 247 | "borderBottom": 0, 248 | "borderLeft": 0, 249 | "borderRight": 0, 250 | "spriteType": "normal", 251 | "subMetas": {} 252 | }, 253 | "9.png": { 254 | "ver": "1.0.3", 255 | "uuid": "f8de7470-00f3-4512-8633-644c10060158", 256 | "rawTextureUuid": "812346d4-9cec-473f-b72d-26136ce76a28", 257 | "trimType": "auto", 258 | "trimThreshold": 1, 259 | "rotated": false, 260 | "offsetX": 0, 261 | "offsetY": -1, 262 | "trimX": 348, 263 | "trimY": 272, 264 | "width": 158, 265 | "height": 132, 266 | "rawWidth": 180, 267 | "rawHeight": 180, 268 | "borderTop": 0, 269 | "borderBottom": 0, 270 | "borderLeft": 0, 271 | "borderRight": 0, 272 | "spriteType": "normal", 273 | "subMetas": {} 274 | } 275 | } 276 | } -------------------------------------------------------------------------------- /assets/widget/joystick/ring.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | dot: { 6 | default: null, 7 | type: cc.Node, 8 | displayName: '摇杆节点', 9 | }, 10 | notifyClickName: { 11 | default: "joystickPlayerClick", 12 | displayName: '通知点击名称', 13 | }, 14 | _angle: { 15 | default: null, 16 | displayName: '当前触摸的角度', 17 | }, 18 | 19 | _radian: { 20 | default: null, 21 | displayName: '弧度', 22 | }, 23 | 24 | 25 | _speed: 0, //实际速度 26 | _speed1: 2, //一段速度 27 | _speed2: 4, //二段速度 28 | _silence:0, 29 | //wasd 30 | _wasdState:[], 31 | _wasdSpeed:[], 32 | _joystickInput:null, 33 | }, 34 | 35 | 36 | onLoad: function () { 37 | this._radius=this.node.width/3; 38 | this._silence=0; 39 | this._speed1=1; 40 | this._speed2=1; 41 | this._initTouchEvent(); 42 | this._initKeyEvent(); 43 | this._wasdState=[0,0,0,0]; 44 | this._wasdSpeed=[0,0,0,0]; 45 | this._joystickInput={ 46 | addx: 0, 47 | addy: 0, 48 | bodyAngle:0, 49 | }; 50 | console.log("ring"); 51 | }, 52 | onDestroy(){ 53 | cc.systemEvent.off(cc.SystemEvent.EventType.KEY_DOWN, this._keyDownEvent, this); 54 | cc.systemEvent.off(cc.SystemEvent.EventType.KEY_UP, this._keyUpEvent, this); 55 | }, 56 | 57 | //对圆圈的触摸监听 58 | _initTouchEvent: function () { 59 | var self = this; 60 | self.node.on(cc.Node.EventType.TOUCH_START, this._touchStartEvent, self); 61 | self.node.on(cc.Node.EventType.TOUCH_MOVE, this._touchMoveEvent, self); 62 | // 触摸在圆圈内离开或在圆圈外离开后,摇杆归位,player速度为0 63 | self.node.on(cc.Node.EventType.TOUCH_END, this._touchEndEvent, self); 64 | self.node.on(cc.Node.EventType.TOUCH_CANCEL, this._touchEndEvent, self); 65 | }, 66 | 67 | _initKeyEvent(){ 68 | cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, this._keyDownEvent, this); 69 | cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, this._keyUpEvent, this); 70 | }, 71 | 72 | //更新移动目标 73 | update: function (dt) { 74 | // this._wasdCheck(); 75 | this._allDirectionsMove(dt); 76 | }, 77 | lateUpdate: function (dt) { 78 | // console.log(dt); 79 | }, 80 | //全方向移动 81 | _allDirectionsMove: function (dt) { 82 | if (this._speed != 0) { 83 | this._joystickInput.addx=Math.cos(this._angle * (Math.PI / 180)) * this._speed; 84 | this._joystickInput.addy=Math.sin(this._angle * (Math.PI / 180)) * this._speed; 85 | this._joystickInput.bodyAngle=this._angle; 86 | }else{ 87 | this._joystickInput.addx=0; 88 | this._joystickInput.addy=0; 89 | } 90 | }, 91 | 92 | getInputData(){ 93 | return this._joystickInput; 94 | }, 95 | 96 | //计算两点间的距离并返回 97 | _getDistance: function (pos1, pos2) { 98 | return Math.sqrt(Math.pow(pos1.x - pos2.x, 2) + 99 | Math.pow(pos1.y - pos2.y, 2)); 100 | }, 101 | 102 | /*角度/弧度转换 103 | 角度 = 弧度 * 180 / Math.PI 104 | 弧度 = 角度 * Math.PI / 180*/ 105 | //计算弧度并返回 106 | _getRadian: function (point) { 107 | this._radian = Math.PI / 180 * this._getAngle(point); 108 | return this._radian; 109 | }, 110 | 111 | //计算角度并返回 112 | _getAngle: function (point) { 113 | var pos = this.node.getPosition(); 114 | this._angle = Math.atan2(point.y - pos.y, point.x - pos.x) * (180 / Math.PI); 115 | return this._angle; 116 | }, 117 | 118 | //设置实际速度 119 | _setSpeed: function (point) { 120 | //触摸点和遥控杆中心的距离 121 | var distance = this._getDistance(point, this.node.getPosition()); 122 | 123 | //如果半径 124 | if (distance < this._radius) { 125 | this._speed = this._speed1; 126 | } else { 127 | this._speed = this._speed2; 128 | } 129 | }, 130 | 131 | _keyDownEvent(event){ 132 | if(event.keyCode==cc.macro.KEY.w){ 133 | console.log('Down w key'); 134 | this._wasdState[0]=1; 135 | } 136 | if(event.keyCode==cc.macro.KEY.a){ 137 | console.log('Down a key'); 138 | this._wasdState[1]=1; 139 | } 140 | if(event.keyCode==cc.macro.KEY.s){ 141 | console.log('Down s key'); 142 | this._wasdState[2]=1; 143 | } 144 | if(event.keyCode==cc.macro.KEY.d){ 145 | console.log('Down d key'); 146 | this._wasdState[3]=1; 147 | } 148 | }, 149 | 150 | _keyUpEvent(event){ 151 | if(event.keyCode==cc.macro.KEY.w){ 152 | console.log('Up w key'); 153 | this._wasdState[0]=0; 154 | } 155 | if(event.keyCode==cc.macro.KEY.a){ 156 | console.log('Up a key'); 157 | this._wasdState[1]=0; 158 | } 159 | if(event.keyCode==cc.macro.KEY.s){ 160 | console.log('Up s key'); 161 | this._wasdState[2]=0; 162 | } 163 | if(event.keyCode==cc.macro.KEY.d){ 164 | console.log('Up d key'); 165 | this._wasdState[3]=0; 166 | } 167 | }, 168 | _wasdCheck(){ 169 | for(let i=0;i<4;i++){ 170 | let state=this._wasdState[i]; 171 | let speed=this._wasdSpeed[i]; 172 | if(state==1){ 173 | speed+=0.2; 174 | }else{ 175 | speed-=0.1; 176 | } 177 | if(speed>1){ 178 | speed=1; 179 | } 180 | if(speed<0){ 181 | speed=0; 182 | } 183 | this._wasdSpeed[i]=speed; 184 | } 185 | let x=this._wasdSpeed[3]-this._wasdSpeed[1]; 186 | let y=this._wasdSpeed[0]-this._wasdSpeed[2]; 187 | if(x==0&&y==0){ 188 | this._speed=0; 189 | }else{ 190 | let angle = Math.atan2(y,x) * (180 / Math.PI); 191 | this._speed=this._speed2; 192 | this._angle=angle; 193 | } 194 | }, 195 | _touchStartEvent: function (event) { 196 | // 获取触摸位置的世界坐标转换成圆圈的相对坐标(以圆圈的锚点为基准) 197 | var touchPos = this.node.convertToNodeSpaceAR(event.getLocation()); 198 | //触摸点与圆圈中心的距离 199 | var distance = this._getDistance(touchPos, cc.v2(0, 0)); 200 | //圆圈半径 201 | var radius = this.node.width / 2; 202 | // 记录摇杆位置,给touch move使用 203 | this._stickPos = touchPos; 204 | var posX = this.node.getPosition().x + touchPos.x; 205 | var posY = this.node.getPosition().y + touchPos.y; 206 | //手指在圆圈内触摸,控杆跟随触摸点 207 | if (radius > distance) { 208 | this.dot.setPosition(cc.v2(posX, posY)); 209 | return true; 210 | } 211 | return false; 212 | }, 213 | 214 | _touchMoveEvent: function (event) { 215 | var touchPos = this.node.convertToNodeSpaceAR(event.getLocation()); 216 | var distance = this._getDistance(touchPos, cc.v2(0, 0)); 217 | var radius = this.node.width / 2; 218 | // 由于摇杆的postion是以父节点为锚点,所以定位要加上ring和dot当前的位置(stickX,stickY) 219 | var posX = this.node.getPosition().x + touchPos.x; 220 | var posY = this.node.getPosition().y + touchPos.y; 221 | if (radius > distance) { 222 | this.dot.setPosition(cc.v2(posX, posY)); 223 | } else { 224 | //控杆永远保持在圈内,并在圈内跟随触摸更新角度 225 | var x = this.node.getPosition().x + Math.cos(this._getRadian(cc.v2(posX, posY))) * radius; 226 | var y = this.node.getPosition().y + Math.sin(this._getRadian(cc.v2(posX, posY))) * radius; 227 | this.dot.setPosition(cc.v2(x, y)); 228 | } 229 | //更新角度 230 | this._getAngle(cc.v2(posX, posY)); 231 | //设置实际速度 232 | this._setSpeed(cc.v2(posX, posY)); 233 | 234 | }, 235 | 236 | _touchEndEvent: function () { 237 | this.dot.setPosition(this.node.getPosition()); 238 | this._speed = 0; 239 | cc.director.emit(this.notifyClickName,"click"); 240 | }, 241 | }); -------------------------------------------------------------------------------- /assets/Script/Cover.js: -------------------------------------------------------------------------------- 1 | // Learn cc.Class: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html 3 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | cc.Class({ 12 | extends: cc.Component, 13 | 14 | properties: { 15 | connectStatusTxt: { 16 | default: null, 17 | type: cc.Label, 18 | displayName: '链接状态', 19 | }, 20 | testDes: { 21 | default: null, 22 | type: cc.Node, 23 | displayName: '测试删除', 24 | }, 25 | userNameEdit: { 26 | default: null, 27 | type: cc.EditBox, 28 | displayName: '玩家名字', 29 | }, 30 | userBalanceTxt: { 31 | default: null, 32 | type: cc.Label, 33 | displayName: '玩家余额', 34 | }, 35 | 36 | _currentSkin: { 37 | default: null, 38 | }, 39 | _skinList: { 40 | default: null, 41 | }, 42 | _totalCheckTime: 0, 43 | _lastCheckTime: 0, 44 | 45 | }, 46 | 47 | 48 | onTankChange(pageView, eventType) { 49 | var inx = pageView.getCurrentPageIndex(); 50 | this._currentSkin = this._skinList[inx]; 51 | console.log(this._currentSkin); 52 | }, 53 | onClick() { 54 | var that = this; 55 | var userName = this.userNameEdit.string; 56 | if (userName.length > 0) { 57 | console.log(userName); 58 | var mySocket = window.mySocket; 59 | var gameUser = { 60 | userName: userName, 61 | roomName: 'free', 62 | skin: that._currentSkin, 63 | }; 64 | var bcx = window.BcxWeb; 65 | mySocket.emit('preJoinRoom', gameUser, function (roomInfo) { 66 | console.log(roomInfo); 67 | }); 68 | } else { 69 | console.log("username is null"); 70 | } 71 | }, 72 | onLoginClick() { 73 | // 74 | // this.goFullScreen(); 75 | var bcx = window.cocosbcx; 76 | bcx.passwordLogin({ 77 | account: "liyunhan1111", //query.loginUserName, 78 | password: "Play12$$" 79 | }).then(res => { 80 | if (1 != res.code) { 81 | console.log("ERR, passwordLogin:" + res.code); 82 | } else { 83 | const data = res.data; 84 | console.log("SUC, passwordLogin"); 85 | console.log(data.account_id + " " + data.account_name); 86 | } 87 | }); 88 | }, 89 | onTestClick() { 90 | // 91 | // this.goFullScreen(); 92 | var bcx = window.BcxWeb; 93 | // bcx.getAccountInfo().then(res=>{ 94 | // console.log(res); 95 | // }); 96 | bcx.queryAccountOperations({ 97 | account: 'liyunhan1111', 98 | limit: '100', 99 | startId: '1.11.385596', 100 | // endId:'', 101 | }).then(res => { 102 | console.log(res); 103 | }); 104 | }, 105 | 106 | onCocosPreJoin() { 107 | var that = this; 108 | var userName = this.userNameEdit.string; 109 | if (userName.length > 0) { 110 | console.log(userName); 111 | var mySocket = window.mySocket; 112 | var gameUser = { 113 | userName: userName, 114 | roomName: 'cocos', 115 | skin: that._currentSkin, 116 | }; 117 | var bcx = window.BcxWeb; 118 | mySocket.emit('preJoinRoom', gameUser, function (roomInfo) { 119 | if (roomInfo && roomInfo.success == true) { 120 | if (roomInfo.data.validate != 1) { 121 | let gameContract = roomInfo.data.gameContract; 122 | let tokenCode = roomInfo.data.tokenCode; 123 | let tokenAmount = roomInfo.data.tokenAmount; 124 | let memo = roomInfo.data.memo; 125 | window.BcxWeb.transferAsset({ 126 | proposeAccount: userName, 127 | toAccount: gameContract, 128 | amount: tokenAmount, 129 | assetId: tokenCode, 130 | memo: memo, 131 | feeAssetId: tokenCode, 132 | isPropose: false, 133 | onlyGetFee: false 134 | }).then(res => { 135 | if (1 != res.code) { 136 | console.log("ERR, transferAsset:" + res.code); 137 | } else { 138 | const data = res.data; 139 | console.log("SUC, transferAsset"); 140 | } 141 | }); 142 | } 143 | } 144 | console.log(roomInfo); 145 | }); 146 | } else { 147 | console.log("username is null"); 148 | } 149 | }, 150 | onEosPreJoin() { 151 | console.log('eos'); 152 | }, 153 | // LIFE-CYCLE CALLBACKS: 154 | 155 | onLoad() { 156 | this._currentSkin = "sma"; 157 | this._skinList = ['sma', 'smb', 'smc', 'mda', 'mdb', 'mdc', 'hva', 'hvb', 'hvc']; 158 | let that = this; 159 | that.connectStatusTxt.node.active = true; 160 | cc.director.on("socketConnect", function (state) { 161 | if (state == 'connect') { 162 | if (that.connectStatusTxt) { 163 | that.connectStatusTxt.string = ""; 164 | } 165 | var mySocket = window.mySocket; 166 | mySocket.on('allowJoin', function (roomInfo) { 167 | console.log("allowJoin"); 168 | if (roomInfo && roomInfo.success) { 169 | var gameUser = { 170 | userName: roomInfo.data.userName, 171 | roomName: roomInfo.data.roomName, 172 | skin: roomInfo.data.tankSkin, 173 | }; 174 | console.log(gameUser); 175 | mySocket.emit('joinRoom', gameUser, function (retMsg) { 176 | console.log(retMsg); 177 | window.myUserName = gameUser.userName; 178 | cc.director.loadScene('game'); 179 | }); 180 | } 181 | }); 182 | } 183 | if (state == 'disconnect') { 184 | if (that.connectStatusTxt) { 185 | that.connectStatusTxt.string = "Connecting"; 186 | } 187 | } 188 | }); 189 | }, 190 | 191 | start() { 192 | 193 | }, 194 | update(dt) { 195 | this._totalCheckTime += dt; 196 | if (this._totalCheckTime - this._lastCheckTime > 3) { 197 | this.loopGetBcx(); 198 | this._lastCheckTime = this._totalCheckTime; 199 | } 200 | }, 201 | loopGetBcx() { 202 | var that = this; 203 | var bcx = window.BcxWeb; 204 | if (bcx) { 205 | bcx.getAccountInfo().then(account => { 206 | if (account) { 207 | let userName = account.account_name; 208 | if (userName && userName != "") { 209 | this.userNameEdit.string = userName; 210 | bcx.queryAccountBalances({ 211 | assetId: 'COCOS', 212 | account: userName, 213 | }).then(balance => { 214 | let amount = balance.data["COCOS"]; 215 | that.userBalanceTxt.string = amount + " COCOS"; 216 | // console.log(balance); 217 | }); 218 | 219 | } 220 | } 221 | 222 | }); 223 | } 224 | }, 225 | goFullScreen() { 226 | let element = document.documentElement; 227 | if (element.requestFullscreen) { 228 | element.requestFullscreen(); 229 | } else if (element.webkitRequestFullScreen) { 230 | element.webkitRequestFullScreen(); 231 | } else if (element.mozRequestFullScreen) { 232 | element.mozRequestFullScreen(); 233 | } else if (element.msRequestFullscreen) { 234 | // IE11 235 | element.msRequestFullscreen(); 236 | } 237 | }, 238 | 239 | }); -------------------------------------------------------------------------------- /assets/Scene/helloworld.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_parent": null, 15 | "_children": [ 16 | { 17 | "__id__": 2 18 | } 19 | ], 20 | "_active": true, 21 | "_level": 0, 22 | "_components": [], 23 | "_prefab": null, 24 | "_opacity": 255, 25 | "_color": { 26 | "__type__": "cc.Color", 27 | "r": 255, 28 | "g": 255, 29 | "b": 255, 30 | "a": 255 31 | }, 32 | "_contentSize": { 33 | "__type__": "cc.Size", 34 | "width": 0, 35 | "height": 0 36 | }, 37 | "_anchorPoint": { 38 | "__type__": "cc.Vec2", 39 | "x": 0, 40 | "y": 0 41 | }, 42 | "_scale": { 43 | "__type__": "cc.Vec3", 44 | "x": 0.3296875, 45 | "y": 0.3296875, 46 | "z": 1 47 | }, 48 | "_quat": { 49 | "__type__": "cc.Quat", 50 | "x": 0, 51 | "y": 0, 52 | "z": 0, 53 | "w": 1 54 | }, 55 | "_zIndex": 0, 56 | "groupIndex": 0, 57 | "autoReleaseAssets": false, 58 | "_id": "2d2f792f-a40c-49bb-a189-ed176a246e49" 59 | }, 60 | { 61 | "__type__": "cc.Node", 62 | "_name": "Canvas", 63 | "_objFlags": 0, 64 | "_parent": { 65 | "__id__": 1 66 | }, 67 | "_children": [ 68 | { 69 | "__id__": 3 70 | }, 71 | { 72 | "__id__": 5 73 | }, 74 | { 75 | "__id__": 8 76 | }, 77 | { 78 | "__id__": 10 79 | } 80 | ], 81 | "_active": true, 82 | "_level": 0, 83 | "_components": [ 84 | { 85 | "__id__": 12 86 | }, 87 | { 88 | "__id__": 13 89 | } 90 | ], 91 | "_prefab": null, 92 | "_opacity": 255, 93 | "_color": { 94 | "__type__": "cc.Color", 95 | "r": 252, 96 | "g": 252, 97 | "b": 252, 98 | "a": 255 99 | }, 100 | "_contentSize": { 101 | "__type__": "cc.Size", 102 | "width": 960, 103 | "height": 640 104 | }, 105 | "_anchorPoint": { 106 | "__type__": "cc.Vec2", 107 | "x": 0.5, 108 | "y": 0.5 109 | }, 110 | "_position": { 111 | "__type__": "cc.Vec3", 112 | "x": 480, 113 | "y": 320, 114 | "z": 0 115 | }, 116 | "_scale": { 117 | "__type__": "cc.Vec3", 118 | "x": 1, 119 | "y": 1, 120 | "z": 1 121 | }, 122 | "_rotationX": 0, 123 | "_rotationY": 0, 124 | "_skewX": 0, 125 | "_skewY": 0, 126 | "_zIndex": 0, 127 | "groupIndex": 0, 128 | "_id": "a286bbGknJLZpRpxROV6M94", 129 | "_eulerAngles": { 130 | "__type__": "cc.Vec3", 131 | "x": 0, 132 | "y": 0, 133 | "z": 0 134 | } 135 | }, 136 | { 137 | "__type__": "cc.Node", 138 | "_name": "Main Camera", 139 | "_objFlags": 0, 140 | "_parent": { 141 | "__id__": 2 142 | }, 143 | "_children": [], 144 | "_active": true, 145 | "_level": 1, 146 | "_components": [ 147 | { 148 | "__id__": 4 149 | } 150 | ], 151 | "_prefab": null, 152 | "_opacity": 255, 153 | "_color": { 154 | "__type__": "cc.Color", 155 | "r": 255, 156 | "g": 255, 157 | "b": 255, 158 | "a": 255 159 | }, 160 | "_contentSize": { 161 | "__type__": "cc.Size", 162 | "width": 0, 163 | "height": 0 164 | }, 165 | "_anchorPoint": { 166 | "__type__": "cc.Vec2", 167 | "x": 0.5, 168 | "y": 0.5 169 | }, 170 | "_position": { 171 | "__type__": "cc.Vec3", 172 | "x": 0, 173 | "y": 0, 174 | "z": 0 175 | }, 176 | "_scale": { 177 | "__type__": "cc.Vec3", 178 | "x": 1, 179 | "y": 1, 180 | "z": 1 181 | }, 182 | "_rotationX": 0, 183 | "_rotationY": 0, 184 | "_skewX": 0, 185 | "_skewY": 0, 186 | "_zIndex": 0, 187 | "groupIndex": 0, 188 | "_id": "bajsC4KotFLZ6XLFLKnycL", 189 | "_eulerAngles": { 190 | "__type__": "cc.Vec3", 191 | "x": 0, 192 | "y": 0, 193 | "z": 0 194 | } 195 | }, 196 | { 197 | "__type__": "cc.Camera", 198 | "_name": "", 199 | "_objFlags": 0, 200 | "node": { 201 | "__id__": 3 202 | }, 203 | "_enabled": true, 204 | "_cullingMask": 4294967295, 205 | "_clearFlags": 7, 206 | "_backgroundColor": { 207 | "__type__": "cc.Color", 208 | "r": 0, 209 | "g": 0, 210 | "b": 0, 211 | "a": 255 212 | }, 213 | "_depth": -1, 214 | "_zoomRatio": 1, 215 | "_targetTexture": null, 216 | "_id": "c7r5+B15dD56dUBiNj+0KH" 217 | }, 218 | { 219 | "__type__": "cc.Node", 220 | "_name": "background", 221 | "_objFlags": 0, 222 | "_parent": { 223 | "__id__": 2 224 | }, 225 | "_children": [], 226 | "_active": true, 227 | "_level": 0, 228 | "_components": [ 229 | { 230 | "__id__": 6 231 | }, 232 | { 233 | "__id__": 7 234 | } 235 | ], 236 | "_prefab": null, 237 | "_opacity": 255, 238 | "_color": { 239 | "__type__": "cc.Color", 240 | "r": 27, 241 | "g": 38, 242 | "b": 46, 243 | "a": 255 244 | }, 245 | "_contentSize": { 246 | "__type__": "cc.Size", 247 | "width": 960, 248 | "height": 640 249 | }, 250 | "_anchorPoint": { 251 | "__type__": "cc.Vec2", 252 | "x": 0.5, 253 | "y": 0.5 254 | }, 255 | "_position": { 256 | "__type__": "cc.Vec3", 257 | "x": 0, 258 | "y": 0, 259 | "z": 0 260 | }, 261 | "_scale": { 262 | "__type__": "cc.Vec3", 263 | "x": 1, 264 | "y": 1, 265 | "z": 1 266 | }, 267 | "_rotationX": 0, 268 | "_rotationY": 0, 269 | "_skewX": 0, 270 | "_skewY": 0, 271 | "_zIndex": 0, 272 | "groupIndex": 0, 273 | "_id": "e2e0crkOLxGrpMxpbC4iQg1", 274 | "_eulerAngles": { 275 | "__type__": "cc.Vec3", 276 | "x": 0, 277 | "y": 0, 278 | "z": 0 279 | } 280 | }, 281 | { 282 | "__type__": "cc.Widget", 283 | "_name": "", 284 | "_objFlags": 0, 285 | "node": { 286 | "__id__": 5 287 | }, 288 | "_enabled": true, 289 | "alignMode": 1, 290 | "_target": null, 291 | "_alignFlags": 45, 292 | "_left": 0, 293 | "_right": 0, 294 | "_top": 0, 295 | "_bottom": 0, 296 | "_verticalCenter": 0, 297 | "_horizontalCenter": 0, 298 | "_isAbsLeft": true, 299 | "_isAbsRight": true, 300 | "_isAbsTop": true, 301 | "_isAbsBottom": true, 302 | "_isAbsHorizontalCenter": true, 303 | "_isAbsVerticalCenter": true, 304 | "_originalWidth": 200, 305 | "_originalHeight": 150, 306 | "_id": "86+yud7pFDSrM+lsxByQvE" 307 | }, 308 | { 309 | "__type__": "cc.Sprite", 310 | "_name": "", 311 | "_objFlags": 0, 312 | "node": { 313 | "__id__": 5 314 | }, 315 | "_enabled": true, 316 | "_srcBlendFactor": 770, 317 | "_dstBlendFactor": 771, 318 | "_spriteFrame": { 319 | "__uuid__": "410fb916-8721-4663-bab8-34397391ace7" 320 | }, 321 | "_type": 1, 322 | "_sizeMode": 0, 323 | "_fillType": 0, 324 | "_fillCenter": { 325 | "__type__": "cc.Vec2", 326 | "x": 0, 327 | "y": 0 328 | }, 329 | "_fillStart": 0, 330 | "_fillRange": 0, 331 | "_isTrimmedMode": true, 332 | "_state": 0, 333 | "_atlas": null, 334 | "_id": "1bi08CbSBHsZSXfV2t6eKB" 335 | }, 336 | { 337 | "__type__": "cc.Node", 338 | "_name": "cocos", 339 | "_objFlags": 0, 340 | "_parent": { 341 | "__id__": 2 342 | }, 343 | "_children": [], 344 | "_active": true, 345 | "_level": 0, 346 | "_components": [ 347 | { 348 | "__id__": 9 349 | } 350 | ], 351 | "_prefab": null, 352 | "_opacity": 255, 353 | "_color": { 354 | "__type__": "cc.Color", 355 | "r": 255, 356 | "g": 255, 357 | "b": 255, 358 | "a": 255 359 | }, 360 | "_contentSize": { 361 | "__type__": "cc.Size", 362 | "width": 195, 363 | "height": 270 364 | }, 365 | "_anchorPoint": { 366 | "__type__": "cc.Vec2", 367 | "x": 0.5, 368 | "y": 0.5 369 | }, 370 | "_position": { 371 | "__type__": "cc.Vec3", 372 | "x": 0, 373 | "y": 50, 374 | "z": 0 375 | }, 376 | "_scale": { 377 | "__type__": "cc.Vec3", 378 | "x": 1, 379 | "y": 1, 380 | "z": 1 381 | }, 382 | "_rotationX": 0, 383 | "_rotationY": 0, 384 | "_skewX": 0, 385 | "_skewY": 0, 386 | "_zIndex": 0, 387 | "groupIndex": 0, 388 | "_id": "c4f30YOS65G64U2TwufdJ+2", 389 | "_eulerAngles": { 390 | "__type__": "cc.Vec3", 391 | "x": 0, 392 | "y": 0, 393 | "z": 0 394 | } 395 | }, 396 | { 397 | "__type__": "cc.Sprite", 398 | "_name": "", 399 | "_objFlags": 0, 400 | "node": { 401 | "__id__": 8 402 | }, 403 | "_enabled": true, 404 | "_srcBlendFactor": 770, 405 | "_dstBlendFactor": 771, 406 | "_spriteFrame": { 407 | "__uuid__": "31bc895a-c003-4566-a9f3-2e54ae1c17dc" 408 | }, 409 | "_type": 0, 410 | "_sizeMode": 1, 411 | "_fillType": 0, 412 | "_fillCenter": { 413 | "__type__": "cc.Vec2", 414 | "x": 0, 415 | "y": 0 416 | }, 417 | "_fillStart": 0, 418 | "_fillRange": 0, 419 | "_isTrimmedMode": true, 420 | "_state": 0, 421 | "_atlas": null, 422 | "_id": "42SM+92GZAXYsjLj89MLM+" 423 | }, 424 | { 425 | "__type__": "cc.Node", 426 | "_name": "label", 427 | "_objFlags": 0, 428 | "_parent": { 429 | "__id__": 2 430 | }, 431 | "_children": [], 432 | "_active": true, 433 | "_level": 0, 434 | "_components": [ 435 | { 436 | "__id__": 11 437 | } 438 | ], 439 | "_prefab": null, 440 | "_opacity": 255, 441 | "_color": { 442 | "__type__": "cc.Color", 443 | "r": 255, 444 | "g": 255, 445 | "b": 255, 446 | "a": 255 447 | }, 448 | "_contentSize": { 449 | "__type__": "cc.Size", 450 | "width": 146.81, 451 | "height": 60 452 | }, 453 | "_anchorPoint": { 454 | "__type__": "cc.Vec2", 455 | "x": 0.5, 456 | "y": 0.5 457 | }, 458 | "_position": { 459 | "__type__": "cc.Vec3", 460 | "x": 0, 461 | "y": -180, 462 | "z": 0 463 | }, 464 | "_scale": { 465 | "__type__": "cc.Vec3", 466 | "x": 1, 467 | "y": 1, 468 | "z": 1 469 | }, 470 | "_rotationX": 0, 471 | "_rotationY": 0, 472 | "_skewX": 0, 473 | "_skewY": 0, 474 | "_zIndex": 0, 475 | "groupIndex": 0, 476 | "_id": "31f1bH7V69Ajr1iXhluMpTB", 477 | "_eulerAngles": { 478 | "__type__": "cc.Vec3", 479 | "x": 0, 480 | "y": 0, 481 | "z": 0 482 | } 483 | }, 484 | { 485 | "__type__": "cc.Label", 486 | "_name": "", 487 | "_objFlags": 0, 488 | "node": { 489 | "__id__": 10 490 | }, 491 | "_enabled": true, 492 | "_srcBlendFactor": 1, 493 | "_dstBlendFactor": 771, 494 | "_useOriginalSize": false, 495 | "_string": "Label", 496 | "_N$string": "Label", 497 | "_fontSize": 60, 498 | "_lineHeight": 60, 499 | "_enableWrapText": true, 500 | "_N$file": null, 501 | "_isSystemFontUsed": true, 502 | "_spacingX": 0, 503 | "_N$horizontalAlign": 1, 504 | "_N$verticalAlign": 1, 505 | "_N$fontFamily": "Arial", 506 | "_N$overflow": 0, 507 | "_id": "74saCdhnNHjbyDsdd1bTTt" 508 | }, 509 | { 510 | "__type__": "cc.Canvas", 511 | "_name": "", 512 | "_objFlags": 0, 513 | "node": { 514 | "__id__": 2 515 | }, 516 | "_enabled": true, 517 | "_designResolution": { 518 | "__type__": "cc.Size", 519 | "width": 960, 520 | "height": 640 521 | }, 522 | "_fitWidth": false, 523 | "_fitHeight": true, 524 | "_id": "6f5cteKmlPh6NGUsUqxlFR" 525 | }, 526 | { 527 | "__type__": "280c3rsZJJKnZ9RqbALVwtK", 528 | "_name": "", 529 | "_objFlags": 0, 530 | "node": { 531 | "__id__": 2 532 | }, 533 | "_enabled": true, 534 | "label": { 535 | "__id__": 11 536 | }, 537 | "text": "Hello, World!", 538 | "_id": "dcGJ+cSA5D7qNtScKfLjJJ" 539 | } 540 | ] -------------------------------------------------------------------------------- /assets/Script/GameMain.js: -------------------------------------------------------------------------------- 1 | // Learn cc.Class: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html 3 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | const NailTank = require('../widget/tank/base/NailTank'); 11 | const BaseBullet = require('../widget/tank/base/BaseBullet'); 12 | const BaseTank = require('../widget/tank/tank/BaseTank'); 13 | const Ring = require('../widget/joystick/ring'); 14 | 15 | cc.Class({ 16 | extends: cc.Component, 17 | 18 | properties: { 19 | connectStatusTxt: { 20 | default: null, 21 | type: cc.Label, 22 | displayName: '链接状态', 23 | }, 24 | uiCanvas: { 25 | default: null, 26 | type: cc.Canvas, 27 | displayName: 'UI Canvas', 28 | }, 29 | gameBg: { 30 | default: null, 31 | type: cc.Node, 32 | displayName: '游戏场景父节点', 33 | }, 34 | gameMap: { 35 | default: null, 36 | type: cc.Node, 37 | displayName: '游戏地图', 38 | }, 39 | gameSmallMap: { 40 | default: null, 41 | type: cc.Node, 42 | displayName: '游戏小地图', 43 | }, 44 | aimBoomAnim: { 45 | default: null, 46 | type: cc.Animation, 47 | displayName: '瞄准目标动画', 48 | }, 49 | playerCamera: { 50 | default: null, 51 | type: cc.Node, 52 | displayName: '跟随玩家的摄像机', 53 | }, 54 | joyStickMove: { 55 | default: null, 56 | type: Ring, 57 | displayName: '运动摇杆', 58 | }, 59 | 60 | nailTankPrefab: { 61 | default: null, 62 | type: cc.Prefab, 63 | displayName: '预制缩略坦克', 64 | }, 65 | bulletPrefab: { 66 | default: null, 67 | type: cc.Prefab, 68 | displayName: '预制子弹', 69 | }, 70 | smallTankAPre: { 71 | default: null, 72 | type: cc.Prefab, 73 | displayName: 'smallTankAPre', 74 | }, 75 | smallTankBPre: { 76 | default: null, 77 | type: cc.Prefab, 78 | displayName: 'smallTankBPre', 79 | }, 80 | smallTankCPre: { 81 | default: null, 82 | type: cc.Prefab, 83 | displayName: 'smallTankCPre', 84 | }, 85 | midTankAPre: { 86 | default: null, 87 | type: cc.Prefab, 88 | displayName: 'midTankAPre', 89 | }, 90 | midTankBPre: { 91 | default: null, 92 | type: cc.Prefab, 93 | displayName: 'midTankBPre', 94 | }, 95 | midTankCPre: { 96 | default: null, 97 | type: cc.Prefab, 98 | displayName: 'midTankCPre', 99 | }, 100 | heavyTankAPre: { 101 | default: null, 102 | type: cc.Prefab, 103 | displayName: 'heavyTankAPre', 104 | }, 105 | heavyTankBPre: { 106 | default: null, 107 | type: cc.Prefab, 108 | displayName: 'heavyTankBPre', 109 | }, 110 | heavyTankCPre: { 111 | default: null, 112 | type: cc.Prefab, 113 | displayName: 'heavyTankCPre', 114 | }, 115 | _aimTarget: { 116 | default: null, 117 | }, 118 | _myTank: { 119 | default: null, 120 | }, 121 | _bulletPool: { 122 | default: {}, 123 | }, 124 | _gameObjProps: [], 125 | activePlayerMap: [], 126 | activeBulletMap: [], 127 | _serverWorldTime: 0, 128 | _clientWorldTime: 0, 129 | 130 | }, 131 | 132 | // LIFE-CYCLE CALLBACKS: 133 | start() { 134 | console.log("start"); 135 | }, 136 | 137 | onLoad() { 138 | let that = this; 139 | this._aimTarget = { 140 | aimTank: null, 141 | aimx: null, 142 | aimy: null, 143 | angle: null, 144 | } 145 | this._bulletPool = new cc.NodePool(); 146 | for (let i = 0; i < 20; i++) { 147 | let bullet = cc.instantiate(this.bulletPrefab); 148 | this._bulletPool.put(bullet); 149 | } 150 | // 151 | var mySocket = window.mySocket; 152 | mySocket.on('connect', function () { 153 | that.connectStatusTxt.string = ""; 154 | console.log("连接成功"); 155 | }); 156 | mySocket.on('disconnect', function () { 157 | that.connectStatusTxt.string = "Connecting"; 158 | console.log("连接断开"); 159 | }); 160 | mySocket.on('gameUpdate', function (resp) { 161 | var data = resp.data; 162 | that._serverWorldTime = resp.time; 163 | that._clientWorldTime = resp.time; 164 | if (data.length > 0) { 165 | var propObj = {}; 166 | propObj.data = data; 167 | propObj.cnt = 1; 168 | that._gameObjProps.push(propObj); 169 | let len = that._gameObjProps.length; 170 | if (len > 6) { 171 | that._gameObjProps.shift(); 172 | } 173 | } 174 | }); 175 | mySocket.on('slowUpdate', function (data) { 176 | 177 | }); 178 | mySocket.on('heart', function (data) { 179 | console.log(data); 180 | }); 181 | cc.director.on('joystickPlayerClick', function (msg) { 182 | console.log(msg); 183 | }); 184 | cc.director.on('aimTank', function (msg) { 185 | that._onTankTouchEnd(msg); 186 | }); 187 | this.schedule(this._sendJoyStickMoveCallback, 0.1); 188 | this._initKeyEvent(); 189 | this.gameMap.on(cc.Node.EventType.TOUCH_END, this._onMapTouchEnd, this); 190 | }, 191 | onDestroy() { 192 | this.unscheduleAllCallbacks(); 193 | this._deInitKeyEvent(); 194 | }, 195 | _initKeyEvent() { 196 | cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, this._keyDownEvent, this); 197 | cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, this._keyUpEvent, this); 198 | }, 199 | _deInitKeyEvent() { 200 | cc.systemEvent.off(cc.SystemEvent.EventType.KEY_DOWN, this._keyDownEvent, this); 201 | cc.systemEvent.off(cc.SystemEvent.EventType.KEY_UP, this._keyUpEvent, this); 202 | }, 203 | _keyDownEvent(event) { 204 | if (event.keyCode == cc.macro.KEY.space) {} 205 | }, 206 | _keyUpEvent(event) { 207 | if (event.keyCode == cc.macro.KEY.space) { 208 | this.buttonShootClick(); 209 | } 210 | }, 211 | _onMapTouchEnd(event) { 212 | this._aimTarget.aimTank = null; 213 | // pos.x-=(this.gameBg.width/2); 214 | // pos.y-=(this.gameBg.height/2); 215 | // pos=this.gameBg.convertToWorldSpace(pos); 216 | 217 | console.log("ori," + event.getLocation().x + "," + event.getLocation().y); 218 | var pos1 = event.getLocation(); 219 | var pos2 = cc.v2(this.uiCanvas.node.width / 2, this.uiCanvas.node.height / 2); 220 | var pos3 = this.playerCamera.position; 221 | var pos4 = cc.v2(pos1.x - (pos2.x - pos3.x), pos1.y - (pos2.y - pos3.y)); 222 | console.log("canvas," + this.uiCanvas.node.position + "," + this.uiCanvas.node.width + "," + this.uiCanvas.node.height); 223 | console.log("camera," + this.playerCamera.position); 224 | console.log(pos4); 225 | this._aimTarget.aimx = pos4.x; 226 | this._aimTarget.aimy = pos4.y; 227 | 228 | }, 229 | _onTankTouchEnd(tankNode) { 230 | let tankScript = tankNode.getComponent(BaseTank); 231 | let aimUserName = tankScript.getUserName(); 232 | let aimPos=tankScript.getPos(); 233 | if(aimUserName!=null&&aimPos!=null){ 234 | console.log(aimUserName + " " + aimPos); 235 | if (aimUserName == window.myUserName) { 236 | this._aimTarget.aimTank = null; 237 | this._aimTarget.aimx = null; 238 | this._aimTarget.aimy = null; 239 | } else { 240 | this._aimTarget.aimTank = tankScript; 241 | } 242 | } 243 | }, 244 | update(dt) { 245 | let interTime = this._clientWorldTime - this._serverWorldTime; 246 | // console.log(this._clientWorldTime + " - " + this._serverWorldTime + " = " + interTime); 247 | this._clientWorldTime += dt; 248 | this._renderGameObj(); 249 | if (this._myTank != null) { 250 | if (this._aimTarget.aimTank != null) { 251 | //瞄准一个坦克 252 | let posAim = this._aimTarget.aimTank.getPos(); 253 | if(posAim!=null){ 254 | this._aimTarget.aimx = posAim.x; 255 | this._aimTarget.aimy = posAim.y; 256 | }else{ 257 | this._aimTarget.aimTank = null; 258 | this._aimTarget.aimx = null; 259 | this._aimTarget.aimy = null; 260 | } 261 | } 262 | if (this._aimTarget.aimx != null && this._aimTarget.aimy != null) { 263 | this.aimBoomAnim.node.setPosition(this._aimTarget.aimx, this._aimTarget.aimy); 264 | let posMe = this._myTank.getPos(); 265 | if(posMe!=null){ 266 | let dy = this._aimTarget.aimy - posMe.y; 267 | let dx = this._aimTarget.aimx - posMe.x; 268 | let angle = Math.atan2(dy, dx) * (180 / Math.PI); 269 | this._aimTarget.angle = 90 - angle; 270 | this.aimBoomAnim.node.active = true; 271 | let distance = dx * dx + dy * dy; 272 | if (distance > 490000) { 273 | this._aimTarget.aimTank = null; 274 | this._aimTarget.aimx = null; 275 | this._aimTarget.aimy = null; 276 | } 277 | }else{ 278 | this._aimTarget.aimTank = null; 279 | this._aimTarget.aimx = null; 280 | this._aimTarget.aimy = null; 281 | } 282 | } else { 283 | //未瞄准 284 | // this._aimTarget.angle=this._myTank.getAngle(); 285 | this._aimTarget.angle = null; 286 | this.aimBoomAnim.node.active = false; 287 | this.aimBoomAnim.node.setPosition(0, 0); 288 | } 289 | 290 | // if(this._aimTarget.angle!=null){ 291 | // this._myTank.setTowerAngle(this._aimTarget.angle); 292 | // }else{ 293 | // this._myTank.setTowerAngle(this._myTank.getAngle()); 294 | // } 295 | } 296 | }, 297 | buttonShootClick() { 298 | let shootInput = { 299 | userName: window.myUserName, 300 | button: 'shoot', 301 | }; 302 | let mySocket = window.mySocket; 303 | mySocket.emit('userInput', shootInput); 304 | console.log("shoot"); 305 | }, 306 | buttonThunderClick() { 307 | let shootInput = { 308 | userName: window.myUserName, 309 | button: 'thunder', 310 | }; 311 | let mySocket = window.mySocket; 312 | mySocket.emit('userInput', shootInput); 313 | console.log("thunder"); 314 | }, 315 | _sendJoyStickMoveCallback() { 316 | 317 | let mySocket = window.mySocket; 318 | let joyStickMoveData = this.joyStickMove.getInputData(); 319 | this._userInput = { 320 | userName: window.myUserName, 321 | towerAngle: this._aimTarget.angle, 322 | addx: joyStickMoveData.addx, 323 | addy: joyStickMoveData.addy, 324 | bodyAngle: joyStickMoveData.bodyAngle, 325 | }; 326 | mySocket.emit('userInput', this._userInput); 327 | }, 328 | _renderGameObj() { 329 | if (this._gameObjProps != null) { 330 | let size = this._gameObjProps.length; 331 | if (size > 1) { 332 | let propObj = null; 333 | // propObj = this._gameObjProps.shift(); 334 | if (size == 2) { 335 | let prop1 = this._gameObjProps[0].data; 336 | let prop2 = this._gameObjProps[1].data; 337 | let lgcnt = this._gameObjProps[0].cnt; 338 | let rate = 1 - Math.pow(lgcnt + 0.4, -2); 339 | // rate=(lgcnt-1)*0.2+0.2; 340 | let propLerp = this.lerpProps(prop1, prop2, rate); 341 | // console.log("cnt:"+lgcnt+",log:"+rate); 342 | this._gameObjProps[0].cnt += 1; 343 | let propObjLerp = {}; 344 | propObjLerp.data = propLerp; 345 | propObj = propObjLerp; 346 | } else { 347 | this._gameObjProps.shift(); 348 | propObj = this._gameObjProps[0]; 349 | } 350 | let props = propObj.data; 351 | let len = props.length; 352 | let tmpPlayerIds = []; 353 | let tmpBulletIds = []; 354 | //绘制 355 | for (let i = 0; i < len; i++) { 356 | let nowprop = props[i]; 357 | if (nowprop.type == 't') { 358 | tmpPlayerIds[nowprop.id] = 1; 359 | this._renderPlayer(nowprop); 360 | } else if (nowprop.type == 'b') { 361 | tmpBulletIds[nowprop.id] = 1; 362 | this._renderBullet(nowprop); 363 | } 364 | } 365 | //移除已消失的坦克 366 | for (let playerId in this.activePlayerMap) { 367 | let hasPlayerId = tmpPlayerIds[playerId]; 368 | if (hasPlayerId && hasPlayerId != null && hasPlayerId == 1) {} else { 369 | let tankPlayer = this.activePlayerMap[playerId]; 370 | if (tankPlayer!=null) { 371 | if(cc.isValid(tankPlayer.tankNode)){ 372 | tankPlayer.tankNode.removeFromParent(true); 373 | tankPlayer.tankNode.destroy(); 374 | } 375 | if(cc.isValid(tankPlayer.nailTankNode)){ 376 | tankPlayer.nailTankNode.removeFromParent(true); 377 | tankPlayer.nailTankNode.destroy(); 378 | } 379 | this.activePlayerMap[playerId] = null; 380 | } 381 | } 382 | } 383 | //移除已消失的子弹 384 | for (let bulletId in this.activeBulletMap) { 385 | let hasBulletId = tmpBulletIds[bulletId]; 386 | if (hasBulletId && hasBulletId != null && hasBulletId == 1) {} else { 387 | let bulletNode = this.activeBulletMap[bulletId]; 388 | if (cc.isValid(bulletNode)) { 389 | let bulletScript = bulletNode.getComponent(BaseBullet); 390 | bulletScript.hide(); 391 | this._bulletPool.put(bulletNode); 392 | this.activeBulletMap[bulletId] = null; 393 | } 394 | } 395 | } 396 | } 397 | } 398 | }, 399 | _renderBullet(nowprop) { 400 | var bulletNode = this.activeBulletMap[nowprop.id]; 401 | let bulletScript = null; 402 | if (bulletNode == null) { 403 | bulletNode = this._bulletPool.get(); 404 | if (bulletNode == null) { 405 | bulletNode = cc.instantiate(this.bulletPrefab); 406 | } 407 | bulletNode.parent = this.gameBg; 408 | this.activeBulletMap[nowprop.id] = bulletNode; 409 | bulletScript = bulletNode.getComponent(BaseBullet); 410 | bulletScript.setSkin(nowprop.skin); 411 | }else{ 412 | bulletScript = bulletNode.getComponent(BaseBullet); 413 | } 414 | bulletScript.setBulletState(nowprop.state); 415 | bulletScript.setPos(nowprop.x, nowprop.y); 416 | bulletScript.setAngle(90 - nowprop.rad * 180 / Math.PI); 417 | }, 418 | _renderPlayer(nowprop) { 419 | if (nowprop.userName == null) { 420 | return; 421 | } 422 | var tankPlayer = this.activePlayerMap[nowprop.id]; 423 | let tankScript = null; 424 | let nailTankScript = null; 425 | if (tankPlayer == null) { 426 | tankPlayer={}; 427 | var tankNode = this.createTankNode(nowprop.skin); 428 | 429 | var nailTankNode=cc.instantiate(this.nailTankPrefab); 430 | tankPlayer.tankNode=tankNode; 431 | tankPlayer.nailTankNode=nailTankNode; 432 | // 433 | tankScript = tankNode.getComponent(BaseTank); 434 | nailTankScript=nailTankNode.getComponent(NailTank); 435 | // 436 | tankNode.parent = this.gameBg; 437 | nailTankNode.parent=this.gameSmallMap; 438 | // 439 | this.activePlayerMap[nowprop.id] = tankPlayer; 440 | tankScript.setUserName(nowprop.userName); 441 | var colorCode = cc.Color.RED; 442 | colorCode.fromHEX(nowprop.color); 443 | tankScript.setBackColor(colorCode); 444 | if (window.myUserName != null && window.myUserName == nowprop.userName) { 445 | this._myTank = tankScript; 446 | console.log("set my tank"); 447 | nailTankScript.setNailType("me"); 448 | }else{ 449 | nailTankScript.setNailType("enemy"); 450 | } 451 | } else { 452 | tankScript = tankPlayer.tankNode.getComponent(BaseTank); 453 | nailTankScript = tankPlayer.nailTankNode.getComponent(NailTank); 454 | } 455 | tankScript.setPos(nowprop.x, nowprop.y); 456 | // console.log(nowprop.userName+":x"+nowprop.gx+",y"+nowprop.gy); 457 | tankScript.setGridInfo(nowprop.gx,nowprop.gy); 458 | nailTankScript.setPos(nowprop.x*0.05, nowprop.y*0.05); 459 | tankScript.setAngle(90 - nowprop.rad * 180 / Math.PI); 460 | nailTankScript.setAngle(90 - nowprop.rad * 180 / Math.PI); 461 | tankScript.setTowerAngle(90 - nowprop.trad * 180 / Math.PI); 462 | tankScript.setHp(nowprop.hp / nowprop.hpMax); 463 | if (window.myUserName != null && window.myUserName == nowprop.userName) { 464 | this.playerCamera.setPosition(nowprop.x, nowprop.y); 465 | } 466 | //TODO 467 | }, 468 | lateUpdate() { 469 | 470 | }, 471 | createTankNode(skin){ 472 | var tankNode = null; 473 | if(skin){ 474 | if(skin=='sma'){ 475 | tankNode=cc.instantiate(this.smallTankAPre); 476 | }else if(skin=='smb'){ 477 | tankNode=cc.instantiate(this.smallTankBPre); 478 | }else if(skin=='smc'){ 479 | tankNode=cc.instantiate(this.smallTankCPre); 480 | }else if(skin=='mda'){ 481 | tankNode=cc.instantiate(this.midTankAPre); 482 | }else if(skin=='mdb'){ 483 | tankNode=cc.instantiate(this.midTankBPre); 484 | }else if(skin=='mdc'){ 485 | tankNode=cc.instantiate(this.midTankCPre); 486 | }else if(skin=='hva'){ 487 | tankNode=cc.instantiate(this.heavyTankAPre); 488 | }else if(skin=='hvb'){ 489 | tankNode=cc.instantiate(this.heavyTankBPre); 490 | }else if(skin=='hvc'){ 491 | tankNode=cc.instantiate(this.heavyTankCPre); 492 | }else{ 493 | tankNode=cc.instantiate(this.smallTankAPre); 494 | } 495 | }else{ 496 | tankNode=cc.instantiate(this.midTankBPre); 497 | } 498 | return tankNode; 499 | }, 500 | lerpProps(prop1, prop2, rate) { 501 | var propLerp = {}; 502 | var len1 = prop1.length; 503 | var prop3 = []; 504 | for (let i = 0; i < len1; i++) { 505 | let nowProp = prop1[i]; 506 | var oldProp = Object.assign({}, nowProp); 507 | propLerp[nowProp.id] = oldProp; 508 | prop3.push(oldProp); 509 | } 510 | var len2 = prop2.length; 511 | for (let i = 0; i < len2; i++) { 512 | let nowProp = prop2[i]; 513 | var oldProp = propLerp[nowProp.id]; 514 | if (oldProp) { 515 | oldProp.x = (nowProp.x - oldProp.x) * rate + oldProp.x; 516 | oldProp.y = (nowProp.y - oldProp.y) * rate + oldProp.y; 517 | } 518 | } 519 | return prop3; 520 | } 521 | 522 | }); -------------------------------------------------------------------------------- /assets/Texture/tank/tank.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | GunConnectors/GunConnectorA.png 8 | 9 | aliases 10 | 11 | spriteOffset 12 | {0,0} 13 | spriteSize 14 | {52,54} 15 | spriteSourceSize 16 | {256,256} 17 | textureRect 18 | {{838,574},{52,54}} 19 | textureRotated 20 | 21 | 22 | GunConnectors/GunConnectorB.png 23 | 24 | aliases 25 | 26 | spriteOffset 27 | {0,0} 28 | spriteSize 29 | {60,46} 30 | spriteSourceSize 31 | {256,256} 32 | textureRect 33 | {{682,502},{60,46}} 34 | textureRotated 35 | 36 | 37 | GunConnectors/GunConnectorC.png 38 | 39 | aliases 40 | 41 | spriteOffset 42 | {0,0} 43 | spriteSize 44 | {116,38} 45 | spriteSourceSize 46 | {256,256} 47 | textureRect 48 | {{212,218},{116,38}} 49 | textureRotated 50 | 51 | 52 | GunConnectors/GunConnectorD.png 53 | 54 | aliases 55 | 56 | spriteOffset 57 | {0,0} 58 | spriteSize 59 | {108,60} 60 | spriteSourceSize 61 | {256,256} 62 | textureRect 63 | {{622,440},{108,60}} 64 | textureRotated 65 | 66 | 67 | GunConnectors/GunConnectorE.png 68 | 69 | aliases 70 | 71 | spriteOffset 72 | {0,0} 73 | spriteSize 74 | {98,34} 75 | spriteSourceSize 76 | {256,256} 77 | textureRect 78 | {{196,744},{98,34}} 79 | textureRotated 80 | 81 | 82 | Guns/HeavyGunA.png 83 | 84 | aliases 85 | 86 | spriteOffset 87 | {0,0} 88 | spriteSize 89 | {120,200} 90 | spriteSourceSize 91 | {256,256} 92 | textureRect 93 | {{296,690},{120,200}} 94 | textureRotated 95 | 96 | 97 | Guns/HeavyGunB.png 98 | 99 | aliases 100 | 101 | spriteOffset 102 | {0,0} 103 | spriteSize 104 | {114,162} 105 | spriteSourceSize 106 | {256,256} 107 | textureRect 108 | {{786,648},{114,162}} 109 | textureRotated 110 | 111 | 112 | Guns/HeavyGunC.png 113 | 114 | aliases 115 | 116 | spriteOffset 117 | {0,0} 118 | spriteSize 119 | {102,160} 120 | spriteSourceSize 121 | {256,256} 122 | textureRect 123 | {{684,652},{102,160}} 124 | textureRotated 125 | 126 | 127 | Guns/MediumGunA.png 128 | 129 | aliases 130 | 131 | spriteOffset 132 | {0,0} 133 | spriteSize 134 | {64,164} 135 | spriteSourceSize 136 | {256,256} 137 | textureRect 138 | {{622,276},{64,164}} 139 | textureRotated 140 | 141 | 142 | Guns/MediumGunB.png 143 | 144 | aliases 145 | 146 | spriteOffset 147 | {0,0} 148 | spriteSize 149 | {68,164} 150 | spriteSourceSize 151 | {256,256} 152 | textureRect 153 | {{0,744},{68,164}} 154 | textureRotated 155 | 156 | 157 | Guns/MediumGunC.png 158 | 159 | aliases 160 | 161 | spriteOffset 162 | {0,0} 163 | spriteSize 164 | {56,164} 165 | spriteSourceSize 166 | {256,256} 167 | textureRect 168 | {{684,446},{56,164}} 169 | textureRotated 170 | 171 | 172 | Guns/SmallGunA.png 173 | 174 | aliases 175 | 176 | spriteOffset 177 | {-1,1} 178 | spriteSize 179 | {28,98} 180 | spriteSourceSize 181 | {256,256} 182 | textureRect 183 | {{430,660},{28,98}} 184 | textureRotated 185 | 186 | 187 | Guns/SmallGunB.png 188 | 189 | aliases 190 | 191 | spriteOffset 192 | {0,0} 193 | spriteSize 194 | {32,68} 195 | spriteSourceSize 196 | {256,256} 197 | textureRect 198 | {{164,744},{32,68}} 199 | textureRotated 200 | 201 | 202 | Guns/SmallGunC.png 203 | 204 | aliases 205 | 206 | spriteOffset 207 | {-1,0} 208 | spriteSize 209 | {36,88} 210 | spriteSourceSize 211 | {256,256} 212 | textureRect 213 | {{438,214},{36,88}} 214 | textureRotated 215 | 216 | 217 | Hulls/HeavyHullA.png 218 | 219 | aliases 220 | 221 | spriteOffset 222 | {0,0} 223 | spriteSize 224 | {212,256} 225 | spriteSourceSize 226 | {256,256} 227 | textureRect 228 | {{0,0},{212,256}} 229 | textureRotated 230 | 231 | 232 | Hulls/HeavyHullB.png 233 | 234 | aliases 235 | 236 | spriteOffset 237 | {0,0} 238 | spriteSize 239 | {194,232} 240 | spriteSourceSize 241 | {256,256} 242 | textureRect 243 | {{0,512},{194,232}} 244 | textureRotated 245 | 246 | 247 | Hulls/HeavyHullC.png 248 | 249 | aliases 250 | 251 | spriteOffset 252 | {0,0} 253 | spriteSize 254 | {194,256} 255 | spriteSourceSize 256 | {256,256} 257 | textureRect 258 | {{0,256},{194,256}} 259 | textureRotated 260 | 261 | 262 | Hulls/MediumHullA.png 263 | 264 | aliases 265 | 266 | spriteOffset 267 | {0,0} 268 | spriteSize 269 | {120,180} 270 | spriteSourceSize 271 | {256,256} 272 | textureRect 273 | {{570,0},{120,180}} 274 | textureRotated 275 | 276 | 277 | Hulls/MediumHullB.png 278 | 279 | aliases 280 | 281 | spriteOffset 282 | {0,0} 283 | spriteSize 284 | {150,216} 285 | spriteSourceSize 286 | {256,256} 287 | textureRect 288 | {{280,474},{150,216}} 289 | textureRotated 290 | 291 | 292 | Hulls/MediumHullC.png 293 | 294 | aliases 295 | 296 | spriteOffset 297 | {0,0} 298 | spriteSize 299 | {154,178} 300 | spriteSourceSize 301 | {256,256} 302 | textureRect 303 | {{690,0},{154,178}} 304 | textureRotated 305 | 306 | 307 | Hulls/SmallHullA.png 308 | 309 | aliases 310 | 311 | spriteOffset 312 | {0,0} 313 | spriteSize 314 | {136,148} 315 | spriteSourceSize 316 | {256,256} 317 | textureRect 318 | {{868,274},{136,148}} 319 | textureRotated 320 | 321 | 322 | Hulls/SmallHullB.png 323 | 324 | aliases 325 | 326 | spriteOffset 327 | {0,0} 328 | spriteSize 329 | {154,158} 330 | spriteSourceSize 331 | {256,256} 332 | textureRect 333 | {{868,0},{154,158}} 334 | textureRotated 335 | 336 | 337 | Hulls/SmallHullC.png 338 | 339 | aliases 340 | 341 | spriteOffset 342 | {0,0} 343 | spriteSize 344 | {150,156} 345 | spriteSourceSize 346 | {256,256} 347 | textureRect 348 | {{528,660},{150,156}} 349 | textureRotated 350 | 351 | 352 | Light.png 353 | 354 | aliases 355 | 356 | spriteOffset 357 | {1,-1} 358 | spriteSize 359 | {192,192} 360 | spriteSourceSize 361 | {256,256} 362 | textureRect 363 | {{430,468},{192,192}} 364 | textureRotated 365 | 366 | 367 | Projectiles/HeavyShell.png 368 | 369 | aliases 370 | 371 | spriteOffset 372 | {0,0} 373 | spriteSize 374 | {52,102} 375 | spriteSourceSize 376 | {256,256} 377 | textureRect 378 | {{194,692},{52,102}} 379 | textureRotated 380 | 381 | 382 | Projectiles/Laser.png 383 | 384 | aliases 385 | 386 | spriteOffset 387 | {0,0} 388 | spriteSize 389 | {36,110} 390 | spriteSourceSize 391 | {256,256} 392 | textureRect 393 | {{328,218},{36,110}} 394 | textureRotated 395 | 396 | 397 | Projectiles/LightShell.png 398 | 399 | aliases 400 | 401 | spriteOffset 402 | {0,0} 403 | spriteSize 404 | {34,50} 405 | spriteSourceSize 406 | {256,256} 407 | textureRect 408 | {{526,214},{34,50}} 409 | textureRotated 410 | 411 | 412 | Projectiles/MediumShell.png 413 | 414 | aliases 415 | 416 | spriteOffset 417 | {0,0} 418 | spriteSize 419 | {44,70} 420 | spriteSourceSize 421 | {256,256} 422 | textureRect 423 | {{742,502},{44,70}} 424 | textureRotated 425 | 426 | 427 | Projectiles/Plazm.png 428 | 429 | aliases 430 | 431 | spriteOffset 432 | {0,0} 433 | spriteSize 434 | {56,70} 435 | spriteSourceSize 436 | {256,256} 437 | textureRect 438 | {{576,180},{56,70}} 439 | textureRotated 440 | 441 | 442 | Projectiles/Rocket.png 443 | 444 | aliases 445 | 446 | spriteOffset 447 | {0,0} 448 | spriteSize 449 | {58,96} 450 | spriteSourceSize 451 | {256,256} 452 | textureRect 453 | {{632,180},{58,96}} 454 | textureRotated 455 | 456 | 457 | Towers/HeavyTowerA.png 458 | 459 | aliases 460 | 461 | spriteOffset 462 | {0,0} 463 | spriteSize 464 | {178,146} 465 | spriteSourceSize 466 | {256,256} 467 | textureRect 468 | {{690,154},{178,146}} 469 | textureRotated 470 | 471 | 472 | Towers/HeavyTowerB.png 473 | 474 | aliases 475 | 476 | spriteOffset 477 | {0,0} 478 | spriteSize 479 | {166,164} 480 | spriteSourceSize 481 | {256,256} 482 | textureRect 483 | {{854,410},{166,164}} 484 | textureRotated 485 | 486 | 487 | Towers/HeavyTowerC.png 488 | 489 | aliases 490 | 491 | spriteOffset 492 | {0,0} 493 | spriteSize 494 | {188,156} 495 | spriteSourceSize 496 | {256,256} 497 | textureRect 498 | {{466,250},{188,156}} 499 | textureRotated 500 | 501 | 502 | Towers/MediumTowerA.png 503 | 504 | aliases 505 | 506 | spriteOffset 507 | {0,0} 508 | spriteSize 509 | {134,120} 510 | spriteSourceSize 511 | {256,256} 512 | textureRect 513 | {{900,574},{134,120}} 514 | textureRotated 515 | 516 | 517 | Towers/MediumTowerB.png 518 | 519 | aliases 520 | 521 | spriteOffset 522 | {0,0} 523 | spriteSize 524 | {168,146} 525 | spriteSourceSize 526 | {256,256} 527 | textureRect 528 | {{686,300},{168,146}} 529 | textureRotated 530 | 531 | 532 | Towers/MediumTowerC.png 533 | 534 | aliases 535 | 536 | spriteOffset 537 | {0,0} 538 | spriteSize 539 | {116,150} 540 | spriteSourceSize 541 | {256,256} 542 | textureRect 543 | {{868,158},{116,150}} 544 | textureRotated 545 | 546 | 547 | Towers/SmallTowerA.png 548 | 549 | aliases 550 | 551 | spriteOffset 552 | {0,0} 553 | spriteSize 554 | {98,98} 555 | spriteSourceSize 556 | {256,256} 557 | textureRect 558 | {{900,708},{98,98}} 559 | textureRotated 560 | 561 | 562 | Towers/SmallTowerB.png 563 | 564 | aliases 565 | 566 | spriteOffset 567 | {0,0} 568 | spriteSize 569 | {114,100} 570 | spriteSourceSize 571 | {256,256} 572 | textureRect 573 | {{724,548},{114,100}} 574 | textureRotated 575 | 576 | 577 | Towers/SmallTowerC.png 578 | 579 | aliases 580 | 581 | spriteOffset 582 | {0,1} 583 | spriteSize 584 | {102,104} 585 | spriteSourceSize 586 | {256,256} 587 | textureRect 588 | {{622,548},{102,104}} 589 | textureRotated 590 | 591 | 592 | Tracks/TrackAFrame1.png 593 | 594 | aliases 595 | 596 | spriteOffset 597 | {-1,1} 598 | spriteSize 599 | {90,218} 600 | spriteSourceSize 601 | {256,256} 602 | textureRect 603 | {{194,256},{90,218}} 604 | textureRotated 605 | 606 | 607 | Tracks/TrackAFrame2.png 608 | 609 | aliases 610 | 611 | spriteOffset 612 | {-1,1} 613 | spriteSize 614 | {90,218} 615 | spriteSourceSize 616 | {256,256} 617 | textureRect 618 | {{212,0},{90,218}} 619 | textureRotated 620 | 621 | 622 | Tracks/TrackBFrame1.png 623 | 624 | aliases 625 | 626 | spriteOffset 627 | {0,0} 628 | spriteSize 629 | {86,218} 630 | spriteSourceSize 631 | {256,256} 632 | textureRect 633 | {{302,0},{86,218}} 634 | textureRotated 635 | 636 | 637 | Tracks/TrackBFrame2.png 638 | 639 | aliases 640 | 641 | spriteOffset 642 | {0,0} 643 | spriteSize 644 | {86,218} 645 | spriteSourceSize 646 | {256,256} 647 | textureRect 648 | {{194,474},{86,218}} 649 | textureRotated 650 | 651 | 652 | Tracks/TrackDFrame1.png 653 | 654 | aliases 655 | 656 | spriteOffset 657 | {0,0} 658 | spriteSize 659 | {88,214} 660 | spriteSourceSize 661 | {256,256} 662 | textureRect 663 | {{378,254},{88,214}} 664 | textureRotated 665 | 666 | 667 | Tracks/TrackDFrame2.png 668 | 669 | aliases 670 | 671 | spriteOffset 672 | {0,0} 673 | spriteSize 674 | {88,214} 675 | spriteSourceSize 676 | {256,256} 677 | textureRect 678 | {{482,0},{88,214}} 679 | textureRotated 680 | 681 | 682 | Tracks/TrackСFrame1.png 683 | 684 | aliases 685 | 686 | spriteOffset 687 | {0,0} 688 | spriteSize 689 | {94,214} 690 | spriteSourceSize 691 | {256,256} 692 | textureRect 693 | {{284,256},{94,214}} 694 | textureRotated 695 | 696 | 697 | Tracks/TrackСFrame2.png 698 | 699 | aliases 700 | 701 | spriteOffset 702 | {0,0} 703 | spriteSize 704 | {94,214} 705 | spriteSourceSize 706 | {256,256} 707 | textureRect 708 | {{388,0},{94,214}} 709 | textureRotated 710 | 711 | 712 | blood/bloodd.png 713 | 714 | aliases 715 | 716 | spriteOffset 717 | {0,0} 718 | spriteSize 719 | {92,18} 720 | spriteSourceSize 721 | {92,18} 722 | textureRect 723 | {{496,688},{92,18}} 724 | textureRotated 725 | 726 | 727 | blood/myblood.png 728 | 729 | aliases 730 | 731 | spriteOffset 732 | {0,0} 733 | spriteSize 734 | {92,18} 735 | spriteSourceSize 736 | {92,18} 737 | textureRect 738 | {{466,438},{92,18}} 739 | textureRotated 740 | 741 | 742 | nail/small_enemy.png 743 | 744 | aliases 745 | 746 | spriteOffset 747 | {0,0} 748 | spriteSize 749 | {35,44} 750 | spriteSourceSize 751 | {35,46} 752 | textureRect 753 | {{196,778},{35,44}} 754 | textureRotated 755 | 756 | 757 | nail/small_me.png 758 | 759 | aliases 760 | 761 | spriteOffset 762 | {0,0} 763 | spriteSize 764 | {35,44} 765 | spriteSourceSize 766 | {35,46} 767 | textureRect 768 | {{240,778},{35,44}} 769 | textureRotated 770 | 771 | 772 | 773 | metadata 774 | 775 | format 776 | 3 777 | pixelFormat 778 | RGBA8888 779 | premultiplyAlpha 780 | 781 | realTextureFileName 782 | tank.png 783 | size 784 | {1022,813} 785 | smartupdate 786 | $TexturePacker:SmartUpdate:8c506699defdbf69267319d6f1454e97:ab66b0f905de9e15a48f1685011175a0:61f327f8e64f826627a60724782c709f$ 787 | textureFileName 788 | tank.png 789 | 790 | 791 | 792 | -------------------------------------------------------------------------------- /assets/widget/tank/tank/SmallTankA.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "data": { 8 | "__id__": 1 9 | }, 10 | "optimizationPolicy": 0, 11 | "asyncLoadAssets": false 12 | }, 13 | { 14 | "__type__": "cc.Node", 15 | "_name": "SmallTankA", 16 | "_objFlags": 0, 17 | "_parent": null, 18 | "_children": [ 19 | { 20 | "__id__": 2 21 | }, 22 | { 23 | "__id__": 5 24 | }, 25 | { 26 | "__id__": 19 27 | }, 28 | { 29 | "__id__": 30 30 | }, 31 | { 32 | "__id__": 37 33 | } 34 | ], 35 | "_active": true, 36 | "_level": 1, 37 | "_components": [ 38 | { 39 | "__id__": 40 40 | } 41 | ], 42 | "_prefab": { 43 | "__id__": 41 44 | }, 45 | "_opacity": 255, 46 | "_color": { 47 | "__type__": "cc.Color", 48 | "r": 255, 49 | "g": 255, 50 | "b": 255, 51 | "a": 255 52 | }, 53 | "_contentSize": { 54 | "__type__": "cc.Size", 55 | "width": 0, 56 | "height": 0 57 | }, 58 | "_anchorPoint": { 59 | "__type__": "cc.Vec2", 60 | "x": 0.5, 61 | "y": 0.5 62 | }, 63 | "_position": { 64 | "__type__": "cc.Vec3", 65 | "x": 75.6, 66 | "y": 0, 67 | "z": 0 68 | }, 69 | "_scale": { 70 | "__type__": "cc.Vec3", 71 | "x": 0.2, 72 | "y": 0.2, 73 | "z": 1 74 | }, 75 | "_rotationX": 0, 76 | "_rotationY": 0, 77 | "_skewX": 0, 78 | "_skewY": 0, 79 | "groupIndex": 0, 80 | "_id": "", 81 | "_eulerAngles": { 82 | "__type__": "cc.Vec3", 83 | "x": 0, 84 | "y": 0, 85 | "z": 0 86 | } 87 | }, 88 | { 89 | "__type__": "cc.Node", 90 | "_name": "UserNameTxt", 91 | "_objFlags": 0, 92 | "_parent": { 93 | "__id__": 1 94 | }, 95 | "_children": [], 96 | "_active": false, 97 | "_level": 2, 98 | "_components": [ 99 | { 100 | "__id__": 3 101 | } 102 | ], 103 | "_prefab": { 104 | "__id__": 4 105 | }, 106 | "_opacity": 255, 107 | "_color": { 108 | "__type__": "cc.Color", 109 | "r": 255, 110 | "g": 255, 111 | "b": 255, 112 | "a": 255 113 | }, 114 | "_contentSize": { 115 | "__type__": "cc.Size", 116 | "width": 223.51, 117 | "height": 60 118 | }, 119 | "_anchorPoint": { 120 | "__type__": "cc.Vec2", 121 | "x": 0.5, 122 | "y": 0.5 123 | }, 124 | "_position": { 125 | "__type__": "cc.Vec3", 126 | "x": 0, 127 | "y": 220, 128 | "z": 0 129 | }, 130 | "_scale": { 131 | "__type__": "cc.Vec3", 132 | "x": 1, 133 | "y": 1, 134 | "z": 1 135 | }, 136 | "_rotationX": 0, 137 | "_rotationY": 0, 138 | "_skewX": 0, 139 | "_skewY": 0, 140 | "groupIndex": 0, 141 | "_id": "", 142 | "_eulerAngles": { 143 | "__type__": "cc.Vec3", 144 | "x": 0, 145 | "y": 0, 146 | "z": 0 147 | } 148 | }, 149 | { 150 | "__type__": "cc.Label", 151 | "_name": "", 152 | "_objFlags": 0, 153 | "node": { 154 | "__id__": 2 155 | }, 156 | "_enabled": true, 157 | "_useOriginalSize": false, 158 | "_string": "liyunhan", 159 | "_N$string": "liyunhan", 160 | "_fontSize": 60, 161 | "_lineHeight": 60, 162 | "_enableWrapText": true, 163 | "_N$file": null, 164 | "_isSystemFontUsed": true, 165 | "_spacingX": 0, 166 | "_batchAsBitmap": false, 167 | "_N$horizontalAlign": 1, 168 | "_N$verticalAlign": 1, 169 | "_N$fontFamily": "Arial", 170 | "_N$overflow": 0, 171 | "_N$cacheMode": 0, 172 | "_id": "" 173 | }, 174 | { 175 | "__type__": "cc.PrefabInfo", 176 | "root": { 177 | "__id__": 1 178 | }, 179 | "asset": { 180 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 181 | }, 182 | "fileId": "eeAz0SG25J5YqCbneG8GIY", 183 | "sync": false 184 | }, 185 | { 186 | "__type__": "cc.Node", 187 | "_name": "TankNode", 188 | "_objFlags": 0, 189 | "_parent": { 190 | "__id__": 1 191 | }, 192 | "_children": [ 193 | { 194 | "__id__": 6 195 | }, 196 | { 197 | "__id__": 9 198 | }, 199 | { 200 | "__id__": 12 201 | }, 202 | { 203 | "__id__": 15 204 | } 205 | ], 206 | "_active": true, 207 | "_level": 2, 208 | "_components": [], 209 | "_prefab": { 210 | "__id__": 18 211 | }, 212 | "_opacity": 255, 213 | "_color": { 214 | "__type__": "cc.Color", 215 | "r": 255, 216 | "g": 255, 217 | "b": 255, 218 | "a": 255 219 | }, 220 | "_contentSize": { 221 | "__type__": "cc.Size", 222 | "width": 0, 223 | "height": 0 224 | }, 225 | "_anchorPoint": { 226 | "__type__": "cc.Vec2", 227 | "x": 0.5, 228 | "y": 0.5 229 | }, 230 | "_position": { 231 | "__type__": "cc.Vec3", 232 | "x": 0, 233 | "y": 0, 234 | "z": 0 235 | }, 236 | "_scale": { 237 | "__type__": "cc.Vec3", 238 | "x": 1, 239 | "y": 1, 240 | "z": 1 241 | }, 242 | "_rotationX": 0, 243 | "_rotationY": 0, 244 | "_skewX": 0, 245 | "_skewY": 0, 246 | "groupIndex": 0, 247 | "_id": "", 248 | "_eulerAngles": { 249 | "__type__": "cc.Vec3", 250 | "x": 0, 251 | "y": 0, 252 | "z": 0 253 | } 254 | }, 255 | { 256 | "__type__": "cc.Node", 257 | "_name": "Light", 258 | "_objFlags": 0, 259 | "_parent": { 260 | "__id__": 5 261 | }, 262 | "_children": [], 263 | "_active": true, 264 | "_level": 3, 265 | "_components": [ 266 | { 267 | "__id__": 7 268 | } 269 | ], 270 | "_prefab": { 271 | "__id__": 8 272 | }, 273 | "_opacity": 255, 274 | "_color": { 275 | "__type__": "cc.Color", 276 | "r": 0, 277 | "g": 74, 278 | "b": 255, 279 | "a": 255 280 | }, 281 | "_contentSize": { 282 | "__type__": "cc.Size", 283 | "width": 192, 284 | "height": 192 285 | }, 286 | "_anchorPoint": { 287 | "__type__": "cc.Vec2", 288 | "x": 0.5, 289 | "y": 0.5 290 | }, 291 | "_position": { 292 | "__type__": "cc.Vec3", 293 | "x": 0, 294 | "y": 0, 295 | "z": 0 296 | }, 297 | "_scale": { 298 | "__type__": "cc.Vec3", 299 | "x": 3, 300 | "y": 3, 301 | "z": 1 302 | }, 303 | "_rotationX": 0, 304 | "_rotationY": 0, 305 | "_skewX": 0, 306 | "_skewY": 0, 307 | "groupIndex": 0, 308 | "_id": "", 309 | "_eulerAngles": { 310 | "__type__": "cc.Vec3", 311 | "x": 0, 312 | "y": 0, 313 | "z": 0 314 | } 315 | }, 316 | { 317 | "__type__": "cc.Sprite", 318 | "_name": "", 319 | "_objFlags": 0, 320 | "node": { 321 | "__id__": 6 322 | }, 323 | "_enabled": true, 324 | "_spriteFrame": { 325 | "__uuid__": "4f51deb8-112f-4e30-a0a9-cb5b532f66dc" 326 | }, 327 | "_type": 0, 328 | "_sizeMode": 1, 329 | "_fillType": 0, 330 | "_fillCenter": { 331 | "__type__": "cc.Vec2", 332 | "x": 0, 333 | "y": 0 334 | }, 335 | "_fillStart": 0, 336 | "_fillRange": 0, 337 | "_isTrimmedMode": true, 338 | "_state": 0, 339 | "_atlas": { 340 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 341 | }, 342 | "_srcBlendFactor": 770, 343 | "_dstBlendFactor": 771, 344 | "_id": "" 345 | }, 346 | { 347 | "__type__": "cc.PrefabInfo", 348 | "root": { 349 | "__id__": 1 350 | }, 351 | "asset": { 352 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 353 | }, 354 | "fileId": "36RxbHnxhB/4z6lWRAVO7O", 355 | "sync": false 356 | }, 357 | { 358 | "__type__": "cc.Node", 359 | "_name": "Track", 360 | "_objFlags": 0, 361 | "_parent": { 362 | "__id__": 5 363 | }, 364 | "_children": [], 365 | "_active": true, 366 | "_level": 3, 367 | "_components": [ 368 | { 369 | "__id__": 10 370 | } 371 | ], 372 | "_prefab": { 373 | "__id__": 11 374 | }, 375 | "_opacity": 255, 376 | "_color": { 377 | "__type__": "cc.Color", 378 | "r": 255, 379 | "g": 255, 380 | "b": 255, 381 | "a": 255 382 | }, 383 | "_contentSize": { 384 | "__type__": "cc.Size", 385 | "width": 90, 386 | "height": 218 387 | }, 388 | "_anchorPoint": { 389 | "__type__": "cc.Vec2", 390 | "x": 0.5, 391 | "y": 0.5 392 | }, 393 | "_position": { 394 | "__type__": "cc.Vec3", 395 | "x": -64, 396 | "y": 0, 397 | "z": 0 398 | }, 399 | "_scale": { 400 | "__type__": "cc.Vec3", 401 | "x": 1, 402 | "y": 1, 403 | "z": 1 404 | }, 405 | "_rotationX": 0, 406 | "_rotationY": 0, 407 | "_skewX": 0, 408 | "_skewY": 0, 409 | "groupIndex": 0, 410 | "_id": "", 411 | "_eulerAngles": { 412 | "__type__": "cc.Vec3", 413 | "x": 0, 414 | "y": 0, 415 | "z": 0 416 | } 417 | }, 418 | { 419 | "__type__": "cc.Sprite", 420 | "_name": "", 421 | "_objFlags": 0, 422 | "node": { 423 | "__id__": 9 424 | }, 425 | "_enabled": true, 426 | "_spriteFrame": { 427 | "__uuid__": "6e76ce5f-d6d4-4412-8a3d-998c041dd6d3" 428 | }, 429 | "_type": 0, 430 | "_sizeMode": 1, 431 | "_fillType": 0, 432 | "_fillCenter": { 433 | "__type__": "cc.Vec2", 434 | "x": 0, 435 | "y": 0 436 | }, 437 | "_fillStart": 0, 438 | "_fillRange": 0, 439 | "_isTrimmedMode": true, 440 | "_state": 0, 441 | "_atlas": { 442 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 443 | }, 444 | "_srcBlendFactor": 770, 445 | "_dstBlendFactor": 771, 446 | "_id": "" 447 | }, 448 | { 449 | "__type__": "cc.PrefabInfo", 450 | "root": { 451 | "__id__": 1 452 | }, 453 | "asset": { 454 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 455 | }, 456 | "fileId": "3d3jnT2RdLm4YroCE8Livg", 457 | "sync": false 458 | }, 459 | { 460 | "__type__": "cc.Node", 461 | "_name": "Track", 462 | "_objFlags": 0, 463 | "_parent": { 464 | "__id__": 5 465 | }, 466 | "_children": [], 467 | "_active": true, 468 | "_level": 3, 469 | "_components": [ 470 | { 471 | "__id__": 13 472 | } 473 | ], 474 | "_prefab": { 475 | "__id__": 14 476 | }, 477 | "_opacity": 255, 478 | "_color": { 479 | "__type__": "cc.Color", 480 | "r": 255, 481 | "g": 255, 482 | "b": 255, 483 | "a": 255 484 | }, 485 | "_contentSize": { 486 | "__type__": "cc.Size", 487 | "width": 90, 488 | "height": 218 489 | }, 490 | "_anchorPoint": { 491 | "__type__": "cc.Vec2", 492 | "x": 0.5, 493 | "y": 0.5 494 | }, 495 | "_position": { 496 | "__type__": "cc.Vec3", 497 | "x": 64, 498 | "y": 0, 499 | "z": 0 500 | }, 501 | "_scale": { 502 | "__type__": "cc.Vec3", 503 | "x": 1, 504 | "y": 1, 505 | "z": 1 506 | }, 507 | "_rotationX": 0, 508 | "_rotationY": 0, 509 | "_skewX": 0, 510 | "_skewY": 0, 511 | "groupIndex": 0, 512 | "_id": "", 513 | "_eulerAngles": { 514 | "__type__": "cc.Vec3", 515 | "x": 0, 516 | "y": 0, 517 | "z": 0 518 | } 519 | }, 520 | { 521 | "__type__": "cc.Sprite", 522 | "_name": "", 523 | "_objFlags": 0, 524 | "node": { 525 | "__id__": 12 526 | }, 527 | "_enabled": true, 528 | "_spriteFrame": { 529 | "__uuid__": "6e76ce5f-d6d4-4412-8a3d-998c041dd6d3" 530 | }, 531 | "_type": 0, 532 | "_sizeMode": 1, 533 | "_fillType": 0, 534 | "_fillCenter": { 535 | "__type__": "cc.Vec2", 536 | "x": 0, 537 | "y": 0 538 | }, 539 | "_fillStart": 0, 540 | "_fillRange": 0, 541 | "_isTrimmedMode": true, 542 | "_state": 0, 543 | "_atlas": { 544 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 545 | }, 546 | "_srcBlendFactor": 770, 547 | "_dstBlendFactor": 771, 548 | "_id": "" 549 | }, 550 | { 551 | "__type__": "cc.PrefabInfo", 552 | "root": { 553 | "__id__": 1 554 | }, 555 | "asset": { 556 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 557 | }, 558 | "fileId": "4duz04e3xOwZQCXEoOpD4T", 559 | "sync": false 560 | }, 561 | { 562 | "__type__": "cc.Node", 563 | "_name": "Hull", 564 | "_objFlags": 0, 565 | "_parent": { 566 | "__id__": 5 567 | }, 568 | "_children": [], 569 | "_active": true, 570 | "_level": 3, 571 | "_components": [ 572 | { 573 | "__id__": 16 574 | } 575 | ], 576 | "_prefab": { 577 | "__id__": 17 578 | }, 579 | "_opacity": 255, 580 | "_color": { 581 | "__type__": "cc.Color", 582 | "r": 255, 583 | "g": 255, 584 | "b": 255, 585 | "a": 255 586 | }, 587 | "_contentSize": { 588 | "__type__": "cc.Size", 589 | "width": 136, 590 | "height": 148 591 | }, 592 | "_anchorPoint": { 593 | "__type__": "cc.Vec2", 594 | "x": 0.5, 595 | "y": 0.5 596 | }, 597 | "_position": { 598 | "__type__": "cc.Vec3", 599 | "x": 0, 600 | "y": 0, 601 | "z": 0 602 | }, 603 | "_scale": { 604 | "__type__": "cc.Vec3", 605 | "x": 1, 606 | "y": 1, 607 | "z": 1 608 | }, 609 | "_rotationX": 0, 610 | "_rotationY": 0, 611 | "_skewX": 0, 612 | "_skewY": 0, 613 | "groupIndex": 0, 614 | "_id": "", 615 | "_eulerAngles": { 616 | "__type__": "cc.Vec3", 617 | "x": 0, 618 | "y": 0, 619 | "z": 0 620 | } 621 | }, 622 | { 623 | "__type__": "cc.Sprite", 624 | "_name": "", 625 | "_objFlags": 0, 626 | "node": { 627 | "__id__": 15 628 | }, 629 | "_enabled": true, 630 | "_spriteFrame": { 631 | "__uuid__": "0677ccfb-dadc-40ab-b866-6b97991f4533" 632 | }, 633 | "_type": 0, 634 | "_sizeMode": 1, 635 | "_fillType": 0, 636 | "_fillCenter": { 637 | "__type__": "cc.Vec2", 638 | "x": 0, 639 | "y": 0 640 | }, 641 | "_fillStart": 0, 642 | "_fillRange": 0, 643 | "_isTrimmedMode": true, 644 | "_state": 0, 645 | "_atlas": { 646 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 647 | }, 648 | "_srcBlendFactor": 770, 649 | "_dstBlendFactor": 771, 650 | "_id": "" 651 | }, 652 | { 653 | "__type__": "cc.PrefabInfo", 654 | "root": { 655 | "__id__": 1 656 | }, 657 | "asset": { 658 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 659 | }, 660 | "fileId": "c5Qa+spQhJvY3gtEDc1Wr7", 661 | "sync": false 662 | }, 663 | { 664 | "__type__": "cc.PrefabInfo", 665 | "root": { 666 | "__id__": 1 667 | }, 668 | "asset": { 669 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 670 | }, 671 | "fileId": "09Cy9KON1OnKNu4ZPjwE5i", 672 | "sync": false 673 | }, 674 | { 675 | "__type__": "cc.Node", 676 | "_name": "Tower", 677 | "_objFlags": 0, 678 | "_parent": { 679 | "__id__": 1 680 | }, 681 | "_children": [ 682 | { 683 | "__id__": 20 684 | }, 685 | { 686 | "__id__": 23 687 | }, 688 | { 689 | "__id__": 26 690 | } 691 | ], 692 | "_active": true, 693 | "_level": 2, 694 | "_components": [], 695 | "_prefab": { 696 | "__id__": 29 697 | }, 698 | "_opacity": 255, 699 | "_color": { 700 | "__type__": "cc.Color", 701 | "r": 255, 702 | "g": 255, 703 | "b": 255, 704 | "a": 255 705 | }, 706 | "_contentSize": { 707 | "__type__": "cc.Size", 708 | "width": 0, 709 | "height": 0 710 | }, 711 | "_anchorPoint": { 712 | "__type__": "cc.Vec2", 713 | "x": 0.5, 714 | "y": 0.5 715 | }, 716 | "_position": { 717 | "__type__": "cc.Vec3", 718 | "x": 0, 719 | "y": 0, 720 | "z": 0 721 | }, 722 | "_scale": { 723 | "__type__": "cc.Vec3", 724 | "x": 1, 725 | "y": 1, 726 | "z": 1 727 | }, 728 | "_rotationX": 0, 729 | "_rotationY": 0, 730 | "_skewX": 0, 731 | "_skewY": 0, 732 | "groupIndex": 0, 733 | "_id": "", 734 | "_eulerAngles": { 735 | "__type__": "cc.Vec3", 736 | "x": 0, 737 | "y": 0, 738 | "z": 0 739 | } 740 | }, 741 | { 742 | "__type__": "cc.Node", 743 | "_name": "Gun", 744 | "_objFlags": 0, 745 | "_parent": { 746 | "__id__": 19 747 | }, 748 | "_children": [], 749 | "_active": true, 750 | "_level": 3, 751 | "_components": [ 752 | { 753 | "__id__": 21 754 | } 755 | ], 756 | "_prefab": { 757 | "__id__": 22 758 | }, 759 | "_opacity": 255, 760 | "_color": { 761 | "__type__": "cc.Color", 762 | "r": 255, 763 | "g": 255, 764 | "b": 255, 765 | "a": 255 766 | }, 767 | "_contentSize": { 768 | "__type__": "cc.Size", 769 | "width": 28, 770 | "height": 98 771 | }, 772 | "_anchorPoint": { 773 | "__type__": "cc.Vec2", 774 | "x": 0.5, 775 | "y": 0.5 776 | }, 777 | "_position": { 778 | "__type__": "cc.Vec3", 779 | "x": -0.5, 780 | "y": 127, 781 | "z": 0 782 | }, 783 | "_scale": { 784 | "__type__": "cc.Vec3", 785 | "x": 1, 786 | "y": 1, 787 | "z": 1 788 | }, 789 | "_rotationX": 0, 790 | "_rotationY": 0, 791 | "_skewX": 0, 792 | "_skewY": 0, 793 | "groupIndex": 0, 794 | "_id": "", 795 | "_eulerAngles": { 796 | "__type__": "cc.Vec3", 797 | "x": 0, 798 | "y": 0, 799 | "z": 0 800 | } 801 | }, 802 | { 803 | "__type__": "cc.Sprite", 804 | "_name": "", 805 | "_objFlags": 0, 806 | "node": { 807 | "__id__": 20 808 | }, 809 | "_enabled": true, 810 | "_spriteFrame": { 811 | "__uuid__": "8f32c481-0321-4a21-bb45-4687592c3f85" 812 | }, 813 | "_type": 0, 814 | "_sizeMode": 1, 815 | "_fillType": 0, 816 | "_fillCenter": { 817 | "__type__": "cc.Vec2", 818 | "x": 0, 819 | "y": 0 820 | }, 821 | "_fillStart": 0, 822 | "_fillRange": 0, 823 | "_isTrimmedMode": true, 824 | "_state": 0, 825 | "_atlas": { 826 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 827 | }, 828 | "_srcBlendFactor": 770, 829 | "_dstBlendFactor": 771, 830 | "_id": "" 831 | }, 832 | { 833 | "__type__": "cc.PrefabInfo", 834 | "root": { 835 | "__id__": 1 836 | }, 837 | "asset": { 838 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 839 | }, 840 | "fileId": "dcSgMULxpGP4x9bzOMtjz+", 841 | "sync": false 842 | }, 843 | { 844 | "__type__": "cc.Node", 845 | "_name": "GunConnector", 846 | "_objFlags": 0, 847 | "_parent": { 848 | "__id__": 19 849 | }, 850 | "_children": [], 851 | "_active": true, 852 | "_level": 3, 853 | "_components": [ 854 | { 855 | "__id__": 24 856 | } 857 | ], 858 | "_prefab": { 859 | "__id__": 25 860 | }, 861 | "_opacity": 255, 862 | "_color": { 863 | "__type__": "cc.Color", 864 | "r": 255, 865 | "g": 255, 866 | "b": 255, 867 | "a": 255 868 | }, 869 | "_contentSize": { 870 | "__type__": "cc.Size", 871 | "width": 60, 872 | "height": 46 873 | }, 874 | "_anchorPoint": { 875 | "__type__": "cc.Vec2", 876 | "x": 0.5, 877 | "y": 0.5 878 | }, 879 | "_position": { 880 | "__type__": "cc.Vec3", 881 | "x": 0, 882 | "y": 66, 883 | "z": 0 884 | }, 885 | "_scale": { 886 | "__type__": "cc.Vec3", 887 | "x": 1, 888 | "y": 1, 889 | "z": 1 890 | }, 891 | "_rotationX": 0, 892 | "_rotationY": 0, 893 | "_skewX": 0, 894 | "_skewY": 0, 895 | "groupIndex": 0, 896 | "_id": "", 897 | "_eulerAngles": { 898 | "__type__": "cc.Vec3", 899 | "x": 0, 900 | "y": 0, 901 | "z": 0 902 | } 903 | }, 904 | { 905 | "__type__": "cc.Sprite", 906 | "_name": "", 907 | "_objFlags": 0, 908 | "node": { 909 | "__id__": 23 910 | }, 911 | "_enabled": true, 912 | "_spriteFrame": { 913 | "__uuid__": "fbabd325-0b56-49c5-b501-1d8cd6cd2b7c" 914 | }, 915 | "_type": 0, 916 | "_sizeMode": 1, 917 | "_fillType": 0, 918 | "_fillCenter": { 919 | "__type__": "cc.Vec2", 920 | "x": 0, 921 | "y": 0 922 | }, 923 | "_fillStart": 0, 924 | "_fillRange": 0, 925 | "_isTrimmedMode": true, 926 | "_state": 0, 927 | "_atlas": { 928 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 929 | }, 930 | "_srcBlendFactor": 770, 931 | "_dstBlendFactor": 771, 932 | "_id": "" 933 | }, 934 | { 935 | "__type__": "cc.PrefabInfo", 936 | "root": { 937 | "__id__": 1 938 | }, 939 | "asset": { 940 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 941 | }, 942 | "fileId": "a30/XdwDRDLZ+WeZtaqNST", 943 | "sync": false 944 | }, 945 | { 946 | "__type__": "cc.Node", 947 | "_name": "Tower", 948 | "_objFlags": 0, 949 | "_parent": { 950 | "__id__": 19 951 | }, 952 | "_children": [], 953 | "_active": true, 954 | "_level": 3, 955 | "_components": [ 956 | { 957 | "__id__": 27 958 | } 959 | ], 960 | "_prefab": { 961 | "__id__": 28 962 | }, 963 | "_opacity": 255, 964 | "_color": { 965 | "__type__": "cc.Color", 966 | "r": 255, 967 | "g": 255, 968 | "b": 255, 969 | "a": 255 970 | }, 971 | "_contentSize": { 972 | "__type__": "cc.Size", 973 | "width": 98, 974 | "height": 98 975 | }, 976 | "_anchorPoint": { 977 | "__type__": "cc.Vec2", 978 | "x": 0.5, 979 | "y": 0.5 980 | }, 981 | "_position": { 982 | "__type__": "cc.Vec3", 983 | "x": 0, 984 | "y": 0, 985 | "z": 0 986 | }, 987 | "_scale": { 988 | "__type__": "cc.Vec3", 989 | "x": 1, 990 | "y": 1, 991 | "z": 1 992 | }, 993 | "_rotationX": 0, 994 | "_rotationY": 0, 995 | "_skewX": 0, 996 | "_skewY": 0, 997 | "groupIndex": 0, 998 | "_id": "", 999 | "_eulerAngles": { 1000 | "__type__": "cc.Vec3", 1001 | "x": 0, 1002 | "y": 0, 1003 | "z": 0 1004 | } 1005 | }, 1006 | { 1007 | "__type__": "cc.Sprite", 1008 | "_name": "", 1009 | "_objFlags": 0, 1010 | "node": { 1011 | "__id__": 26 1012 | }, 1013 | "_enabled": true, 1014 | "_spriteFrame": { 1015 | "__uuid__": "e236518d-ab20-40cb-9a70-2adbbb96a5e7" 1016 | }, 1017 | "_type": 0, 1018 | "_sizeMode": 1, 1019 | "_fillType": 0, 1020 | "_fillCenter": { 1021 | "__type__": "cc.Vec2", 1022 | "x": 0, 1023 | "y": 0 1024 | }, 1025 | "_fillStart": 0, 1026 | "_fillRange": 0, 1027 | "_isTrimmedMode": true, 1028 | "_state": 0, 1029 | "_atlas": { 1030 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 1031 | }, 1032 | "_srcBlendFactor": 770, 1033 | "_dstBlendFactor": 771, 1034 | "_id": "" 1035 | }, 1036 | { 1037 | "__type__": "cc.PrefabInfo", 1038 | "root": { 1039 | "__id__": 1 1040 | }, 1041 | "asset": { 1042 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 1043 | }, 1044 | "fileId": "a82PszCxVFc5WAQT2fereW", 1045 | "sync": false 1046 | }, 1047 | { 1048 | "__type__": "cc.PrefabInfo", 1049 | "root": { 1050 | "__id__": 1 1051 | }, 1052 | "asset": { 1053 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 1054 | }, 1055 | "fileId": "55oxU08fBHk7Lth22sE7pF", 1056 | "sync": false 1057 | }, 1058 | { 1059 | "__type__": "cc.Node", 1060 | "_name": "progressBar", 1061 | "_objFlags": 0, 1062 | "_parent": { 1063 | "__id__": 1 1064 | }, 1065 | "_children": [ 1066 | { 1067 | "__id__": 31 1068 | } 1069 | ], 1070 | "_active": true, 1071 | "_level": 2, 1072 | "_components": [ 1073 | { 1074 | "__id__": 34 1075 | }, 1076 | { 1077 | "__id__": 35 1078 | } 1079 | ], 1080 | "_prefab": { 1081 | "__id__": 36 1082 | }, 1083 | "_opacity": 255, 1084 | "_color": { 1085 | "__type__": "cc.Color", 1086 | "r": 255, 1087 | "g": 255, 1088 | "b": 255, 1089 | "a": 255 1090 | }, 1091 | "_contentSize": { 1092 | "__type__": "cc.Size", 1093 | "width": 300, 1094 | "height": 30 1095 | }, 1096 | "_anchorPoint": { 1097 | "__type__": "cc.Vec2", 1098 | "x": 0.5, 1099 | "y": 0.5 1100 | }, 1101 | "_position": { 1102 | "__type__": "cc.Vec3", 1103 | "x": 0, 1104 | "y": -166.5, 1105 | "z": 0 1106 | }, 1107 | "_scale": { 1108 | "__type__": "cc.Vec3", 1109 | "x": 1, 1110 | "y": 1, 1111 | "z": 1 1112 | }, 1113 | "_rotationX": 0, 1114 | "_rotationY": 0, 1115 | "_skewX": 0, 1116 | "_skewY": 0, 1117 | "groupIndex": 0, 1118 | "_id": "", 1119 | "_eulerAngles": { 1120 | "__type__": "cc.Vec3", 1121 | "x": 0, 1122 | "y": 0, 1123 | "z": 0 1124 | } 1125 | }, 1126 | { 1127 | "__type__": "cc.Node", 1128 | "_name": "bar", 1129 | "_objFlags": 0, 1130 | "_parent": { 1131 | "__id__": 30 1132 | }, 1133 | "_children": [], 1134 | "_active": true, 1135 | "_level": 0, 1136 | "_components": [ 1137 | { 1138 | "__id__": 32 1139 | } 1140 | ], 1141 | "_prefab": { 1142 | "__id__": 33 1143 | }, 1144 | "_opacity": 255, 1145 | "_color": { 1146 | "__type__": "cc.Color", 1147 | "r": 255, 1148 | "g": 255, 1149 | "b": 255, 1150 | "a": 255 1151 | }, 1152 | "_contentSize": { 1153 | "__type__": "cc.Size", 1154 | "width": 300, 1155 | "height": 30 1156 | }, 1157 | "_anchorPoint": { 1158 | "__type__": "cc.Vec2", 1159 | "x": 0, 1160 | "y": 0.5 1161 | }, 1162 | "_position": { 1163 | "__type__": "cc.Vec3", 1164 | "x": -150, 1165 | "y": 0, 1166 | "z": 0 1167 | }, 1168 | "_scale": { 1169 | "__type__": "cc.Vec3", 1170 | "x": 1, 1171 | "y": 1, 1172 | "z": 1 1173 | }, 1174 | "_rotationX": 0, 1175 | "_rotationY": 0, 1176 | "_skewX": 0, 1177 | "_skewY": 0, 1178 | "groupIndex": 0, 1179 | "_id": "", 1180 | "_eulerAngles": { 1181 | "__type__": "cc.Vec3", 1182 | "x": 0, 1183 | "y": 0, 1184 | "z": 0 1185 | } 1186 | }, 1187 | { 1188 | "__type__": "cc.Sprite", 1189 | "_name": "", 1190 | "_objFlags": 0, 1191 | "node": { 1192 | "__id__": 31 1193 | }, 1194 | "_enabled": true, 1195 | "_spriteFrame": { 1196 | "__uuid__": "eba960d6-ede8-4260-9e1a-ded1b45d5b97" 1197 | }, 1198 | "_type": 3, 1199 | "_sizeMode": 0, 1200 | "_fillType": 0, 1201 | "_fillCenter": { 1202 | "__type__": "cc.Vec2", 1203 | "x": 0, 1204 | "y": 0 1205 | }, 1206 | "_fillStart": 0, 1207 | "_fillRange": 1, 1208 | "_isTrimmedMode": true, 1209 | "_state": 0, 1210 | "_atlas": { 1211 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 1212 | }, 1213 | "_srcBlendFactor": 770, 1214 | "_dstBlendFactor": 771, 1215 | "_id": "" 1216 | }, 1217 | { 1218 | "__type__": "cc.PrefabInfo", 1219 | "root": { 1220 | "__id__": 1 1221 | }, 1222 | "asset": { 1223 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 1224 | }, 1225 | "fileId": "17kCzHZOBLG4tFP5yBFwUr", 1226 | "sync": false 1227 | }, 1228 | { 1229 | "__type__": "cc.Sprite", 1230 | "_name": "", 1231 | "_objFlags": 0, 1232 | "node": { 1233 | "__id__": 30 1234 | }, 1235 | "_enabled": true, 1236 | "_spriteFrame": { 1237 | "__uuid__": "73856c54-2876-41bc-b58d-3fb81452cd3d" 1238 | }, 1239 | "_type": 1, 1240 | "_sizeMode": 0, 1241 | "_fillType": 0, 1242 | "_fillCenter": { 1243 | "__type__": "cc.Vec2", 1244 | "x": 0, 1245 | "y": 0 1246 | }, 1247 | "_fillStart": 0, 1248 | "_fillRange": 0, 1249 | "_isTrimmedMode": true, 1250 | "_state": 0, 1251 | "_atlas": { 1252 | "__uuid__": "cfbbda94-d60b-4514-b22c-5661a56bfe0e" 1253 | }, 1254 | "_srcBlendFactor": 770, 1255 | "_dstBlendFactor": 771, 1256 | "_id": "" 1257 | }, 1258 | { 1259 | "__type__": "cc.ProgressBar", 1260 | "_name": "", 1261 | "_objFlags": 0, 1262 | "node": { 1263 | "__id__": 30 1264 | }, 1265 | "_enabled": true, 1266 | "_N$totalLength": 1, 1267 | "_N$barSprite": { 1268 | "__id__": 32 1269 | }, 1270 | "_N$mode": 2, 1271 | "_N$progress": 1, 1272 | "_N$reverse": false, 1273 | "_id": "" 1274 | }, 1275 | { 1276 | "__type__": "cc.PrefabInfo", 1277 | "root": { 1278 | "__id__": 1 1279 | }, 1280 | "asset": { 1281 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 1282 | }, 1283 | "fileId": "4dtNvGiQNJsKMoW2pp5zyv", 1284 | "sync": false 1285 | }, 1286 | { 1287 | "__type__": "cc.Node", 1288 | "_name": "gridinfo", 1289 | "_objFlags": 0, 1290 | "_parent": { 1291 | "__id__": 1 1292 | }, 1293 | "_children": [], 1294 | "_active": false, 1295 | "_level": 2, 1296 | "_components": [ 1297 | { 1298 | "__id__": 38 1299 | } 1300 | ], 1301 | "_prefab": { 1302 | "__id__": 39 1303 | }, 1304 | "_opacity": 255, 1305 | "_color": { 1306 | "__type__": "cc.Color", 1307 | "r": 255, 1308 | "g": 255, 1309 | "b": 255, 1310 | "a": 255 1311 | }, 1312 | "_contentSize": { 1313 | "__type__": "cc.Size", 1314 | "width": 97.87, 1315 | "height": 40 1316 | }, 1317 | "_anchorPoint": { 1318 | "__type__": "cc.Vec2", 1319 | "x": 0.5, 1320 | "y": 0.5 1321 | }, 1322 | "_position": { 1323 | "__type__": "cc.Vec3", 1324 | "x": 0, 1325 | "y": -219.9, 1326 | "z": 0 1327 | }, 1328 | "_scale": { 1329 | "__type__": "cc.Vec3", 1330 | "x": 1, 1331 | "y": 1, 1332 | "z": 1 1333 | }, 1334 | "_rotationX": 0, 1335 | "_rotationY": 0, 1336 | "_skewX": 0, 1337 | "_skewY": 0, 1338 | "groupIndex": 0, 1339 | "_id": "", 1340 | "_eulerAngles": { 1341 | "__type__": "cc.Vec3", 1342 | "x": 0, 1343 | "y": 0, 1344 | "z": 0 1345 | } 1346 | }, 1347 | { 1348 | "__type__": "cc.Label", 1349 | "_name": "", 1350 | "_objFlags": 0, 1351 | "node": { 1352 | "__id__": 37 1353 | }, 1354 | "_enabled": true, 1355 | "_useOriginalSize": false, 1356 | "_string": "Label", 1357 | "_N$string": "Label", 1358 | "_fontSize": 40, 1359 | "_lineHeight": 40, 1360 | "_enableWrapText": true, 1361 | "_N$file": null, 1362 | "_isSystemFontUsed": true, 1363 | "_spacingX": 0, 1364 | "_batchAsBitmap": false, 1365 | "_N$horizontalAlign": 1, 1366 | "_N$verticalAlign": 1, 1367 | "_N$fontFamily": "Arial", 1368 | "_N$overflow": 0, 1369 | "_N$cacheMode": 0, 1370 | "_id": "" 1371 | }, 1372 | { 1373 | "__type__": "cc.PrefabInfo", 1374 | "root": { 1375 | "__id__": 1 1376 | }, 1377 | "asset": { 1378 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 1379 | }, 1380 | "fileId": "a0EJk6JQxBc6i5SzF0yHwo", 1381 | "sync": false 1382 | }, 1383 | { 1384 | "__type__": "73d275oZi1B5J3PVK9kv+Fl", 1385 | "_name": "", 1386 | "_objFlags": 0, 1387 | "node": { 1388 | "__id__": 1 1389 | }, 1390 | "_enabled": true, 1391 | "rootNode": { 1392 | "__id__": 1 1393 | }, 1394 | "tankNode": { 1395 | "__id__": 5 1396 | }, 1397 | "tankHp": { 1398 | "__id__": 35 1399 | }, 1400 | "light": { 1401 | "__id__": 7 1402 | }, 1403 | "userNameTxt": { 1404 | "__id__": 3 1405 | }, 1406 | "gridInfoTxt": { 1407 | "__id__": 38 1408 | }, 1409 | "tower": { 1410 | "__id__": 19 1411 | }, 1412 | "_id": "" 1413 | }, 1414 | { 1415 | "__type__": "cc.PrefabInfo", 1416 | "root": { 1417 | "__id__": 1 1418 | }, 1419 | "asset": { 1420 | "__uuid__": "64562d62-1723-4698-9810-4bfae2ec6c0d" 1421 | }, 1422 | "fileId": "baVxjv4VJLH4ZFj0MhAg18", 1423 | "sync": false 1424 | } 1425 | ] --------------------------------------------------------------------------------