add xml parse to Json
Showing
17 changed files
with
666 additions
and
17 deletions
| ... | @@ -41,8 +41,8 @@ | ... | @@ -41,8 +41,8 @@ |
| 41 | }, | 41 | }, |
| 42 | "_scale": { | 42 | "_scale": { |
| 43 | "__type__": "cc.Vec3", | 43 | "__type__": "cc.Vec3", |
| 44 | "x": 0.27132086548953405, | 44 | "x": 0.13871663973241932, |
| 45 | "y": 0.27132086548953405, | 45 | "y": 0.13871663973241932, |
| 46 | "z": 1 | 46 | "z": 1 |
| 47 | }, | 47 | }, |
| 48 | "_quat": { | 48 | "_quat": { |
| ... | @@ -288,8 +288,8 @@ | ... | @@ -288,8 +288,8 @@ |
| 288 | "__id__": 5 | 288 | "__id__": 5 |
| 289 | }, | 289 | }, |
| 290 | "_enabled": true, | 290 | "_enabled": true, |
| 291 | "_srcBlendFactor": 770, | 291 | "_srcBlendFactor": 1, |
| 292 | "_dstBlendFactor": 771, | 292 | "_dstBlendFactor": 769, |
| 293 | "_spriteFrame": { | 293 | "_spriteFrame": { |
| 294 | "__uuid__": "14f1599c-036c-486d-abf5-b3566ed39f15" | 294 | "__uuid__": "14f1599c-036c-486d-abf5-b3566ed39f15" |
| 295 | }, | 295 | }, |
| ... | @@ -406,7 +406,7 @@ | ... | @@ -406,7 +406,7 @@ |
| 406 | "__id__": 8 | 406 | "__id__": 8 |
| 407 | }, | 407 | }, |
| 408 | "_enabled": true, | 408 | "_enabled": true, |
| 409 | "_srcBlendFactor": 770, | 409 | "_srcBlendFactor": 1, |
| 410 | "_dstBlendFactor": 771, | 410 | "_dstBlendFactor": 771, |
| 411 | "_spriteFrame": { | 411 | "_spriteFrame": { |
| 412 | "__uuid__": "987745dd-03d6-4de5-b98e-1d5e75c9f2d3" | 412 | "__uuid__": "987745dd-03d6-4de5-b98e-1d5e75c9f2d3" | ... | ... |
assets/Scene/sceneExploreNew.fire
0 → 100644
| 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.1, | ||
| 45 | "y": 0.1, | ||
| 46 | "z": 1 | ||
| 47 | }, | ||
| 48 | "_quat": { | ||
| 49 | "__type__": "cc.Quat", | ||
| 50 | "x": 0, | ||
| 51 | "y": 0, | ||
| 52 | "z": 0, | ||
| 53 | "w": 1 | ||
| 54 | }, | ||
| 55 | "groupIndex": 0, | ||
| 56 | "autoReleaseAssets": false, | ||
| 57 | "_id": "c5bb6714-76a5-4b23-9585-4546b56bcd8e" | ||
| 58 | }, | ||
| 59 | { | ||
| 60 | "__type__": "cc.Node", | ||
| 61 | "_name": "Canvas", | ||
| 62 | "_objFlags": 0, | ||
| 63 | "_parent": { | ||
| 64 | "__id__": 1 | ||
| 65 | }, | ||
| 66 | "_children": [ | ||
| 67 | { | ||
| 68 | "__id__": 3 | ||
| 69 | }, | ||
| 70 | { | ||
| 71 | "__id__": 5 | ||
| 72 | }, | ||
| 73 | { | ||
| 74 | "__id__": 8 | ||
| 75 | } | ||
| 76 | ], | ||
| 77 | "_active": true, | ||
| 78 | "_level": 0, | ||
| 79 | "_components": [ | ||
| 80 | { | ||
| 81 | "__id__": 10 | ||
| 82 | }, | ||
| 83 | { | ||
| 84 | "__id__": 11 | ||
| 85 | } | ||
| 86 | ], | ||
| 87 | "_prefab": null, | ||
| 88 | "_opacity": 255, | ||
| 89 | "_color": { | ||
| 90 | "__type__": "cc.Color", | ||
| 91 | "r": 255, | ||
| 92 | "g": 255, | ||
| 93 | "b": 255, | ||
| 94 | "a": 255 | ||
| 95 | }, | ||
| 96 | "_contentSize": { | ||
| 97 | "__type__": "cc.Size", | ||
| 98 | "width": 960, | ||
| 99 | "height": 640 | ||
| 100 | }, | ||
| 101 | "_anchorPoint": { | ||
| 102 | "__type__": "cc.Vec2", | ||
| 103 | "x": 0.5, | ||
| 104 | "y": 0.5 | ||
| 105 | }, | ||
| 106 | "_position": { | ||
| 107 | "__type__": "cc.Vec3", | ||
| 108 | "x": 480, | ||
| 109 | "y": 320, | ||
| 110 | "z": 0 | ||
| 111 | }, | ||
| 112 | "_scale": { | ||
| 113 | "__type__": "cc.Vec3", | ||
| 114 | "x": 1, | ||
| 115 | "y": 1, | ||
| 116 | "z": 1 | ||
| 117 | }, | ||
| 118 | "_rotationX": 0, | ||
| 119 | "_rotationY": 0, | ||
| 120 | "_quat": { | ||
| 121 | "__type__": "cc.Quat", | ||
| 122 | "x": 0, | ||
| 123 | "y": 0, | ||
| 124 | "z": 0, | ||
| 125 | "w": 1 | ||
| 126 | }, | ||
| 127 | "_skewX": 0, | ||
| 128 | "_skewY": 0, | ||
| 129 | "groupIndex": 0, | ||
| 130 | "_id": "2enr7NbbJA+ohEBDG12MuR" | ||
| 131 | }, | ||
| 132 | { | ||
| 133 | "__type__": "cc.Node", | ||
| 134 | "_name": "Main Camera", | ||
| 135 | "_objFlags": 0, | ||
| 136 | "_parent": { | ||
| 137 | "__id__": 2 | ||
| 138 | }, | ||
| 139 | "_children": [], | ||
| 140 | "_active": true, | ||
| 141 | "_level": 1, | ||
| 142 | "_components": [ | ||
| 143 | { | ||
| 144 | "__id__": 4 | ||
| 145 | } | ||
| 146 | ], | ||
| 147 | "_prefab": null, | ||
| 148 | "_opacity": 255, | ||
| 149 | "_color": { | ||
| 150 | "__type__": "cc.Color", | ||
| 151 | "r": 255, | ||
| 152 | "g": 255, | ||
| 153 | "b": 255, | ||
| 154 | "a": 255 | ||
| 155 | }, | ||
| 156 | "_contentSize": { | ||
| 157 | "__type__": "cc.Size", | ||
| 158 | "width": 0, | ||
| 159 | "height": 0 | ||
| 160 | }, | ||
| 161 | "_anchorPoint": { | ||
| 162 | "__type__": "cc.Vec2", | ||
| 163 | "x": 0.5, | ||
| 164 | "y": 0.5 | ||
| 165 | }, | ||
| 166 | "_position": { | ||
| 167 | "__type__": "cc.Vec3", | ||
| 168 | "x": 0, | ||
| 169 | "y": 0, | ||
| 170 | "z": 0 | ||
| 171 | }, | ||
| 172 | "_scale": { | ||
| 173 | "__type__": "cc.Vec3", | ||
| 174 | "x": 1, | ||
| 175 | "y": 1, | ||
| 176 | "z": 1 | ||
| 177 | }, | ||
| 178 | "_rotationX": 0, | ||
| 179 | "_rotationY": 0, | ||
| 180 | "_quat": { | ||
| 181 | "__type__": "cc.Quat", | ||
| 182 | "x": 0, | ||
| 183 | "y": 0, | ||
| 184 | "z": 0, | ||
| 185 | "w": 1 | ||
| 186 | }, | ||
| 187 | "_skewX": 0, | ||
| 188 | "_skewY": 0, | ||
| 189 | "groupIndex": 0, | ||
| 190 | "_id": "6axvtUu8JLGYQswZVb5i5t" | ||
| 191 | }, | ||
| 192 | { | ||
| 193 | "__type__": "cc.Camera", | ||
| 194 | "_name": "", | ||
| 195 | "_objFlags": 0, | ||
| 196 | "node": { | ||
| 197 | "__id__": 3 | ||
| 198 | }, | ||
| 199 | "_enabled": true, | ||
| 200 | "_cullingMask": 4294967295, | ||
| 201 | "_clearFlags": 7, | ||
| 202 | "_backgroundColor": { | ||
| 203 | "__type__": "cc.Color", | ||
| 204 | "r": 0, | ||
| 205 | "g": 0, | ||
| 206 | "b": 0, | ||
| 207 | "a": 255 | ||
| 208 | }, | ||
| 209 | "_depth": -1, | ||
| 210 | "_zoomRatio": 1, | ||
| 211 | "_targetTexture": null, | ||
| 212 | "_id": "dfrdGSAPdDCpridUZu5giH" | ||
| 213 | }, | ||
| 214 | { | ||
| 215 | "__type__": "cc.Node", | ||
| 216 | "_name": "Bg_long", | ||
| 217 | "_objFlags": 0, | ||
| 218 | "_parent": { | ||
| 219 | "__id__": 2 | ||
| 220 | }, | ||
| 221 | "_children": [], | ||
| 222 | "_active": true, | ||
| 223 | "_level": 1, | ||
| 224 | "_components": [ | ||
| 225 | { | ||
| 226 | "__id__": 6 | ||
| 227 | }, | ||
| 228 | { | ||
| 229 | "__id__": 7 | ||
| 230 | } | ||
| 231 | ], | ||
| 232 | "_prefab": null, | ||
| 233 | "_opacity": 255, | ||
| 234 | "_color": { | ||
| 235 | "__type__": "cc.Color", | ||
| 236 | "r": 255, | ||
| 237 | "g": 255, | ||
| 238 | "b": 255, | ||
| 239 | "a": 255 | ||
| 240 | }, | ||
| 241 | "_contentSize": { | ||
| 242 | "__type__": "cc.Size", | ||
| 243 | "width": 7280, | ||
| 244 | "height": 1110 | ||
| 245 | }, | ||
| 246 | "_anchorPoint": { | ||
| 247 | "__type__": "cc.Vec2", | ||
| 248 | "x": 0.5, | ||
| 249 | "y": 0.5 | ||
| 250 | }, | ||
| 251 | "_position": { | ||
| 252 | "__type__": "cc.Vec3", | ||
| 253 | "x": 0, | ||
| 254 | "y": 0, | ||
| 255 | "z": 0 | ||
| 256 | }, | ||
| 257 | "_scale": { | ||
| 258 | "__type__": "cc.Vec3", | ||
| 259 | "x": 1, | ||
| 260 | "y": 1, | ||
| 261 | "z": 1 | ||
| 262 | }, | ||
| 263 | "_rotationX": 0, | ||
| 264 | "_rotationY": 0, | ||
| 265 | "_quat": { | ||
| 266 | "__type__": "cc.Quat", | ||
| 267 | "x": 0, | ||
| 268 | "y": 0, | ||
| 269 | "z": 0, | ||
| 270 | "w": 1 | ||
| 271 | }, | ||
| 272 | "_skewX": 0, | ||
| 273 | "_skewY": 0, | ||
| 274 | "groupIndex": 0, | ||
| 275 | "_id": "9bJ6W6GQ9AuahEivQhXI7q" | ||
| 276 | }, | ||
| 277 | { | ||
| 278 | "__type__": "cc.Sprite", | ||
| 279 | "_name": "", | ||
| 280 | "_objFlags": 0, | ||
| 281 | "node": { | ||
| 282 | "__id__": 5 | ||
| 283 | }, | ||
| 284 | "_enabled": true, | ||
| 285 | "_srcBlendFactor": 770, | ||
| 286 | "_dstBlendFactor": 771, | ||
| 287 | "_spriteFrame": null, | ||
| 288 | "_type": 0, | ||
| 289 | "_sizeMode": 1, | ||
| 290 | "_fillType": 0, | ||
| 291 | "_fillCenter": { | ||
| 292 | "__type__": "cc.Vec2", | ||
| 293 | "x": 0, | ||
| 294 | "y": 0 | ||
| 295 | }, | ||
| 296 | "_fillStart": 0, | ||
| 297 | "_fillRange": 0, | ||
| 298 | "_isTrimmedMode": true, | ||
| 299 | "_state": 0, | ||
| 300 | "_atlas": null, | ||
| 301 | "_id": "71UYoTd3tBYZmtHLuAObd3" | ||
| 302 | }, | ||
| 303 | { | ||
| 304 | "__type__": "cc.Animation", | ||
| 305 | "_name": "", | ||
| 306 | "_objFlags": 0, | ||
| 307 | "node": { | ||
| 308 | "__id__": 5 | ||
| 309 | }, | ||
| 310 | "_enabled": true, | ||
| 311 | "_defaultClip": { | ||
| 312 | "__uuid__": "e0232f2e-c019-4cec-ac64-1cdf42ad3792" | ||
| 313 | }, | ||
| 314 | "_clips": [ | ||
| 315 | { | ||
| 316 | "__uuid__": "e0232f2e-c019-4cec-ac64-1cdf42ad3792" | ||
| 317 | } | ||
| 318 | ], | ||
| 319 | "playOnLoad": true, | ||
| 320 | "_id": "c6mMiohwNG6pU+M0q1YOzM" | ||
| 321 | }, | ||
| 322 | { | ||
| 323 | "__type__": "cc.Node", | ||
| 324 | "_name": "Hero", | ||
| 325 | "_objFlags": 0, | ||
| 326 | "_parent": { | ||
| 327 | "__id__": 2 | ||
| 328 | }, | ||
| 329 | "_children": [], | ||
| 330 | "_active": true, | ||
| 331 | "_level": 1, | ||
| 332 | "_components": [ | ||
| 333 | { | ||
| 334 | "__id__": 9 | ||
| 335 | } | ||
| 336 | ], | ||
| 337 | "_prefab": null, | ||
| 338 | "_opacity": 255, | ||
| 339 | "_color": { | ||
| 340 | "__type__": "cc.Color", | ||
| 341 | "r": 255, | ||
| 342 | "g": 255, | ||
| 343 | "b": 255, | ||
| 344 | "a": 255 | ||
| 345 | }, | ||
| 346 | "_contentSize": { | ||
| 347 | "__type__": "cc.Size", | ||
| 348 | "width": 0, | ||
| 349 | "height": 0 | ||
| 350 | }, | ||
| 351 | "_anchorPoint": { | ||
| 352 | "__type__": "cc.Vec2", | ||
| 353 | "x": 0.5, | ||
| 354 | "y": 0.5 | ||
| 355 | }, | ||
| 356 | "_position": { | ||
| 357 | "__type__": "cc.Vec3", | ||
| 358 | "x": -229, | ||
| 359 | "y": -220, | ||
| 360 | "z": 0 | ||
| 361 | }, | ||
| 362 | "_scale": { | ||
| 363 | "__type__": "cc.Vec3", | ||
| 364 | "x": 1, | ||
| 365 | "y": 1, | ||
| 366 | "z": 1 | ||
| 367 | }, | ||
| 368 | "_rotationX": 0, | ||
| 369 | "_rotationY": 0, | ||
| 370 | "_quat": { | ||
| 371 | "__type__": "cc.Quat", | ||
| 372 | "x": 0, | ||
| 373 | "y": 0, | ||
| 374 | "z": 0, | ||
| 375 | "w": 1 | ||
| 376 | }, | ||
| 377 | "_skewX": 0, | ||
| 378 | "_skewY": 0, | ||
| 379 | "groupIndex": 0, | ||
| 380 | "_id": "8cq0Mn63pN2YDLO5ii37LQ" | ||
| 381 | }, | ||
| 382 | { | ||
| 383 | "__type__": "dragonBones.ArmatureDisplay", | ||
| 384 | "_name": "", | ||
| 385 | "_objFlags": 0, | ||
| 386 | "node": { | ||
| 387 | "__id__": 8 | ||
| 388 | }, | ||
| 389 | "_enabled": true, | ||
| 390 | "_armatureName": "armatureName", | ||
| 391 | "_animationName": "Animation1", | ||
| 392 | "_preCacheMode": 0, | ||
| 393 | "_cacheMode": 0, | ||
| 394 | "playTimes": -1, | ||
| 395 | "premultipliedAlpha": false, | ||
| 396 | "_armatureKey": "e3ad9b78-ae63-4929-81c2-5781ca616f08#cdd960ea-e3ab-4991-a37d-3f8f88243de7", | ||
| 397 | "_accTime": 0, | ||
| 398 | "_playCount": 0, | ||
| 399 | "_frameCache": null, | ||
| 400 | "_curFrame": null, | ||
| 401 | "_playing": false, | ||
| 402 | "_armatureCache": null, | ||
| 403 | "_N$dragonAsset": { | ||
| 404 | "__uuid__": "e3ad9b78-ae63-4929-81c2-5781ca616f08" | ||
| 405 | }, | ||
| 406 | "_N$dragonAtlasAsset": { | ||
| 407 | "__uuid__": "cdd960ea-e3ab-4991-a37d-3f8f88243de7" | ||
| 408 | }, | ||
| 409 | "_N$_defaultArmatureIndex": 0, | ||
| 410 | "_N$_animationIndex": 1, | ||
| 411 | "_N$_defaultCacheMode": 0, | ||
| 412 | "_N$timeScale": 1, | ||
| 413 | "_N$debugBones": false, | ||
| 414 | "_N$enableBatch": false, | ||
| 415 | "_id": "69fvvqS0tJHpuXMcwVczRW" | ||
| 416 | }, | ||
| 417 | { | ||
| 418 | "__type__": "cc.Canvas", | ||
| 419 | "_name": "", | ||
| 420 | "_objFlags": 0, | ||
| 421 | "node": { | ||
| 422 | "__id__": 2 | ||
| 423 | }, | ||
| 424 | "_enabled": true, | ||
| 425 | "_designResolution": { | ||
| 426 | "__type__": "cc.Size", | ||
| 427 | "width": 960, | ||
| 428 | "height": 640 | ||
| 429 | }, | ||
| 430 | "_fitWidth": false, | ||
| 431 | "_fitHeight": true, | ||
| 432 | "_id": "72z44+175OfaMOhtsD1Huo" | ||
| 433 | }, | ||
| 434 | { | ||
| 435 | "__type__": "46717GP6RtOGobAYIAnkxCA", | ||
| 436 | "_name": "", | ||
| 437 | "_objFlags": 0, | ||
| 438 | "node": { | ||
| 439 | "__id__": 2 | ||
| 440 | }, | ||
| 441 | "_enabled": true, | ||
| 442 | "_cLog": null, | ||
| 443 | "_cApplication": null, | ||
| 444 | "_cFocus": null, | ||
| 445 | "_aFocusTargets": [], | ||
| 446 | "_fiCurrentFocus": null, | ||
| 447 | "_iSceneStatus": 0, | ||
| 448 | "_fFocusScaleFactor": 1.06, | ||
| 449 | "_bIsFocusInit": false, | ||
| 450 | "_oSceneContext": null, | ||
| 451 | "_oNextSceneParameter": null, | ||
| 452 | "_compPlayer": null, | ||
| 453 | "_aTouchContext": [], | ||
| 454 | "_defaultBackScene": null, | ||
| 455 | "_oFocusScaleFactorInfo": null, | ||
| 456 | "holdClick": false, | ||
| 457 | "_bShowExitBox": false, | ||
| 458 | "_id": "01a+mE585Ho7WhSVhlk2o5" | ||
| 459 | } | ||
| 460 | ] | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
assets/Scene/sceneExploreNew.fire.meta
0 → 100644
| ... | @@ -19,7 +19,7 @@ cc.Class({ | ... | @@ -19,7 +19,7 @@ cc.Class({ |
| 19 | 19 | ||
| 20 | onLoad: function () { | 20 | onLoad: function () { |
| 21 | this._super(); | 21 | this._super(); |
| 22 | this._hero_start_x = 500; | 22 | this._hero_start_x = 400; |
| 23 | this.bg_1 = this.node.getChildByName("bg_1"); | 23 | this.bg_1 = this.node.getChildByName("bg_1"); |
| 24 | this.bg_2 = this.node.getChildByName("bg_2"); | 24 | this.bg_2 = this.node.getChildByName("bg_2"); |
| 25 | this.cur_bg = this.bg_1; | 25 | this.cur_bg = this.bg_1; |
| ... | @@ -28,6 +28,8 @@ cc.Class({ | ... | @@ -28,6 +28,8 @@ cc.Class({ |
| 28 | this.animLayer = this.testmap.getComponent(cc.TiledMap).getLayer("Animal"); | 28 | this.animLayer = this.testmap.getComponent(cc.TiledMap).getLayer("Animal"); |
| 29 | this.hero = this.node.getChildByName("hero"); | 29 | this.hero = this.node.getChildByName("hero"); |
| 30 | this._hero_y = this.hero.y; | 30 | this._hero_y = this.hero.y; |
| 31 | |||
| 32 | this.startRun=true; | ||
| 31 | }, | 33 | }, |
| 32 | 34 | ||
| 33 | keyDownDirection: function (Direct) { | 35 | keyDownDirection: function (Direct) { |
| ... | @@ -70,8 +72,9 @@ cc.Class({ | ... | @@ -70,8 +72,9 @@ cc.Class({ |
| 70 | case cc.macro.KEY.enter: | 72 | case cc.macro.KEY.enter: |
| 71 | case cc.macro.KEY.space: | 73 | case cc.macro.KEY.space: |
| 72 | case Common.ANDROID_KEY.enter: | 74 | case Common.ANDROID_KEY.enter: |
| 73 | this._hero_start_x += 100; | 75 | // this._hero_start_x += 100; //造成误差 |
| 74 | this._speed = 1; | 76 | this._speed = 1; |
| 77 | this.startRun=true; | ||
| 75 | // this.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation("Animation1"); | 78 | // this.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation("Animation1"); |
| 76 | // this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK); | 79 | // this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK); |
| 77 | break; | 80 | break; |
| ... | @@ -92,23 +95,27 @@ cc.Class({ | ... | @@ -92,23 +95,27 @@ cc.Class({ |
| 92 | this.bg_2.x = this.bg_1.x + 1820; | 95 | this.bg_2.x = this.bg_1.x + 1820; |
| 93 | this.cur_bg = this.bg_1; | 96 | this.cur_bg = this.bg_1; |
| 94 | } else { | 97 | } else { |
| 95 | this.bg_1.x = this.bg_2.x + 1820; | 98 | this.bg_1.x = this.bg_2.x + 1815; |
| 96 | this.cur_bg = this.bg_2; | 99 | this.cur_bg = this.bg_2; |
| 97 | } | 100 | } |
| 98 | } | 101 | } |
| 99 | 102 | ||
| 103 | // cc.log("背景图位置:"+this.cur_bg.x); | ||
| 104 | |||
| 100 | // cc.log("hero位置--------》" + this._hero_start_x); | 105 | // cc.log("hero位置--------》" + this._hero_start_x); |
| 101 | var pos = this._getTilePos(cc.v2(this._hero_start_x, 4)); | 106 | var pos = this._getTilePos(cc.v2(this._hero_start_x, 4)); |
| 107 | // cc.log("pos位置------------------》"+pos); | ||
| 102 | // cc.log("位置----------》"+pos); | 108 | // cc.log("位置----------》"+pos); |
| 103 | if (this._hero_start_x < this._hero_end_x) { //不能超过瓦片地图最长长度 | 109 | // if (this._hero_start_x < this._hero_end_x) { //不能超过瓦片地图最长长度 |
| 104 | //判断gid是否为0,该地图位置就会出现障碍物 | 110 | // //判断gid是否为0,该地图位置就会出现障碍物 |
| 105 | var gid = this.animLayer.getTileGIDAt(pos); | 111 | // var gid = this.animLayer.getTileGIDAt(pos); |
| 106 | // cc.log("gid========" + gid); | 112 | // // cc.log("gid========" + gid); |
| 107 | if (gid != 0) { | 113 | // if (gid != 0 && this.startRun) { |
| 108 | this._speed = 0; | 114 | // this.startRun=false; |
| 109 | this.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation(""); | 115 | // this._speed = 0; |
| 110 | } | 116 | // this.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation(""); |
| 111 | } | 117 | // } |
| 118 | // } | ||
| 112 | }, | 119 | }, |
| 113 | 120 | ||
| 114 | doCurrentFocusTVLinkAction: function (strAction) { | 121 | doCurrentFocusTVLinkAction: function (strAction) { | ... | ... |
assets/Script/ExploreNew.js
0 → 100644
| 1 | var Common = require('Common'); | ||
| 2 | var Network = require('Network'); | ||
| 3 | var TVFocus = require('TVFocus'); | ||
| 4 | var FocusInfo = require('FocusInfo'); | ||
| 5 | var TVCanvas = require('TVCanvas'); | ||
| 6 | var TVScrollParameter = require('TVScrollParameter'); | ||
| 7 | var ListView = require('ListView'); | ||
| 8 | var ListCell = require('ListCell'); | ||
| 9 | var xmlToJSON=require('xmlToJSON'); | ||
| 10 | |||
| 11 | cc.Class({ | ||
| 12 | extends: TVCanvas, | ||
| 13 | |||
| 14 | properties: { | ||
| 15 | |||
| 16 | }, | ||
| 17 | |||
| 18 | onLoad: function () { | ||
| 19 | this._super(); | ||
| 20 | |||
| 21 | var self=this; | ||
| 22 | //动态加载背景图,需指定类型(需要拼接图片),指定尺寸(目前使用的是7280*720) | ||
| 23 | cc.loader.loadRes("game/explore_plus", cc.Texture2D, function (err, texture) { | ||
| 24 | self.node.getChildByName("Bg_long").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture); | ||
| 25 | }); | ||
| 26 | |||
| 27 | cc.loader.loadRes("config/explore_config",function(err,str){ | ||
| 28 | cc.log("源xml--------------->"+str); | ||
| 29 | // var result=xmlToJSON.parseString(str); | ||
| 30 | var x2js = new xmlToJSON(); | ||
| 31 | var result=x2js.xml_str2json(str); | ||
| 32 | cc.log("解析后xml------------>"+JSON.stringify(result)); | ||
| 33 | cc.log("解析后xml------------>"+result.root.explore[0]["_choice2"]); | ||
| 34 | // cc.log("解析后xml------------>"+result.root[0].explore[0]["_attr"].name["_value"]); | ||
| 35 | }) | ||
| 36 | }, | ||
| 37 | |||
| 38 | update:function(){ | ||
| 39 | // cc.log("背景图片-----------------》"+this.node.getChildByName("Bg_long").x); | ||
| 40 | }, | ||
| 41 | |||
| 42 | }); |
assets/Script/ExploreNew.js.meta
0 → 100644
assets/Script/custom/xmlToJSON.js
0 → 100644
This diff is collapsed.
Click to expand it.
assets/Script/custom/xmlToJSON.js.meta
0 → 100644
assets/Texture/anim/bg_roll.anim
0 → 100644
| 1 | { | ||
| 2 | "__type__": "cc.AnimationClip", | ||
| 3 | "_name": "bg_roll", | ||
| 4 | "_objFlags": 0, | ||
| 5 | "_native": "", | ||
| 6 | "_duration": 7.5, | ||
| 7 | "sample": 8, | ||
| 8 | "speed": 0.3, | ||
| 9 | "wrapMode": 2, | ||
| 10 | "curveData": { | ||
| 11 | "props": { | ||
| 12 | "x": [ | ||
| 13 | { | ||
| 14 | "frame": 0, | ||
| 15 | "value": 2899 | ||
| 16 | }, | ||
| 17 | { | ||
| 18 | "frame": 7.5, | ||
| 19 | "value": -744 | ||
| 20 | } | ||
| 21 | ] | ||
| 22 | } | ||
| 23 | }, | ||
| 24 | "events": [] | ||
| 25 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
assets/Texture/anim/bg_roll.anim.meta
0 → 100644
assets/Texture/game/explore_plus.png
0 → 100644
210 KB
assets/Texture/game/explore_plus.png.meta
0 → 100644
| 1 | { | ||
| 2 | "ver": "2.2.0", | ||
| 3 | "uuid": "41a684e8-62cf-464e-81a6-04833d9d9628", | ||
| 4 | "type": "sprite", | ||
| 5 | "wrapMode": "clamp", | ||
| 6 | "filterMode": "bilinear", | ||
| 7 | "premultiplyAlpha": false, | ||
| 8 | "subMetas": { | ||
| 9 | "explore_plus": { | ||
| 10 | "ver": "1.0.4", | ||
| 11 | "uuid": "9c2b11fd-1118-470b-985d-60b8b4617e25", | ||
| 12 | "rawTextureUuid": "41a684e8-62cf-464e-81a6-04833d9d9628", | ||
| 13 | "trimType": "auto", | ||
| 14 | "trimThreshold": 1, | ||
| 15 | "rotated": false, | ||
| 16 | "offsetX": 0, | ||
| 17 | "offsetY": 0, | ||
| 18 | "trimX": 0, | ||
| 19 | "trimY": 0, | ||
| 20 | "width": 7280, | ||
| 21 | "height": 1110, | ||
| 22 | "rawWidth": 7280, | ||
| 23 | "rawHeight": 1110, | ||
| 24 | "borderTop": 0, | ||
| 25 | "borderBottom": 0, | ||
| 26 | "borderLeft": 0, | ||
| 27 | "borderRight": 0, | ||
| 28 | "subMetas": {} | ||
| 29 | } | ||
| 30 | } | ||
| 31 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
assets/resources/config.meta
0 → 100644
assets/resources/config/explore_config.xml
0 → 100644
| 1 | <root> | ||
| 2 | |||
| 3 | <explore id="1" id2="1" name="555,没人陪我玩,好寂寞。" type="1" map="1" choice1="陪陪蜥蜴,和它交朋友" choice2="陪它去看《小猪佩奇》,开朗的孩子朋友多。" function="1:500054" image="xiyi.png" reward="10001:100"/> | ||
| 4 | <explore id="2" id2="1" name="555,没人陪我玩,好寂寞。" type="1" map="1" choice1="陪陪蜥蜴,和它交朋友" choice2="去玩叠蛋糕给它看,这个小游戏可好玩了!" function="2:300056" image="xiyi.png" reward="10001:100"/> | ||
| 5 | <explore id="3" id2="1" name="555,没人陪我玩,好寂寞。" type="1" map="1" choice1="陪陪蜥蜴,和它交朋友" choice2="和小狗一起听儿歌:工程车之歌" function="3:18897" image="xiyi.png" reward="10001:100"/> | ||
| 6 | <explore id="4" id2="1" name="555,没人陪我玩,好寂寞。" type="1" map="1" choice1="我想和别的小动物一起玩。" choice2="" function="1:500054" image="xiyi.png" reward="10001:100"/> | ||
| 7 | <explore id="5" id2="1" name="捡到一个宝箱。" type="2" map="1" choice1="" choice2="" function="1:500054" image="baoxiang.png" reward="10001:100"/> | ||
| 8 | <explore id="6" id2="1" name="迷路了,进度减少10%" type="3" map="1" choice1="" choice2="" function="1:500054" image="xiyi.png" reward="10001:100"/> | ||
| 9 | <explore id="7" id2="1" name="找到了捷径,进度增加10%" type="4" map="1" choice1="" choice2="" function="1:500054" image="xiyi.png" reward="10001:100"/> | ||
| 10 | |||
| 11 | </root> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
assets/resources/game/explore_plus.png
0 → 100644
210 KB
assets/resources/game/explore_plus.png.meta
0 → 100644
| 1 | { | ||
| 2 | "ver": "2.2.0", | ||
| 3 | "uuid": "4ade9de4-3d39-4b87-a82b-92f8ded29646", | ||
| 4 | "type": "sprite", | ||
| 5 | "wrapMode": "clamp", | ||
| 6 | "filterMode": "bilinear", | ||
| 7 | "premultiplyAlpha": false, | ||
| 8 | "subMetas": { | ||
| 9 | "explore_plus": { | ||
| 10 | "ver": "1.0.4", | ||
| 11 | "uuid": "0dde25a8-400a-4010-ba37-017445b4e960", | ||
| 12 | "rawTextureUuid": "4ade9de4-3d39-4b87-a82b-92f8ded29646", | ||
| 13 | "trimType": "auto", | ||
| 14 | "trimThreshold": 1, | ||
| 15 | "rotated": false, | ||
| 16 | "offsetX": 0, | ||
| 17 | "offsetY": 0, | ||
| 18 | "trimX": 0, | ||
| 19 | "trimY": 0, | ||
| 20 | "width": 7280, | ||
| 21 | "height": 1110, | ||
| 22 | "rawWidth": 7280, | ||
| 23 | "rawHeight": 1110, | ||
| 24 | "borderTop": 0, | ||
| 25 | "borderBottom": 0, | ||
| 26 | "borderLeft": 0, | ||
| 27 | "borderRight": 0, | ||
| 28 | "subMetas": {} | ||
| 29 | } | ||
| 30 | } | ||
| 31 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment