Jumping from falling objects

Get help using Construct 2

» Thu May 10, 2012 6:43 pm

I'm having a bit of an issue with my game. I have platforms that start to fall once the player jumps on it. The problem is the player cannot jump off of the platform lol. Its sort of funny but i don't want that to happen.

I want the player to be able to jump off of a platform at anytime. Its like the players gravity goes down with the falling object. I guess its realistic but how can i make it to where the player can jump from falling objects?

B
23
S
6
G
3
Posts: 194
Reputation: 6,005

» Thu May 10, 2012 7:24 pm

Can you post an example capx? Or at least tell how your platforms are created. Normally platforms don't fall, so you had to do something to make them fall, like add a bullet or sine or physics behavior or something.

My guess is that as the platform lowers the player keeps falling onto it, and the player can't jump when falling. You may need to implement something like a double jump to allow the player to jump when in the middle of falling.

Jumping on vertical platformskittiewan2012-05-10 19:42:44
B
30
S
12
G
13
Posts: 281
Reputation: 12,448

» Thu May 10, 2012 9:17 pm

yea i added a physics to a block. When the player jumps on the block it falls and the player falls. Its initially set to immovable and when the player steps on it its movable.
B
23
S
6
G
3
Posts: 194
Reputation: 6,005

» Fri May 11, 2012 2:36 am

The problem seems to be that the platform and the player fall at different rates, so the player keeps going into falling mode (instead of standing on the platform.) The player can't jump when falling, so that is the problem.

Here is a starting point. Uses a doublejump technique to change the player vectory when the player is falling to make it jump upwards again.

fallingPlatformJump.capx

You'll need to do something to prevent doublejump when you aren't on the moving platform (if you don't want the doublejump always, that is.) Maybe set a boolean instance variable that allows/prevents doublejump.

Also there is a growing gap between the player and the platform as it falls that I don't know how to get rid of at the moment.

PS - there is a boolean on the falling platform that if set to true makes the falling platform fall only as long as the player is on it. In the example I have this turned off for both falling platforms. You can turn it on to experiment with.kittiewan2012-05-11 02:39:41
B
30
S
12
G
13
Posts: 281
Reputation: 12,448

» Mon Mar 13, 2017 1:16 pm

Still having Problems?
B
6
S
1
Posts: 3
Reputation: 366

» Mon Mar 13, 2017 1:21 pm

Are you using platformer behaviors for the player and is the platform a solid?

You can create an air jump with a platformer but if the platform is a solid the player should be able to jump as it is falling.

Instead of using physics to make the block fall use the bullet behavior. Physics and other behaviors do not mix well and give strange results.
Banned User
B
29
S
7
G
58
Posts: 1,229
Reputation: 34,910

» Tue Mar 14, 2017 2:04 am

if your using platformer behavior wont work, since the following will occur:

1 you will land yes, but you will still be falling, which conflicts with the landing of platform behavior and nulls the jump

2 your still falling

fix

instead of platform jump

use platform set y vector or something like that and push it automatically at what force you want.
B
82
S
24
G
69
Posts: 1,363
Reputation: 44,216

» Tue Mar 14, 2017 4:14 am

You could set a very small grace time period in which a character can jump even if they are not touching ground (that only occurs when touching falling platforms), you'd just set it to bypass the ground touching test for jumping, during that time.
B
56
S
17
G
4
Posts: 193
Reputation: 5,930