Piggy Posted March 19, 2014 Share Posted March 19, 2014 Hi,I tried upgrading my game from Phaser 1.1.5 to 2.0, but keep getting some error related to my tilemap. Running the game causes a crash in phaser with the following message: "Uncaught TypeError: Cannot read property '2' of undefined". The crash happens at row 49668, which is in the method Phaser.TilemapLayer.prototype.render. From what I can tell, I don't load my tilemap or layers in any way that is different from the updated examples, so I can't really figure out what is wrong. Does anyone have any idea of where to start looking? Link to comment Share on other sites More sharing options...
rich Posted March 19, 2014 Share Posted March 19, 2014 Do you have the game online anywhere? It's much quicker to tell what is going on that way. Link to comment Share on other sites More sharing options...
kass Posted March 19, 2014 Share Posted March 19, 2014 Hi,I tried upgrading my game from Phaser 1.1.5 to 2.0, but keep getting some error related to my tilemap. Running the game causes a crash in phaser with the following message: "Uncaught TypeError: Cannot read property '2' of undefined". The crash happens at row 49668, which is in the method Phaser.TilemapLayer.prototype.render. From what I can tell, I don't load my tilemap or layers in any way that is different from the updated examples, so I can't really figure out what is wrong. Does anyone have any idea of where to start looking?i got the "Uncaught TypeError: Cannot read property '2' of undefined" error when i rotated a tile in my map editor. maybe thats whats causing your problem? if so its a simple fix Piggy 1 Link to comment Share on other sites More sharing options...
Piggy Posted March 20, 2014 Author Share Posted March 20, 2014 Do you have the game online anywhere? It's much quicker to tell what is going on that way.Yeah, we just made our repo public. You can find it here: https://github.com/werme/DATX02The branch that we are working on is feature/phaser-2.0. We load our assets in preloader.js, and the code for using the tilemap can be found in level.js. Link to comment Share on other sites More sharing options...
Piggy Posted March 20, 2014 Author Share Posted March 20, 2014 i got the "Uncaught TypeError: Cannot read property '2' of undefined" error when i rotated a tile in my map editor. maybe thats whats causing your problem? if so its a simple fixHmm... I doubt that would be the case since it was working as intended in Phaser-1.1.5, and broke when we tried to use 2.0? We have changed nothing about the assets (images and json files). Link to comment Share on other sites More sharing options...
Piggy Posted March 20, 2014 Author Share Posted March 20, 2014 I think I found what was wrong. Some of our TileMaps had tile-indexes with the value 1337, which seems to have been to high(?) for the new version of Phaser. Anyway, changing the value to something lower seems to fix our problems. Link to comment Share on other sites More sharing options...
Recommended Posts