tileUtilities icon indicating copy to clipboard operation
tileUtilities copied to clipboard

Uncaught TypeError: Cannot read property 'data' of undefined

Open lawalm opened this issue 9 years ago • 4 comments

Hello, I am getting this above error. I am Using the timeBombPanic tmx map.

This is the code:

let Container = PIXI.Container, autoDetectRenderer = PIXI.autoDetectRenderer, Graphics = PIXI.Graphics, Sprite = PIXI.Sprite, MovieClip = PIXI.extras.MovieClip, TilingSprite = PIXI.extras.TilingSprite, loader = PIXI.loader, resources = PIXI.loader.resources, TextureCache = PIXI.utils.TextureCache;

let stage = new Container(), renderer = autoDetectRenderer(800, 600); document.body.appendChild(renderer.view);

//let state = play;

loader .add('assets/timeBombPanic.png') .add('assets/timeBombPanic.json') .load(setup);

let world, alien, wallMapArray, bombMapArray, bombSprites, bombLayer, leftArrow, upArrow, downArrow, rightArrow;

function setup() { let tu = new TileUtilities(PIXI);

world = tu.makeTiledWorld( "maps/timeBombPanic.json", "images/timeBombPanic.png" );

}

Any help will be much appreciated, thanks.

lawalm avatar Jul 05 '16 10:07 lawalm

Thanks Marlene, you found a bug! 👍 I've update the code which hopefully fixes it. Could you please try it again with the new new code and let me know if you're still experiencing the same problem? If you are, could upload your files onto Dropbox for me? I'll test them locally on my machine track down what the problem might be.

Thanks again for helping with this, I really appreciate your effort and patience! 😄

kittykatattack avatar Jul 10 '16 14:07 kittykatattack

Hello, Will do. I like coding prototypes with Hexi and I bought your Foundation and Advanced book. Working through the advanced book I noticed similarities with Hexi hence my interest.

Regards Marlene

On Sun, Jul 10, 2016 at 3:18 PM, kittykatattack [email protected] wrote:

Thanks Marlene, you found a bug! 👍 I've update the code which hopefully fixes it. Could you please try it again with the new new code and let me know if you're still experiencing the same problem? If you are, could upload your files onto Dropbox for me? I'll test them locally on my machine track down what the problem might be.

Thanks again for helping with this, I really appreciate your effort and patience! 😄

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kittykatattack/tileUtilities/issues/1#issuecomment-231591385, or mute the thread https://github.com/notifications/unsubscribe/ALP51sPrXE6-cMo5LTyfy5R_7JA8SFzfks5qUP9DgaJpZM4JE-VQ .

lawalm avatar Jul 10 '16 17:07 lawalm

Hello, I have tested the update and still getting error on line 490 of coreJS. What name or email address should I use to link so you can access the folder in my dropbox. Regards Marlene.

lawalm avatar Jul 11 '16 08:07 lawalm

Hi Marlene,

I checked your files 😄 The first problem was just that you needed to include the full path names of the json and png file, like this:

  world = tu.makeTiledWorld(
    "assets/timeBombPanic.json",
    "assets/timeBombPanic.png"
  );

Just use exactly the same names that you gave Pixi's loader.

The second problem appears to be that you've exported the array data in the JSON file as Base64. IT needs to be in CSV format (Comma Separated Values.)

Change this in Tiled Editor by going to Map -> Map Properties. The scrolling down the Properties window to Tile Layer Format and change this to CSV. Then export the map in JSON and try re-loading with Pixi (as you've been doing.)

Let me know how it goes 😄

kittykatattack avatar Jul 17 '16 20:07 kittykatattack