Will Posted April 5, 2014 Share Posted April 5, 2014 Hey there Been having some trouble with Phaser and rendering CSV tilemaps. I have basically copied the code from the CSV example, in an attempt to get CSV rendering to actually work. Things work (kinda) well when the tile size is 32x32, if I change the tile size to 16x16 as soon as the game loads I get a "Cannot read property 2 of undefined" from line 50,363. I'm using Phaser 2.0.2. Also, the same problem happens when I scroll the camera to the far right of the map, same error thrown, even with tile size 32x32. My tilemaps look like this - 0, 1, 1, 1, 1, 1, 0,1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1But a whole lot bigger. Only contains zeros and ones, though the tileset has 4 tiles in it. EDIT: Just tried Phaser 2.0.3, get the same error. EDIT2: I recoded most of it, hadn't done a lot. It then accepted 16x16 tiles fine, still threw the error when I scrolled right. Decided to use the assets from the example, and it all worked fine! Not sure why, but I'm gonna have a mess with my assets until this works... Is there an exact specification to what they have to be like? Link to comment Share on other sites More sharing options...
Will Posted April 5, 2014 Author Share Posted April 5, 2014 Ok, just making a new post so I can mark it as the answer. When loading a tilemap from a CSV, phaser doesn't like having commas on the end of the line. So1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, Would throw an error, but1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1Would not. Link to comment Share on other sites More sharing options...
Recommended Posts