How do I trigger an event on overlap of 30% or more?

Get help using Construct 2

Post » Wed Jun 11, 2014 10:49 am

I'm designing a small game in which a ball moves on top of disappearing platforms. When a ball is on top of the platform and the platform disappears, I let the game trigger the following event:

Player - is overlapping platform => Restart layout
- Platform is invisible

Problem is. The same event is triggered whenever even a single pixel "hits" the invisible platform. Is there any way I can restrict this behaviour to something akin to "30% is player is overlapping platform"?
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Wed Jun 11, 2014 11:18 am

Use overlap at offset. Only you set it in pixels

In my example you have to set for both sides, so you cave to make 2 sets of conditions.

one might be overlap 20,0 (20 is X and 0 is Y)
The other would be -25,0

This way the overlap works from both sides.

I use this in a platformer of mine:

Player > is Overlapping Enemy 25,0 > do something
Player > is Overlapping Enemy -25,0 > do something

In your case it sounds like you'll need change overlap for Y and in only one direction. Hope this helps.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests