danhett Posted November 12, 2015 Share Posted November 12, 2015 Hello! So, I've got a small Phaser game and I'm using Tiled to create my levels. I currently have two tile layers that work great. However, when I add an Object layer with a single object PNG in it, my game hangs: Chrome pauses for a bit and goes to the "aw snap!" page and Firefox throws an Unresponsive Script error. Interestingly this happens as soon as I add anything to my Tiled items list - I'm not even instantiating anything in Phaser yet. All I need to do to cause the error is create a new Object layer, add a PNG, and then when I try that level it tips over. For some reason as soon as it exists in the JSON output it causes problems. Has anyone got any idea why this might be? Thanks! Link to comment Share on other sites More sharing options...
rich Posted November 12, 2015 Share Posted November 12, 2015 It has to be the Tiled Parser getting stuck in a loop. I'd suggest posting the JSON here (don't need the pngs, just the output will do). Link to comment Share on other sites More sharing options...
danhett Posted November 12, 2015 Author Share Posted November 12, 2015 Cool, here's a very simplified example.level01.json.zip Link to comment Share on other sites More sharing options...
rich Posted November 12, 2015 Share Posted November 12, 2015 Well that was a fun one! https://github.com/photonstorm/phaser/commit/8b0224e7b4b35f7f72319785c5e497b8f67f49f1 drhayes 1 Link to comment Share on other sites More sharing options...
danhett Posted November 12, 2015 Author Share Posted November 12, 2015 Yay, I'm helping! Will give it a whirl now, thanks for the prompt response! Link to comment Share on other sites More sharing options...
danhett Posted November 12, 2015 Author Share Posted November 12, 2015 Rebuilt, works like a charm. Thanks a million Rich. Come for the game engine, stay for the service. Link to comment Share on other sites More sharing options...
rich Posted November 12, 2015 Share Posted November 12, 2015 Awesome I'm surprised no-one spotted that before! I guess it shows how often that feature of Tiled is used. Link to comment Share on other sites More sharing options...
jmp909 Posted November 12, 2015 Share Posted November 12, 2015 Oh i thought they just weren't supported Link to comment Share on other sites More sharing options...
danhett Posted November 12, 2015 Author Share Posted November 12, 2015 OK actually, I'm still seeing this issue - definitely using the latest dev branch that I've just rebuilt.... Do you have it working at your end Rich? Link to comment Share on other sites More sharing options...
danhett Posted November 12, 2015 Author Share Posted November 12, 2015 Oh! Disregard that - error between chair and monitor. All good. Link to comment Share on other sites More sharing options...
agmcleod Posted November 12, 2015 Share Posted November 12, 2015 That classic error. At least let/const usage in es6 will help prevent Link to comment Share on other sites More sharing options...
jmp909 Posted November 13, 2015 Share Posted November 13, 2015 ah sorry, my error occurs when trying to use an image collection for a tilemap layer. if they're used in an object layer it picks them up fine. if they're used in a tilemap layer. phaser bombs out with this errorTypeError: Cannot read property '2' of undefined(…) Link to comment Share on other sites More sharing options...
Recommended Posts