nak3ddogs Posted July 17, 2014 Share Posted July 17, 2014 helo! i cant figure out how my homeless enemy can sense the end of the platform.i want this homeless patrol without fall down. thx for any advice Link to comment Share on other sites More sharing options...
marvster Posted July 17, 2014 Share Posted July 17, 2014 I would go for invisible tiles/sprites as bumper and set them on the end of the enemies path and check of collision (tile/sprite vs enemy).If it collide, let the enemy rest with a timeout and send him back afterwards. nak3ddogs 1 Link to comment Share on other sites More sharing options...
Heppell08 Posted July 17, 2014 Share Posted July 17, 2014 do you use tilemaps for creating your maps? if yes then use tile functions. If you have a tilemap and have the 2 tiles that are the ends of a platform you can create a function to do pretty much anything when the tile is touched. Heres a post i made a while ago regarding the same thing:http://www.html5gamedevs.com/topic/3932-tile-callback-function-undefined/ nak3ddogs 1 Link to comment Share on other sites More sharing options...
nak3ddogs Posted July 17, 2014 Author Share Posted July 17, 2014 ty for the tips. i thinked about same things. the invisible tile will work for me coz my tiled map have too much different type of platforms and somewhere i wont trigger this effect.sry for my english. im little bit drunk. Link to comment Share on other sites More sharing options...
druphoria Posted July 18, 2014 Share Posted July 18, 2014 Wow, what a coincidence. This is the exact problem that I was working through today. Here's my solution: http://www.html5gamedevs.com/topic/7942-interesting-phenomenon-with-platformer-cliff-detection/ Basically I'm checking to the lower left of the enemy if he's going left and the lower right of the enemy if he's going right (as long as he is on the ground). If there's empty space there, I change the direction. This way I don't have to hardcode specific locations in the map or add invisible tiles. nak3ddogs 1 Link to comment Share on other sites More sharing options...
lewster32 Posted July 18, 2014 Share Posted July 18, 2014 There are pros and cons to both methods that you should consider. If at some point you want a character to, for instance, walk down some stairs, you will start to have problems with the detection method. nak3ddogs 1 Link to comment Share on other sites More sharing options...
Recommended Posts