How do I "Jump over" a solid without being stopped?

Get help using Construct 2

Post » Wed Aug 27, 2014 9:13 pm

Hey all

I'm trying to create a grid game (topdown) where walls (solids) can stop you from moving, unless there's a "spring" before it, which makes you "jump over" the solid.
How can I remove the physical behavior of an object adjacent to a specific X and Y? I thought changing layers would work, but it doesn't...

Thanks!
B
18
S
7
G
1
Posts: 160
Reputation: 1,934

Post » Wed Aug 27, 2014 9:40 pm

You can use : System - Is between values, to compare the object x or y.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Wed Aug 27, 2014 9:44 pm

wouldn't checking values between 2 objects be too late? the object would have already collided with the wall...
B
18
S
7
G
1
Posts: 160
Reputation: 1,934

Post » Thu Aug 28, 2014 12:31 am

You can turn off collisions at a specific event
B
13
S
5
G
1
Posts: 119
Reputation: 2,292

Post » Thu Aug 28, 2014 12:36 am

You can test for a collision at an offset. User the "Is overlapping at offset" expression
B
87
S
44
G
16
Posts: 1,009
Reputation: 17,946

Post » Thu Aug 28, 2014 12:49 am

Let's say if you have a jump-over icon or sprite the player runs over (let's call it jump-over sprite).

If Player -> is overlapping -> jump-over sprite then set wall to turn off collisions

then to turn it back on have an invisible sprite on the other side of the wall (let's call it Wall reset) that says
If Player is overlapping -> Wall reset then Wall will turn on collisions.

Let me know if that helps.
B
13
S
5
G
1
Posts: 119
Reputation: 2,292

Post » Thu Aug 28, 2014 6:33 am

You could also have a "Jumping" on/off variable on the player as well. Whenever he hits the spring, you'd turn on the jumping bolean and turn off collisions when jumping is on.

There's a lot of different ways to do it, really.
B
15
S
4
G
1
Posts: 169
Reputation: 2,179

Post » Thu Aug 28, 2014 1:20 pm

Thank you very much all, it really seems turning collisions off and back on is the best way to do this :)
B
18
S
7
G
1
Posts: 160
Reputation: 1,934


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests