sdfgdsfgdfg Posted September 10, 2016 Share Posted September 10, 2016 Hi I'm trying to make my enemies turn in the opposite direction when they get close to the edge of a platform. I've attached two 16 x 16 child sprites to enemies, one to the bottom left, the other to the bottom right. However, I can't get them to detect my map's collision layer (playState.collisionLayer - I'm using Tiled for maps and exporting to JSON). Ideally what would happen is if the enemy is moving left and the left child sprite stops colliding with the collision layer, the enemy would start moving right Any tips? Link to comment Share on other sites More sharing options...
sdfgdsfgdfg Posted September 10, 2016 Author Share Posted September 10, 2016 Got round this for now by adding an enemyBoundsLayer. I don't really like it though as it will mean enemies landing on invisible tiles at some point Link to comment Share on other sites More sharing options...
sdfgdsfgdfg Posted September 10, 2016 Author Share Posted September 10, 2016 nevermind, just found out about the getTileWorldXY function in Phaser.TileMap ! Link to comment Share on other sites More sharing options...
Recommended Posts