Explorar el Código

登录界面,对战,游戏界面UI

FantasyUFG hace 5 años
padre
commit
3f50e98cd4

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 5887 - 301
assets/scene/Game.fire


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 921 - 16
assets/scene/Loading.fire


+ 4 - 4
assets/script/Game/Ai/AiCharactor.js

@@ -1,15 +1,15 @@
 cc.Class({
-    extends: require("baseCharactor"),
+    extends: require("BaseCharactor"),
 
     properties: {
-      
+
     },
 
     // onLoad () {},
 
-    start () {
+    start() {
 
     },
 
     // update (dt) {},
-});
+});

+ 4 - 5
assets/script/Game/Ai/AiPlayerController.js

@@ -1,15 +1,14 @@
-
 cc.Class({
-    extends: require("basePlayerController"),
+    extends: require("BasePlayerController"),
 
     properties: {
-       
+
     },
     // onLoad () {},
 
-    start () {
+    start() {
 
     },
 
     // update (dt) {},
-});
+});

+ 4 - 5
assets/script/Game/Ai/AiPlayerStates.js

@@ -1,15 +1,14 @@
-
 cc.Class({
-    extends: require("basePlayerStates"),
+    extends: require("BasePlayerStates"),
 
     properties: {
-       
+
     },
     // onLoad () {},
 
-    start () {
+    start() {
 
     },
 
     // update (dt) {},
-});
+});

+ 5 - 6
assets/script/Game/Base/BaseGameMode.js

@@ -2,20 +2,19 @@ cc.Class({
     extends: cc.Component,
 
     properties: {
-       gameStates:cc.Node,
+        gameStates: cc.Node,
     },
-    start () {
+    start() {
         this.gStatSt = this.gameStates.getComponent('GameStates');
     },
-    startGame(){
+    startGame() {
         //count game time
         let interval = 1; // 以秒为单位的时间间隔let
         let repeat = cc.macro.REPEAT_FOREVER; // 重复次数
         let delay = 0; // 开始延时
         this.schedule(this.countGameTime, interval, repeat, delay);
     },
-    countGameTime()
-    {
+    countGameTime() {
         this.gStatSt.gameTime++;
     },
     millisecondToDate(msd) {
@@ -40,4 +39,4 @@ cc.Class({
         }
         return time;
     },
-});
+});

+ 44 - 7
assets/script/Game/Base/BaseGameStates.js

@@ -1,17 +1,54 @@
-
 cc.Class({
     extends: cc.Component,
 
     properties: {
-      
+
     },
-    onLoad () {
+    onLoad() {
         this.restTime = 0;
         this.currentTime = 0;
-    },
-    start () {
+        this.player_name = "";
+        this.player_gold = 0;
+        this.player_energy = 0;
+        this.player_sex = 0;
 
     },
-    
+    start() {
+        this.InformationChanges("set", 0, "AFHRFS");
+        this.InformationChanges("set", 1, 50);
+        this.InformationChanges("set", 2, 50);
+    },
+
     // update (dt) {},
-});
+    InformationChanges(state, indel, info) {
+        if (state == "set") {
+            if (indel == 0) {
+                this.player_name = info;
+            }
+            if (indel == 1) {
+                this.player_gold = info;
+            }
+            if (indel == 2) {
+                this.player_energy = info;
+            }
+            if (indel == 3) {
+                this.player_sex = info;
+            }
+
+        } else if (state == "get") {
+            if (indel == 0) {
+                return this.player_name;
+            }
+            if (indel == 1) {
+                return this.player_gold;
+            }
+            if (indel == 2) {
+                return this.player_energy;
+            }
+            if (indel == 3) {
+                return this.player_sex;
+            }
+        }
+
+    }
+});

+ 8 - 4
assets/script/Game/Base/BasePlayerStates.js

@@ -1,15 +1,19 @@
-
 cc.Class({
     extends: cc.Component,
 
     properties: {
-   
+
     },
     // onLoad () {},
 
-    start () {
+    start() {
 
     },
+    //血量变化
+    //减血
+    oligemia() {
+        console.log("血量减少");
+    }
 
     // update (dt) {},
-});
+});

+ 4 - 5
assets/script/Game/GameMode.js

@@ -1,15 +1,14 @@
-
 cc.Class({
-    extends: require("baseGameMode"),
+    extends: require("BaseGameMode"),
 
     properties: {
-       
+
     },
     // onLoad () {},
 
-    start () {
+    start() {
 
     },
 
     // update (dt) {},
-});
+});

+ 29 - 5
assets/script/Game/GameStates.js

@@ -1,12 +1,36 @@
 cc.Class({
-    extends: require("baseGameStates"),
+    extends: require("BaseGameStates"),
 
     properties: {
-       
+        Player_infoArr: {
+            default: [],
+            type: cc.Label,
+        }
+
+    },
+    onLoad() {
+        // this.InformationChanges("set", "name", "小明");
+        //let name = this.InformationChanges("get", "name");
+        // console.log(a);
+        this.InformationChanges("set", 0, "小明");
+        this.InformationChanges("set", 1, 50);
+        this.InformationChanges("set", 2, 50);
     },
-    // onLoad () {},
-    start () {
+    start() {
 
+        for (let i = 0; i < this.Player_infoArr.length; i++) {
+            let info = this.InformationChanges("get", i);
+            if (i == 1 || i == 2) {
+                if (info / 1000 > 1) {
+                    this.Player_infoArr[i].string = info / 1000 + "K";
+                } else {
+                    this.Player_infoArr[i].string = info;
+                }
+            } else {
+                this.Player_infoArr[i].string = info;
+            }
+        }
     },
     // update (dt) {},
-});
+
+});

+ 10 - 11
assets/script/Game/Player/Charactor.js

@@ -1,12 +1,11 @@
-
 cc.Class({
-    extends: require("baseCharactor"),
+    extends: require("BaseCharactor"),
 
     properties: {
-     
+
     },
-    onLoad () {
-        
+    onLoad() {
+
         this.armatureDisplay = this.node.getComponent(dragonBones.ArmatureDisplay);
         this.armature = this.armatureDisplay.armature();
 
@@ -14,20 +13,20 @@ cc.Class({
         this.armatureDisplay.addEventListener(dragonBones.EventObject.COMPLETE, this.animationEventHandler, this);
     },
 
-    start () {
+    start() {
 
     },
-    attack(bLeft){
-       
+    attack(bLeft) {
+
     },
     animationEventHandler(event) {
         if (event.type === dragonBones.EventObject.COMPLETE) {
             if (event.animationState.name === "attack") {
-                console.log("attack 动作播放完毕!!!");          
+                console.log("attack 动作播放完毕!!!");
                 //TODO:
-                this.armature.animation.play("idle",-1);
+                this.armature.animation.play("idle", -1);
             }
         }
     }
     // update (dt) {},
-});
+});

+ 23 - 39
assets/script/Game/Player/PlayerController.js

@@ -1,69 +1,53 @@
 cc.Class({
-    extends: require("basePlayerController"),
+    extends: require("BasePlayerController"),
 
     properties: {
-        leftTouchNode:cc.Node,
-        rightTouchNode:cc.Node,
-        charactor:cc.Node,
+        leftTouchNode: cc.Node,
+        rightTouchNode: cc.Node,
+        charactor: cc.Node,
     },
-    onLoad () {
+    onLoad() {
         //注册回调事件
         let Self = this;
-        this.leftTouchNode.on('gesture', function (event) {
+        this.leftTouchNode.on('gesture', function(event) {
             console.log(event.name);
             Self.leftGesture(event.name);
         })
 
-        this.rightTouchNode.on('gesture', function (event) {
+        this.rightTouchNode.on('gesture', function(event) {
             console.log(event.name);
             Self.rightGesture(event.name);
         })
     },
-    start () {
+    start() {
         this.init();
     },
-    init(){
+    init() {
         //角色脚本
         this.ctorScp = this.charactor.getComponent('baseCharactor');
     },
-    leftGesture(name)
-    {
-        if(name == 'up')
-        {
+    leftGesture(name) {
+        if (name == 'up') {
             this.ctorScp.attack(1);
-        }
-        else if(name == 'down')
-        {
-  
-        }
-        else if(name == 'left')
-        {
+        } else if (name == 'down') {
 
-        }
-        else if(name == 'right')
-        {
+        } else if (name == 'left') {
+
+        } else if (name == 'right') {
             this.ctorScp.attack(1);
         }
     },
-    rightGesture(name)
-    {
-        if(name == 'up')
-        {
+    rightGesture(name) {
+        if (name == 'up') {
             this.ctorScp.attack(0);
-        }
-        else if(name == 'down')
-        {
+        } else if (name == 'down') {
 
-        }
-        else if(name == 'left')
-        {
+        } else if (name == 'left') {
             this.ctorScp.attack(0);
-        }
-        else if(name == 'right')
-        {
- 
+        } else if (name == 'right') {
+
         }
     },
-   
+
     // update (dt) {},
-});
+});

+ 7 - 6
assets/script/Game/Player/PlayerStates.js

@@ -1,12 +1,13 @@
-
 cc.Class({
-    extends: require("basePlayerStates"),
+    extends: require("BasePlayerStates"),
 
     properties: {
-      
+
+    },
+    onLoad() {
+        //this.oligemia();//继承BasePlayerStates函数
     },
-    // onLoad () {},
-    start () {
+    start() {
 
     },
-});
+});

+ 0 - 12
assets/script/Game/ui/topUI.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "20b661da-8455-4407-868d-35bbd85962b6",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 23 - 19
assets/script/Loading/Loading.js

@@ -1,32 +1,36 @@
-
 cc.Class({
     extends: cc.Component,
 
     properties: {
-        // foo: {
-        //     // ATTRIBUTES:
-        //     default: null,        // The default value will be used only when the component attaching
-        //                           // to a node for the first time
-        //     type: cc.SpriteFrame, // optional, default is typeof default
-        //     serializable: true,   // optional, default is true
-        // },
-        // bar: {
-        //     get () {
-        //         return this._bar;
-        //     },
-        //     set (value) {
-        //         this._bar = value;
-        //     }
-        // },
+        AudioArr: { //音频
+            type: cc.AudioClip,
+            default: [],
+        },
+        ProgressBar: cc.Sprite,
     },
 
     // LIFE-CYCLE CALLBACKS:
 
-    // onLoad () {},
+    onLoad() {
+        cc.audioEngine.playMusic(this.AudioArr[0]);
+        this.startGame();
+    },
 
-    start () {
+    start() {
 
     },
+    /**开始游戏 */
+    startGame() {
+
+        //let bundle = cc.assetManager.getBundle('01_graphics');
+        this.ProgressBar.node.parent.active = true;
+        //开始加载远程资源
+        cc.loader.loadResDir('', cc.Asset, (completeCount, totalCount) => {
+            this.ProgressBar.fillRange = completeCount / totalCount;
+        }, () => {
 
+            cc.director.loadScene('Game');
+        });
+    }
     // update (dt) {},
-});
+});

+ 0 - 12
assets/script/thirdParty.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "0b251b46-76a1-4501-b8bb-5091dd2b9281",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

BIN
assets/texture/Loading/background.png


+ 0 - 36
assets/texture/Loading/background.png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "c98b20d9-3507-4f1b-be45-37ff0f3bb5f2",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 720,
-  "height": 1280,
-  "platformSettings": {},
-  "subMetas": {
-    "background": {
-      "ver": "1.0.4",
-      "uuid": "0058ba2c-cc21-4c2e-abc7-6b4f1a175a0e",
-      "rawTextureUuid": "c98b20d9-3507-4f1b-be45-37ff0f3bb5f2",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 720,
-      "height": 1280,
-      "rawWidth": 720,
-      "rawHeight": 1280,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/texture/Loading/dl (1).png


+ 0 - 36
assets/texture/Loading/dl (1).png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "ad360424-80b8-42d1-9dd1-325450da167b",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 417,
-  "height": 123,
-  "platformSettings": {},
-  "subMetas": {
-    "dl (1)": {
-      "ver": "1.0.4",
-      "uuid": "75160d61-d2cb-414a-afe8-7e66b25f3f61",
-      "rawTextureUuid": "ad360424-80b8-42d1-9dd1-325450da167b",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 417,
-      "height": 123,
-      "rawWidth": 417,
-      "rawHeight": 123,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/texture/Loading/dl (2).png


+ 0 - 36
assets/texture/Loading/dl (2).png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "ba009182-d192-4053-9018-86ce72fe718d",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 699,
-  "height": 25,
-  "platformSettings": {},
-  "subMetas": {
-    "dl (2)": {
-      "ver": "1.0.4",
-      "uuid": "edf67e3e-823b-4d7d-9019-00ba0c09087a",
-      "rawTextureUuid": "ba009182-d192-4053-9018-86ce72fe718d",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 699,
-      "height": 25,
-      "rawWidth": 699,
-      "rawHeight": 25,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 36,
-      "borderRight": 34,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/texture/Loading/dl (3).png


+ 0 - 36
assets/texture/Loading/dl (3).png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "55779967-25ea-42c3-bcfd-bff83eb3e05a",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 682,
-  "height": 18,
-  "platformSettings": {},
-  "subMetas": {
-    "dl (3)": {
-      "ver": "1.0.4",
-      "uuid": "feb96f8c-9754-4392-8c16-44c85015d2ec",
-      "rawTextureUuid": "55779967-25ea-42c3-bcfd-bff83eb3e05a",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 682,
-      "height": 18,
-      "rawWidth": 682,
-      "rawHeight": 18,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 25,
-      "borderRight": 29,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/texture/Loading/dl (4).png


+ 0 - 36
assets/texture/Loading/dl (4).png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "35cde02e-7970-432c-8fa1-4955cd4d0a96",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 711,
-  "height": 932,
-  "platformSettings": {},
-  "subMetas": {
-    "dl (4)": {
-      "ver": "1.0.4",
-      "uuid": "8426f44d-65b9-483d-a6a1-59a8981f9479",
-      "rawTextureUuid": "35cde02e-7970-432c-8fa1-4955cd4d0a96",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 711,
-      "height": 932,
-      "rawWidth": 711,
-      "rawHeight": 932,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/texture/Loading/dl (5).png


+ 0 - 36
assets/texture/Loading/dl (5).png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "b89645cb-561b-4229-841d-c23a371ffcbc",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 703,
-  "height": 322,
-  "platformSettings": {},
-  "subMetas": {
-    "dl (5)": {
-      "ver": "1.0.4",
-      "uuid": "4ea0e5f0-397e-493a-9276-cb343d336d53",
-      "rawTextureUuid": "b89645cb-561b-4229-841d-c23a371ffcbc",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 703,
-      "height": 322,
-      "rawWidth": 703,
-      "rawHeight": 322,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio