enemy AI for platformer game question...

So, in my game, i have some platforms and enemies walking on them. I want them to turn back when they reach the end of the platform, so that they don’t fall.
The platforms are made with tiles (similar to this tutorial series: http://mobile.tutsplus.com/tutorials/corona/build-a-side-scroller-from-scratch-background-motion/). To sum up, the platforms are generated randomly, all belong to a display group, and only exist while on screen. As soon as they move out of screen they are erased from the scene.

I need to find a way for my enemies to know where they are and what type of block they are standing on. If that block is an “ending platform” or “platform beginning” block (think about Monster Dash) they should turn around, instead of keep walking and fall.

Any guidance will we extremely appreciated!!! [import]uid: 105206 topic_id: 25133 reply_id: 325133[/import]

I’d say you could have a tile at the end of the platform with physics to detect a collision, but as a sensor. I think if you set the alpha to 0 it will not be visible but will still register collisions. Once the enemy hits this tile, it can detect it and turn around. [import]uid: 10389 topic_id: 25133 reply_id: 102187[/import]