inedible Posted June 9, 2017 Share Posted June 9, 2017 Hi chaps, I'm following the es6 pattern as prescribed by generator-phaser-plus [https://www.npmjs.com/package/generator-phaser-plus] but having a little trouble attaching my tilemaps for usage. I'm simply using the asset loader to auto load all the assets in the preloader class, and i can see them in the cache > _cache object in the phaser game object when I log it out to the console. However, when i try to the use map I seem to end up with a 'Type error: map.tiles[tile.index] is undefined'. I am wondering if I need to build a 'world' object in the same way the sprites are added, or more traditionally like in the game class itself.... it seems whatever I try I end up with a similar error. It feels like I should be just calling them in the game class in the traditional way, by initially setting the map and then fetching the images and creating the layers, the only things that puts me off of this is that everything else seems to be loaded as its own module. I'm yet to find any examples of tiling in the es6 approach, so any tips will be much appreciated. I can provide some code example and screenies, but i thought I should test the waters and see if there was any activity here first. Thanks, Steffen. Link to comment Share on other sites More sharing options...
Recommended Posts