syawqy Posted May 27, 2014 Share Posted May 27, 2014 I want to get player position from my map created with tiledit's a json filebasically I want something like thisplayer = createFromObjects(name, gid, key, frame, exists, autoCull, group, CustomClass, adjustY);player.body.collideWorldBounds = true;...but, if there's no simple way, can someone teach me how to get the spesific data from json fileI want at least get x and y position so I can write something like thisplayer = game.add.sprite(data.x,data.y,'player'); Link to comment Share on other sites More sharing options...
markjsb Posted May 27, 2014 Share Posted May 27, 2014 There's an example file that does just this, albeit just with coins, but I used this technique to position enemies and it worked. http://examples.phaser.io/_site/view_full.html?d=tilemaps&f=create+from+objects.js&t=create%20from%20objects Hope it helps Link to comment Share on other sites More sharing options...
syawqy Posted May 27, 2014 Author Share Posted May 27, 2014 sorry if I am not clear enough, my goal is to store the created sprite as variable so that I can access it later and in the example it store them as groupmaybe if there is a way to access it as a sprite it will solve my problemthanks syawqy 1 Link to comment Share on other sites More sharing options...
Recommended Posts