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:
X: Sprite.X+sprite.width/2
Y: Sprite.Y+sprite.Height/2
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 — This is my condition (I didn't need Sprite.X and Sprite.Y).
Oops,sorry about that. Hope it works good for you