How do I check if player is over a specific jumpthru object?

Get help using Construct 2

Post » Mon Mar 06, 2017 9:30 pm

I want to know if the player is over a specific object.

The player has platform behaviour, and the other objects has the jump-thru behaviour.

Thanks
B
6
S
2
Posts: 61
Reputation: 1,099

Post » Mon Mar 06, 2017 10:27 pm

Use another invisible sprite on top of the platform and check for overlap.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Post » Mon Mar 06, 2017 10:33 pm

You can also check for an overlap at offset.

If player platform is overlapping jumpthru at, X=0 Y=4 (for instance) then (whatever action you're hoping for)
B
69
S
40
G
24
Posts: 356
Reputation: 18,314

Post » Mon Mar 06, 2017 10:59 pm

ultrafop wrote:You can also check for an overlap at offset.

If player platform is overlapping jumpthru at, X=0 Y=4 (for instance) then (whatever action you're hoping for)


Yup that works too but I was thinking if you create an invisible sprite to check overlap you could use it for many platforms that might be at different positions on the screen so no writing additional events to check overlap at offset.

It is just something I use a lot in platformers and blank sprite triggers are very convenient.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Post » Mon Mar 06, 2017 11:25 pm

lamar wrote:Use another invisible sprite on top of the platform and check for overlap.



thanks, good idea :)
B
6
S
2
Posts: 61
Reputation: 1,099

Post » Tue Mar 07, 2017 6:11 am

lamar wrote:
ultrafop wrote:You can also check for an overlap at offset.

If player platform is overlapping jumpthru at, X=0 Y=4 (for instance) then (whatever action you're hoping for)


Yup that works too but I was thinking if you create an invisible sprite to check overlap you could use it for many platforms that might be at different positions on the screen so no writing additional events to check overlap at offset.

It is just something I use a lot in platformers and blank sprite triggers are very convenient.


I get the feeling code will be necessary regardless. I suggested the overlap at offset to avoid collision checks. Whatever's clever though - if it doesn't impact performance for OP then it's moot.
B
69
S
40
G
24
Posts: 356
Reputation: 18,314

Post » Tue Mar 07, 2017 7:34 am

Overlap at offset +1

If you will expand your game and will have multiple objects with "sensors" - it will be hell to set them one by one.
Better to put the kinds of objects you want to "sense" in a family and make one "Overlap at offset" condition on the family to cover all the possible future expansions.
B
62
S
32
G
6
Posts: 125
Reputation: 7,975


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests