How do I load tile map with phaser 3

Recommended Posts


I created a simple tilemap with tiled, and I'm trying to load it. The code and files can be seen here:


I'm not getting any errors in the console, but the canvas is just a black square. Any ideas what I am doing wrong?

      var game = new Phaser.Game(config);

      function preload() {
        this.load.image("tiles", "assets/tiles.png");
        this.load.tilemapTiledJSON("World", "assets/tilemap2.json");
      function create() {
        this.map = this.add.tilemap("World");
        var tileset = this.map.addTilesetImage("tiles", "tiles");
        his.backgroundLayer = this.map.createStaticLayer("World", tileset);

The timemap.json from Tiles is below:

{ "height":100,
         "data":[3, 3, 3, 3, 3, 3, 3, 3, ...[data omitted]..., 3, 3],


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.