8 Directional platform jumping help needed

0 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 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.

  • 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.

  • That's

    "set Floor to Player.X"

  • Would the Castle Crashers Game style be a flat plane?

    Is this what it is supposed to look like so far?

    i.imgur.com/kzy3kKo.png

    If so what goes after the Player.X - PlayerFloor < JumpLimit

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)