oxysoft Posted March 15, 2015 Share Posted March 15, 2015 I thought it could have been my tiled json that was improper or whatever but I tried using the Desert.json along with the tileset from the phaser examples and it's the same result Picture: This is the code used to create the map and the ground layervar map = this.game.add.tilemap('desert');map.addTilesetImage('desert', 'tiles');var layer = map.createLayer(0);Note thatcreateLayer('Ground')has no effect and yields the following error message in the consoleTilemap.createLayer: Invalid layer ID given: nullSo I logged to the console the name of the layer which is supposed to be Ground according to the json file and phaser examples and it came up as layer for some reasonsFurthermore, the width of the map is always equal to 2 despite being set to 40 in the json file.Logging to the console more properties from the map seems to reveal that they are all set to default values. So is it failing to read the json or what? This is the statement used to load it in the preload functionthis.game.load.tilemap('desert', 'assets/desert.json', null, Phaser.TILEMAP.TILED_JSON);Thanks Link to comment Share on other sites More sharing options...
oxysoft Posted March 15, 2015 Author Share Posted March 15, 2015 Nevermind, It should have been Tilemap and not TILEMAP. Odd that it didn't result in any error though, setting up a difficult situation to debug. Kinda weird how I noticed immediately after posting Link to comment Share on other sites More sharing options...
Huggz Posted March 15, 2015 Share Posted March 15, 2015 Kinda weird how I noticed immediately after posting This is a little off topic of the original post, but not it isn't, and here's why. When you make a detailed forum post it causes you to think critically about things you might not have thought about before. In my day to day programming I've come to practice a programming methodology which I've dubbed "StackOverflow Programming." When I have a problem that I just can't solve, I start writing up a post for SO or whatever forum can help me. I'm sure to be as detailed as I can to be sure that whoever will be reading it won't need any more information from me. This ensures that I've seen as many of the facts as I can. Then I check and double check that what I'm writing down is true to the situation. If, by the time I consider the post finished, I have not figured out the problem, I hit that submit button. But let me tell you, I only submit about 10% of the forum posts I start, and half of those are answered by me within an hour. This isn't an entirely unusual idea either. You get the same benefits from talking your problem over with another person (knowledgable programmer or not), or even... a teddy bear (http://blog.adrianbolboaca.ro/2012/12/teddy-bear-pair-programming/) theoutlander and valueerror 2 Link to comment Share on other sites More sharing options...
oxysoft Posted March 15, 2015 Author Share Posted March 15, 2015 This is a little off topic of the original post, but not it isn't, and here's why. When you make a detailed forum post it causes you to think critically about things you might not have thought about before. In my day to day programming I've come to practice a programming methodology which I've dubbed "StackOverflow Programming." When I have a problem that I just can't solve, I start writing up a post for SO or whatever forum can help me. I'm sure to be as detailed as I can to be sure that whoever will be reading it won't need any more information from me. This ensures that I've seen as many of the facts as I can. Then I check and double check that what I'm writing down is true to the situation. If, by the time I consider the post finished, I have not figured out the problem, I hit that submit button. But let me tell you, I only submit about 10% of the forum posts I start, and half of those are answered by me within an hour. This isn't an entirely unusual idea either. You get the same benefits from talking your problem over with another person (knowledgable programmer or not), or even... a teddy bear (http://blog.adrianbolboaca.ro/2012/12/teddy-bear-pair-programming/) Haha yeah, that is indeed very true. I think the teddy bear pair programming is more popular under the name of rubber duck debugging! Link to comment Share on other sites More sharing options...
Recommended Posts