Jump to content

Search the Community

Showing results for tags '2 undefined'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Here is the code from an example. I have separte tiles images. <!doctype html> <html> <head> <script src="phaser.min.js"></script> </head> <body> <script> var game = new Phaser.Game(1024, 1024, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create }); function preload() { game.load.tilemap('map', 'bsdmap.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('terrain', 'terrain.png'); game.load.image('p1', 'p1.png'); game.load.image('p2', 'p2.png'); game.load.image('bg_tile', 'bg_tile.png') //game.load.image('phaser', 'assets/sprites/arrow.png'); //game.load.spritesheet('coin', 'assets/sprites/coin.png', 32, 32); } var map; var layer; function create() { map = game.add.tilemap('map'); map.addTilesetImage('terrain'); map.addTilesetImage('p1'); map.addTilesetImage('p2'); map.addTilesetImage('bg_tile'); layer = map.createLayer('Tile Layer 1'); layer.resizeWorld(); } </script> </body> </html> Here is a tiled map in json format { "height":32, "infinite":false, "layers":[ { "data":[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 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 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 4, 3, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2147483652, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], "height":32, "name":"Tile Layer 1", "opacity":1, "type":"tilelayer", "visible":true, "width":32, "x":0, "y":0 }], "nextobjectid":1, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"1.1.2", "tileheight":32, "tilesets":[ { "columns":0, "firstgid":1, "grid": { "height":1, "orientation":"orthogonal", "width":1 }, "margin":0, "name":"tileset", "spacing":0, "tilecount":4, "tileheight":32, "tileproperties": { "0": { "blocked":"" }, "1": { "blocked":"" }, "2": { "platform":"" }, "3": { "platform":"" } }, "tilepropertytypes": { "0": { "blocked":"string" }, "1": { "blocked":"string" }, "2": { "platform":"string" }, "3": { "platform":"string" } }, "tiles": { "0": { "image":"..\/..\/..\/..\/Users\/Andrew\/Desktop\/totem burners assets\/tiles2\/terrain.png", "imageheight":32, "imagewidth":32 }, "1": { "image":"..\/..\/..\/..\/Users\/Andrew\/Desktop\/totem burners assets\/tiles2\/bg_tile.png", "imageheight":32, "imagewidth":32 }, "2": { "image":"..\/..\/..\/..\/Users\/Andrew\/Desktop\/totem burners assets\/tiles2\/p1.png", "imageheight":32, "imagewidth":32 }, "3": { "image":"..\/..\/..\/..\/Users\/Andrew\/Desktop\/totem burners assets\/tiles2\/p2.png", "imageheight":32, "imagewidth":32 } }, "tilewidth":32 }], "tilewidth":32, "type":"map", "version":1, "width":32 } All the tiles are embedded in Tiled. But I got an error: Uncaught TypeError: Cannot read property '2' of undefined at Object.parseTiledJSON (phaser.min.js:3) at Object.parse (phaser.min.js:3) at new i.Tilemap (phaser.min.js:3) at i.GameObjectFactory.tilemap (phaser.min.js:3) at Object.create (index.html:33) at i.StateManager.loadComplete (phaser.min.js:3) at i.Loader.finishedLoading (phaser.min.js:3) at i.Loader.processLoadQueue (phaser.min.js:3) at i.Loader.asyncComplete (phaser.min.js:3) at i.Loader.fileComplete (phaser.min.js:3)
×
×
  • Create New...