[SOLVED] How do I check if an object is 'on' another object?

Get help using Construct 2

Post » Sun Mar 22, 2015 5:18 pm

I have a platformer game where barriers move from right to left until off the screen. The player object which you can control moves from right to left too unless you are moving the player right to prevent from going off the screen. Whenever my player object lands on the barriers, it's speed left is doubled so that he slides off the barrier then lands on the 'ground' and returns to a normal speed going left.
Here is my event's for further verification as well as a crappy gif.

My question is, how do I check if the player object is on the barrier object, which each time it is generated is at a different height, so that I can set the object speed to the the right to negate the double speed caused by the barrier.

As well, if you have any suggestions for better doing things in how I update the player movement, don't
hesitate to let me know. :)


Click the link, the screenshot is really big, forgot to resize it.
i.imgur.com/xEs7eeo.png
Image
Last edited by are0planes on Sun Mar 22, 2015 10:29 pm, edited 1 time in total.
B
3
Posts: 7
Reputation: 189

Post » Sun Mar 22, 2015 5:38 pm

Look into the platform behavior "on landed"


https://www.scirra.com/manual/100/platform
Who dares wins
B
55
S
15
G
15
Posts: 1,818
Reputation: 16,212

Post » Sun Mar 22, 2015 9:49 pm

Is there any way to detect which object I "on landed" or is it just uniform for all objects.
B
3
Posts: 7
Reputation: 189

Post » Sun Mar 22, 2015 9:55 pm

You can use "Is overlapping at offset" to check for an overlap below the player.
ImageImageImage
B
71
S
20
G
189
Posts: 3,531
Reputation: 107,836

Post » Sun Mar 22, 2015 10:06 pm

blackhornet wrote:You can use "Is overlapping at offset" to check for an overlap below the player.

Thanks, that got it to work. I expanded the Y coordinate down a little. I thought I tried that but apparently not. Appreciate the help!
B
3
Posts: 7
Reputation: 189


Return to How do I....?

Who is online

Users browsing this forum: Cryttexx, imhotep22, mikeOstaff, RXIIIGAMES, SnipG, zenox98 and 12 guests