Ver código fonte

可以下一关的版本

Citrus 3 meses atrás
pai
commit
4e88e26a2c

+ 2 - 1
assets/Editer/edLayout.ts

@@ -407,7 +407,8 @@ export default class edLayout extends cc.Component {
                 Mapdata.fs.push(
                     {
 
-                        sp: prop.getComponent(cc.Sprite).spriteFrame.name.replace(/[^0-9]/ig, ""),
+                        sp: prop.name.replace(/[^0-9]/ig, ""),
+                        // sp: prop.getComponent(cc.Sprite).spriteFrame.name.replace(/[^0-9]/ig, ""),
                         // sp: prop.getComponent(cc.Sprite).spriteFrame.name,
                         ro: prop.rotation,
                         sc: prop.scale,

+ 18 - 1
assets/Script/GameProp/GameProp1002.ts

@@ -8,6 +8,8 @@
 import AudioManager from "../AudioManager";
 import Character from "../Character/Character";
 import EventName from "../EventName/EventName";
+import LocalData from "../LocalData";
+import MyMap from "../Map/MyMap";
 import RewardMnr from "../Template/RewardMnr";
 import Prop from "./Prop";
 
@@ -46,6 +48,21 @@ export default class GameProp1002 extends Prop {
 
     //奖励的方法
     Reaward() {
-        cc.director.loadScene("Hall")
+        console.error('ReawardGameProp1002');
+        
+        let RoundState = this.getComponentInChildren(sp.Skeleton).setAnimation(0, '奖杯', false);
+        this.scheduleOnce(() => {
+            let NextLevel = cc.Canvas.instance.node.getChildByName('Map').getComponent(MyMap).MapjsonData.NextLevel
+            if (!NextLevel) {
+                cc.systemEvent.emit(EventName.Tips, `本关 地图没有设置下一关ID`)
+                return
+            }
+            LocalData.getInstance().setMap(NextLevel)
+            if (NextLevel > 0) {
+                cc.director.loadScene("Game")
+            } else {
+                cc.director.loadScene("Hall")
+            }
+        }, RoundState.animationEnd)
     }
 } 

+ 0 - 51
assets/Script/GameProp/GameProp1003.ts

@@ -1,51 +0,0 @@
-// Learn TypeScript:
-//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
-// Learn Attribute:
-//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
-// Learn life-cycle callbacks:
-//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
-
-import AudioManager from "../AudioManager";
-import Character from "../Character/Character";
-import EventName from "../EventName/EventName";
-import RewardMnr from "../Template/RewardMnr";
-import Prop from "./Prop";
-
-const { ccclass, property } = cc._decorator;
-
-@ccclass
-export default class GameProp1002 extends Prop {
-
-    // onLoad () {}
-    //触发几次获得奖励
-    triggerCount = 1
-
-    //完事之后自己是否消失
-    IsDeleteMe = true
-
-    protected onEnable(): void {
-        this.node.active = RewardMnr.getInstance().isEnable(this.Flag())
-    }
-
-    onCollisionEnter(other: cc.CircleCollider, self: cc.BoxCollider) {
-
-        if (this.triggerCount <= 0) {
-            console.error('失效了');
-            this.getComponent(cc.BoxCollider).enabled = false
-            return
-        }
-
-        //如果碰撞了玩家
-        if (other.node.getComponent(Character)) {
-            this.triggerCount--
-            if (this.triggerCount <= 0 && this.IsDeleteMe) {
-                this.Reaward()
-            }
-        }
-    }
-
-    //奖励的方法
-    Reaward() {
-        cc.director.loadScene("Hall")
-    }
-} 

+ 0 - 10
assets/Script/GameProp/GameProp1003.ts.meta

@@ -1,10 +0,0 @@
-{
-  "ver": "1.1.0",
-  "uuid": "6106338c-8b1d-4177-ab67-550b254b31d0",
-  "importer": "typescript",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

+ 10 - 0
assets/Script/LocalData.ts

@@ -110,6 +110,16 @@ export default class LocalData {
         return this.$useParabolaSkin;
     }
 
+    /////////////////////////////////////////////当前玩的关卡
+
+    private $Map: number = 1;
+    public setMap(Temp: number) {
+        this.$Map = Temp
+        this.save();
+    }
+    public getMap() {
+        return this.$Map;
+    }
 
     /////////////////////////////////////////////设置
 

+ 9 - 4
assets/Script/Map/MyMap.ts

@@ -30,8 +30,13 @@ type MapType = {
     map: MapDataType[],
     mapX: number,
     mapY: number,
+    BronID: number,
+    BronX: number,
+    BronY: number,
+    NextLevel: number,
 }
 
+
 type MapPosData = {
     index_x: number,
     index_y: number,
@@ -83,8 +88,11 @@ export default class MyMap extends cc.Component {
 
 
     protected start(): void {
-        this.Load('4')
         RewardMnr.getInstance().Reset()
+
+        // this.Load('1')
+        this.Load(LocalData.getInstance().getMap().toString())
+
     }
 
     public Load(level: string) {
@@ -105,7 +113,6 @@ export default class MyMap extends cc.Component {
 
         if (window['map99']) {
             this.MapjsonData = window['map99']
-
         } else {
             this.MapjsonData = resource.json;
         }
@@ -119,8 +126,6 @@ export default class MyMap extends cc.Component {
     initMap() {
         this.NeedUpdataIndexData = this.GetMapUpdateIndex()
 
-
-
         //宽多少个
         this.MapjsonData.mapX
         //高多少个

+ 2 - 2
assets/sub/res/footstep/footstep1002.prefab

@@ -209,12 +209,12 @@
     "_offset": {
       "__type__": "cc.Vec2",
       "x": 4.53,
-      "y": -34.6
+      "y": -10
     },
     "_size": {
       "__type__": "cc.Size",
       "width": 59.16,
-      "height": 2.8
+      "height": 50
     },
     "_id": ""
   },

+ 3 - 3
assets/sub/res/footstep/footstep1003.prefab

@@ -209,17 +209,17 @@
     "_offset": {
       "__type__": "cc.Vec2",
       "x": -1.66,
-      "y": -34.6
+      "y": -10
     },
     "_size": {
       "__type__": "cc.Size",
       "width": 46.79,
-      "height": 2.8
+      "height": 50
     },
     "_id": ""
   },
   {
-    "__type__": "61063OMix1Bd6tnVQslSzHQ",
+    "__type__": "f0a06uzAQxOpb4DkKiThKwE",
     "_name": "",
     "_objFlags": 0,
     "node": {

+ 242 - 0
assets/sub/res/footstep/footstep1004.prefab

@@ -0,0 +1,242 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "footstep1003",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 6
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 72,
+      "height": 72
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 3,
+    "groupIndex": 3,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "skeleton",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 405,
+      "height": 456
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        -35.751,
+        0,
+        0,
+        0,
+        0,
+        1,
+        0.3,
+        0.3,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
+      }
+    ],
+    "paused": false,
+    "defaultSkin": "太空",
+    "defaultAnimation": "待机",
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "loop": true,
+    "premultipliedAlpha": true,
+    "timeScale": 1,
+    "_accTime": 0,
+    "_playCount": 0,
+    "_frameCache": null,
+    "_curFrame": null,
+    "_skeletonCache": null,
+    "_animationName": "待机",
+    "_animationQueue": [],
+    "_headAniInfo": null,
+    "_playTimes": 0,
+    "_isAniComplete": true,
+    "_N$skeletonData": {
+      "__uuid__": "2b8c5d7f-20f0-4f28-84be-aece5e6ee659"
+    },
+    "_N$_defaultCacheMode": 0,
+    "_N$debugSlots": false,
+    "_N$debugBones": false,
+    "_N$debugMesh": false,
+    "_N$useTint": false,
+    "_N$enableBatch": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "0diI7emu1C5ZBsHrbwXQI3",
+    "sync": false
+  },
+  {
+    "__type__": "cc.BoxCollider",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "tag": 0,
+    "_offset": {
+      "__type__": "cc.Vec2",
+      "x": -1.66,
+      "y": -10
+    },
+    "_size": {
+      "__type__": "cc.Size",
+      "width": 46.79,
+      "height": 50
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "f0a06uzAQxOpb4DkKiThKwE",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "",
+    "sync": false
+  }
+]

+ 9 - 0
assets/sub/res/footstep/footstep1004.prefab.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.3.2",
+  "uuid": "55ca140c-0014-4dde-bc51-789f727a55f8",
+  "importer": "prefab",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

+ 242 - 0
assets/sub/res/footstep/footstep1005.prefab

@@ -0,0 +1,242 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "footstep1003",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 6
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 72,
+      "height": 72
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 3,
+    "groupIndex": 3,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "skeleton",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 405,
+      "height": 469
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        -35.751,
+        0,
+        0,
+        0,
+        0,
+        1,
+        0.3,
+        0.3,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
+      }
+    ],
+    "paused": false,
+    "defaultSkin": "海洋",
+    "defaultAnimation": "待机",
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "loop": true,
+    "premultipliedAlpha": true,
+    "timeScale": 1,
+    "_accTime": 0,
+    "_playCount": 0,
+    "_frameCache": null,
+    "_curFrame": null,
+    "_skeletonCache": null,
+    "_animationName": "待机",
+    "_animationQueue": [],
+    "_headAniInfo": null,
+    "_playTimes": 0,
+    "_isAniComplete": true,
+    "_N$skeletonData": {
+      "__uuid__": "61d4b9af-6a53-4c97-9057-13838c993259"
+    },
+    "_N$_defaultCacheMode": 0,
+    "_N$debugSlots": false,
+    "_N$debugBones": false,
+    "_N$debugMesh": false,
+    "_N$useTint": false,
+    "_N$enableBatch": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "0diI7emu1C5ZBsHrbwXQI3",
+    "sync": false
+  },
+  {
+    "__type__": "cc.BoxCollider",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "tag": 0,
+    "_offset": {
+      "__type__": "cc.Vec2",
+      "x": -1.66,
+      "y": -10
+    },
+    "_size": {
+      "__type__": "cc.Size",
+      "width": 46.79,
+      "height": 50
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "f0a06uzAQxOpb4DkKiThKwE",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "",
+    "sync": false
+  }
+]

+ 9 - 0
assets/sub/res/footstep/footstep1005.prefab.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.3.2",
+  "uuid": "61ae1981-dedb-4f95-8048-08377588eaba",
+  "importer": "prefab",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 2934
assets/sub/res/json/map1.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
assets/sub/res/json/map2.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
assets/sub/res/json/map3.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 4658
assets/sub/res/json/map4.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
assets/sub/res/json/map5.json


+ 6 - 0
assets/sub/res/json/map5.json.meta

@@ -0,0 +1,6 @@
+{
+  "ver": "1.0.2",
+  "uuid": "140c8627-c96d-4af5-94e2-01bf1da050d8",
+  "importer": "json",
+  "subMetas": {}
+}

+ 1 - 1
settings/project.json

@@ -56,7 +56,7 @@
     "width": 960,
     "height": 640
   },
-  "last-module-event-record-time": 1739010328447,
+  "last-module-event-record-time": 1740912053406,
   "assets-sort-type": "name",
   "facebook": {
     "enable": false,

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff