Fixed Jump Path

0 favourites
  • 7 posts
From the Asset Store
Move around the rectangular and travel as much as you can!
  • Hello, I'm new to Construct. I've been playing around with the jump settings- it seems that the default jump allows the player to control movement in the air ala Mega Man. That's good for a platformer, but I am looking for a way to make a fixed jump path- for example, in a 2D fighting game like street fighter, where up-forward would always give you the same distance/travel path. Is there a way to do that in Construct?

    Thank you for any replies/advice :)

  • Try to disable "left" and "right" controls while player in air.

  • This only produces a straight up neutral jump- what I'm looking for is..

    user presses 'up' - user gets a fixed straight up jump

    user presses 'up+right' - user gets a fixed forward jump.

    I've been messing with the keyboard events but I cannot find a way to a) assign one action to simultaneous inputs (such as up giving a different action then up+forward) and b) create a fixed path jump that happens every time the inputs are pressed.

  • Yo! Here's a trick you can try:

    Set default controls to 'no' in platform behaviour.

    Add a 'simulate control left/right' action that kicks in whenever your player is in the air.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Getting closer! Here's what I've setup...

    default controls set to 'no'

    keyboard (on up arrow pressed) player simulate platform pressing jump

    keyboard (right arrow is down) player simulate platform pressing right

    player set platform acceleration to 1000

    player set platform vector X to 1000

    now the only problem I have is that multiple up+right inputs increases the distance traveled (effectively repeating the vector x action, i'm guessing). Is there a way to limit this, to where there is only one instance of up+right allowed until player has reached the ground again?

  • Yes. Create an instance variable for your object named something like "hasjump". Give your jump event a condition that "object.hasjump" = true, and in the jump event set "hasjump" to false. Then use the platform on landing trigger to set "hasjump" to true again.

    If you use a number instead of a boolean this is also how you can give characters multiple jumps in a platforming game.

  • hmmm and what about

    +On start of layout
       -> player set defaultDeceleration to player.Platform.Deceleration
    
    +player: Platform is on floor
       -> player: stop ignoring Platform user input
       -> player: set Platform deceleration to player.defaultDeceleration
    
    +Player: [invert] Platform is on floor
       -> player: start ignoring Platform user input
       -> player: set platform deceleration to 0

    defaultDeceleration being an instance variable of player.

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