HazA Posted March 17, 2014 Share Posted March 17, 2014 Hi guys!I am pretty new to phaser and html5 game development, but I am really amazed how fast the framework is moving forward and how kind and helpful the community is.I found a forum thread for each problem I had so far ... until now So here is what I am trying to do ...I create a world out of a tilemap and create a upper and lower layer ...Now I want to move to lower layer down so the player moves down with the layer ...But the problem is that the layer moves visually down, but the physics body stays where it was in the first place.I created a gif showing exactly the problem..I added physics debug drawings to better visualize the problem.I am using the latest version 2.0 in Canvas mode.The code is pretty much the code of some examples stiched together but I can post it of course if it's needed.I hope you guys can help me.Thanks Link to comment Share on other sites More sharing options...
rich Posted March 18, 2014 Share Posted March 18, 2014 I'm afraid you can't move tilemaps yet, they are camera fixed and all collision is done against their coordinates, so although you've moved the tilemap sprite visually down, all of the collision data is still being processed from its original coordinates. It's on the roadmap to support moving tilemaps around and putting them next to each other for example, but in the meantime I'm afraid you'll need to try and do the above differently (ideally using a sprite instead). Link to comment Share on other sites More sharing options...
HazA Posted March 18, 2014 Author Share Posted March 18, 2014 Thanks very much for your answer!I am sure I'll find a workaround with sprites jdnichollsc 1 Link to comment Share on other sites More sharing options...
luckylooke Posted May 30, 2015 Share Posted May 30, 2015 Thanks very much for your answer!I am sure I'll find a workaround with sprites Have you found the workaround @HazA? Link to comment Share on other sites More sharing options...
luckylooke Posted May 30, 2015 Share Posted May 30, 2015 I'm afraid you can't move tilemaps yet, they are camera fixed and all collision is done against their coordinates, so although you've moved the tilemap sprite visually down, all of the collision data is still being processed from its original coordinates. It's on the roadmap to support moving tilemaps around and putting them next to each other for example, but in the meantime I'm afraid you'll need to try and do the above differently (ideally using a sprite instead). It is more than year ago, you answered here, is it still true that you cannot move tilemaps? jdnichollsc 1 Link to comment Share on other sites More sharing options...
Zendrael Posted December 16, 2015 Share Posted December 16, 2015 Any news on this topic? Link to comment Share on other sites More sharing options...
Codestar Posted February 19, 2016 Share Posted February 19, 2016 I too am looking for an answer on this issue, I'm using phaser 2.4.6. I'm currently making my own tile editor and I need to have a tileMapLayer fixed to the camera movement, but it's not working. Is there a way to change the positions of tileMapLayers in the current release? swissnetizen 1 Link to comment Share on other sites More sharing options...
tonymtz Posted March 12, 2016 Share Posted March 12, 2016 *bump* Link to comment Share on other sites More sharing options...
Umz Posted September 12, 2017 Share Posted September 12, 2017 Seems there's still no fix for this. Not sure why exactly. Haven't got a response on the issue yet, but been through the documentation and there's no method to move the tilemap body at all. Should be possible manually, just haven't tried it yet. But, a quick fix workaround if you're using SHOW_ALL for fixed with display, is just to add extra space in the actual Tilemap file. Theoretically, another 2 options to test are: Offset the physics bodies by the amount the tilemap layer is offset. Manually move the tilemap physics body Link to comment Share on other sites More sharing options...
Recommended Posts