# 8 Directional platform jumping help needed

Get help using Construct 2

### » Sun May 26, 2013 10:14 pm

I am making a platformer that has similar control and movement to the game Castle Crashers. This is a 8 directional platformer with jumping. I have gotten jumping to go up. It's limiting the height the player can jump and making the player fall that has me stuck. To jump I have it when space is pressed the player is custom controlled up at a speed with some acceleration. I don't know how to make the player go down the same height that they "jumped" up.
B
3
Posts: 7
Reputation: 266

### » Sun May 26, 2013 11:05 pm

How exactly are you instructing it to jump? Depending on your set-up, you might just need to reverse the instructions for the downward fall, since the 8Directional behavior doesn't have a gravity element built into it.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

### » Sun May 26, 2013 11:08 pm

I have it set up where On Space pressed Player is Set CustomMovement Vertical to -400 and On Space released Player Stops CustomMovement. That is how I get the player to go up. With this I have no limit and don't know how to get a limit.
B
3
Posts: 7
Reputation: 266

### » Mon May 27, 2013 12:47 am

You can assign a platformer behaviour to the player as well as an 8directional and just use the platformer behaviour for jumping, that way you can use it's built in gravity function.

Alternatively, off the top of my head...

Give the player two Instance variables: "Floor" and "JumpLimit"

--------------------------Set the ground

When space is pressed:
Do once while true
set Floor to Player.

-------------------------- Jump up to the JumpLimit

While space is pressed:
While (Player.X - Floor) < JumpLimit
[Increase Player height]
(If you want to make it more realistic then you can reduce the velocity as Player.X - Floor approaches JumpLimit

-------------------------- Falling

If player.x > Floor
[Reduce player height]

I think that would work okay, the falling wouldn't work on anything other than a flat plane.
B
5
Posts: 85
Reputation: 395

### » Mon May 27, 2013 12:48 am

That's
"set Floor to Player.X"
B
5
Posts: 85
Reputation: 395

### » Mon May 27, 2013 5:49 am

Would the Castle Crashers Game style be a flat plane?
Is this what it is supposed to look like so far?
http://i.imgur.com/kzy3kKo.png
If so what goes after the Player.X - PlayerFloor < JumpLimitlegofinder2013-05-27 06:01:53
B
3
Posts: 7
Reputation: 266