Jump to content

Phaser Tilemap with layers, how to load?


Mizukage
 Share

Recommended Posts

I have map what I made in 'Tiled' this map have two layers 'firstFlor' and 'firstFloorBlock' and mape have a name 'map1'
and for make this map I used three tilesets png with names tile1 tile2 tile3

Than I load those stuff in preload.js like a 

        this.game.load.tilemap('map1', 'maps/map1.json', null, Phaser.Tilemap.TILED_JSON);        this.game.load.image('tile1', "maps/tile1.png");        this.game.load.image('tile2', "maps/tile2.png");        this.game.load.image('tile3', "maps/tile3.png");

And here is the point, I have no idea how to load those things in game in create function

map = this.game.add.tilemap('map1');        map.addTilesetImage('tile1');        map.addTilesetImage('tile2');        map.addTilesetImage('tile3');        layer = map.createLayer('firstFloor');        layer.resizeWorld();        layer.wrap = true;        var layer2 = map.createLayer('firstFloorBlock');

But is a pice of scrap... and not working at all

Link to comment
Share on other sites

That was an error with coding style, map has 64..... Phaser need SVN If Im right

 

 

I'm sorry, but I'm not sure what you are referring to. If you place your code and JSON files in something like http://pastebin.com, and upload your tiles images to something like http://imgur.com -- it will enable us to help you figure out what the issue might be.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...