Had this idea at work, just mocked it up and it seems to work so far, I'm using containers for the two pieces and the enemy is just a platform movement and the solid ground is a tilemap:
Sorry, the gif is too wide to display properly:
Detecting platform edges? Its far more elegant to place an collision object at the ends of a platform. Then you can run checks for multiple enemies using just those 2 objects instead of attaching 2 to each one.
Develop games in your browser. Powerful, performant & highly capable.
Yeah, but this is quite cool if you don't want to do that for every edge, unless there's a big downside to using this method (other than two detectors per enemy)?
EDIT: I just make a container and they create properly for every instance on an enemy, so you just set your enemy and the game takes care of the rest. I don't understand why this wouldn't be the more elegant approach?