Jump to content

enemy sense the end of the floor


nak3ddogs
 Share

Recommended Posts

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/

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...