How do I detect a 'precipice'.

Get help using Construct 2

Post » Sat Oct 17, 2015 1:06 am

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.

Image
B
15
S
6
Posts: 105
Reputation: 1,356

Post » Sat Oct 17, 2015 2:00 am

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.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Sat Oct 17, 2015 6:45 pm

Thanks @jojoe. This is my condition (I didn't need Sprite.X and Sprite.Y).

Image
B
15
S
6
Posts: 105
Reputation: 1,356

Post » Sat Oct 17, 2015 6:49 pm

Oops,sorry about that. Hope it works good for you :)
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 23 guests