浏览代码

Adding script files for example level-1.

Sam Jaffe 6 年之前
父节点
当前提交
365d6af4dd

+ 35 - 0
Resources/scripts/entity/drake.json

@@ -0,0 +1,35 @@
+{
+  "name":"Drake",
+  "type":"Enemy",
+  "hp":10,
+  "scale":0.15,
+  "solid":true,
+  "points":{
+    "damage":100,
+    "kill":500
+  },
+  "material":{
+    "texture":{
+      "file":"data/images/rock.png",
+      "uniform":"u_diffuseMap"
+    }
+  },
+  "attack":[
+    {
+      "id":"burstShot",
+      "timeBetweenBullets":0.1,
+      "bulletsPerWave":15,
+      "burstAngle":360,
+      "bulletSpeed":900,
+      "bulletType":{
+        "damage":2,
+        "size":10.0,
+        "material":{
+          "texture":{
+            "uniform":"u_diffuseMap"
+          }
+        }
+      }
+    }
+  ]
+}

+ 0 - 0
Resources/scripts/entity/elder-dragon.json


+ 31 - 0
Resources/scripts/level/1/level.json

@@ -0,0 +1,31 @@
+{
+  "time_between_waves":10,
+  "waves":[
+    [
+      {"id":"Drake", "position":[350, 600]},
+      {"id":"Drake", "position":[800, 600]},
+      {"id":"Drake", "position":[1250, 600]}
+    ],
+    [
+      {"id":"Drake", "position":[200, 800]},
+      {"id":"Drake", "position":[500, 800]},
+      {"id":"Drake", "position":[800, 800]},
+      {"id":"Drake", "position":[1100, 800]},
+      {"id":"Drake", "position":[1400, 800]}
+    ],
+    [
+      {"id":"Drake", "position":[200, 400]},
+      {"id":"Drake", "position":[500, 400]},
+      {"id":"Drake", "position":[800, 400]},
+      {"id":"Drake", "position":[1100, 400]},
+      {"id":"Drake", "position":[1400, 400]}
+    ],
+    [
+      {"id":"ElderDragon", "position":[600, 600]}
+    ]
+  ],
+  "mappings":{
+    "Drake":"drake.json",
+    "ElderDragon":"elder-dragon.json"
+  }
+}

+ 9 - 0
Resources/scripts/level/world.json

@@ -0,0 +1,9 @@
+{
+  "name":"World 1",
+  "levels":[
+    {
+      "name":"Light 1",
+      "path":"1"
+    }
+  ]
+}

+ 4 - 0
danmaku.xcodeproj/project.pbxproj

@@ -16,6 +16,7 @@
 		CD1C83402298A9E000825C4E /* libgameutils.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD7E882322960D9C00D877FE /* libgameutils.dylib */; };
 		CD1C83412298A9E000825C4E /* libgraphics.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD7E883922960DBF00D877FE /* libgraphics.dylib */; };
 		CD1C83432298A9F500825C4E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD1C83422298A9F500825C4E /* MainMenu.xib */; };
+		CD49F73D229AFF2900EB8926 /* scripts in Resources */ = {isa = PBXBuildFile; fileRef = CD49F736229AFF2800EB8926 /* scripts */; };
 		CD7E87A52295FCED00D877FE /* danmakuUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7E87A42295FCED00D877FE /* danmakuUITests.m */; };
 /* End PBXBuildFile section */
 
@@ -68,6 +69,7 @@
 		CD1C82E22298A46900825C4E /* data */ = {isa = PBXFileReference; lastKnownFileType = folder; name = data; path = Resources/data; sourceTree = "<group>"; };
 		CD1C83292298A89E00825C4E /* danmaku.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = danmaku.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		CD1C83422298A9F500825C4E /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MainMenu.xib; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
+		CD49F736229AFF2800EB8926 /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = scripts; path = Resources/scripts; sourceTree = "<group>"; };
 		CD7E87862295FCEA00D877FE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		CD7E87872295FCEA00D877FE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
 		CD7E878D2295FCEA00D877FE /* GameView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GameView.h; sourceTree = "<group>"; };
@@ -114,6 +116,7 @@
 				CD7E881D22960D9C00D877FE /* gameutils.xcodeproj */,
 				CD7E880B22960D8200D877FE /* engine.xcodeproj */,
 				CD1C82E22298A46900825C4E /* data */,
+				CD49F736229AFF2800EB8926 /* scripts */,
 				CD7E87852295FCEA00D877FE /* danmaku */,
 				CD7E87A32295FCED00D877FE /* danmakuUITests */,
 				CD7E87842295FCEA00D877FE /* Products */,
@@ -341,6 +344,7 @@
 				CD1C833E2298A9D800825C4E /* Assets.xcassets in Resources */,
 				CD1C833D2298A9D600825C4E /* data in Resources */,
 				CD1C83432298A9F500825C4E /* MainMenu.xib in Resources */,
+				CD49F73D229AFF2900EB8926 /* scripts in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};