I'm working on a platformer. I'm looking for a way to detect that my player is near the edge of a 'precipice' so I will be able to change the animation.
Use a overlapping collision for the floor with offset:
That will be down and to the right...Detect the floor. Substitue "+" with "-" on the X axis to detect the other side.
Develop games in your browser. Powerful, performant & highly capable.
Thanks jojoe. This is my condition (I didn't need Sprite.X and Sprite.Y).
Oops,sorry about that. Hope it works good for you