Jump to content

Cannot read property 'addTilesetImage' of undefined, error!


XipsAhoy
 Share

Recommended Posts

I am trying to make a game so I tried to load a tileset, to help me make the game, but when I try to play my game, this shows on the console- ```Cannot read property 'addTilesetImage' of undefined```

This is my code:

```

 
Ball.Level1 = function (game) {};
Ball.Level1.prototype = {
    create: function () {
        
 
        var map;
 
        var layer;
        
        this.map.addTilesetImage('element-h');
        this.map.addTilesetImage('element-w');
 
        this.map = this.game.add.tilemap('map'3232);
    
        this.layer = this.map.createLayer(0);
 
        this.layer.resizeWorld();
 
    }
};
```

this is what I pre-load!

```

        this.load.image('element-w''img/element-w.png');
        this.load.image('element-h''img/element-h.png');
        this.load.tilemap('map''img/Teste.csv');

```

Thank for your help!

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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