0
votes

I have a JavaScript game, using the Phaser 2 framework, and I am trying to add a new map to my game. So I made a scene in Tiled map editor so I can export to my JavaScript file, but when I exported to JavaScript, they put in this format (full file at https://pastebin.com/wke5SKkV):

"data":[0, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, ..., 0, 4, 0]

But I want it in this format:

{
x: 1,
y: 0,
t: 'w'
}

Is there anyway I can export like this?

I hope someone knows how to do this!

If you use JSON instead, you can load the file as described here: stackabuse.com/phaser-3-and-tiled-building-a-platformerChris G
Im using phaser 2, what can I do?Joseph
Does this help? examples.phaser.io/_site/… (found here)Chris G