In my modularized project, my tilemap works well, here is the start of the create method for my level 1 class.
create(){
this.map = this.add.tilemap("level1_map");
var tileset = this.map.addTilesetImage("tileset", "level1_tileset", 16, 16, 1, 2);
console.log(this.map)
this.layer = this.map.createLayer(0, tileset, 0, 0)
In the modularized version, everything is fine, the log statement shows that it’s a Tilemap object and it has the createLayer method.
But after packaging into one file with webpack, the log statement shows this with the following error.
It says this.map (and everything else) is of type “initialize”, whatever that means. Nothing is different about the code, all I did was package it. I thought maybe the issue was that I’m not including the map.json or tileset correctly, but I’ve double checked and they seem fine.
What does it mean when something is of type “initialize” ?