Jump amount control by holding down button longer?

bladeolsonbladeolson Member Posts: 295
edited November -1 in Working with GS (Mac)
I have created a jumping character. Right now if I push "jump" while touching the ground it sets attribute to "jump" and the jump sequence is initiated.

I set the Y Linierar velocity of the character to for .25 seconds to 300. This creates a nice jump. So far so good.

However, I am wondering has anyone implemented a jump that will for example give more jump "power" if the jump button is held longer? So short taps would be a short jump and holing it down would jump to a preset max jump? I looked for examples and the closest thing I could see was traffic Ninja.

I would appreciate some ideas.

blade

Comments

  • design219design219 Member Posts: 2,273
    Try using the "otherwise" part of the rule.
  • KamazarKamazar Member Posts: 287
    Lemme check an old template, but I think I might just have the thing for you...

    Yep. Try this out: http://img407.imageshack.us/img407/2483/helpa.png. Needs tweaking, but will work.
  • bladeolsonbladeolson Member Posts: 295
    thanks Kamazar, but not sure how that is different from what I have. I see you do not have run to completion checked , does that make any difference?
  • KamazarKamazar Member Posts: 287
    I think so. Since it isn't forced to accelerate for the entire 0.5 seconds, whenever you let go, it just stops.
  • CrazybreadmanCrazybreadman Member Posts: 674
    yes, unchecking the 'run to completion' box is how to do it.
  • bladeolsonbladeolson Member Posts: 295
    thanks guys, I tried that but my guy either jumps like 1 inch or 1 million feet. Any suggestions on good settings?
  • KamazarKamazar Member Posts: 287
    Apply a max speed. Should help.
  • JGary321JGary321 Member Posts: 1,246
    Nice to see you back Kamazar

    I've missed you

    =)
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    the key is to have him always accelerate down unless you jump. this is to counteer the physics engine.

    then dont stack it the "move up"

    like they said uncheck run to completion
  • bladeolsonbladeolson Member Posts: 295
    Thanks James. I actually have been not using gravity in my game. Just applied a downward acceleration to the actor always.

    So I tried the suggestions and it still is not working right. When I uncheck the run to completion button the guy just jumps a couple inches off the ground. If I increase the acceletation amount he jumps too high. So I tried to apply a max speed and that does not seem to be helping.

    My Rule for Jumping also has two requirements 1 is "jump" is true ( button pressed ) and the 2nd is actor is "on the ground"

    I am wondering if I have this kind of attribute then trigger him to jump he is no longer on the ground anymore so the longer keypress is not working?

    Last thing, how do you counteract the goofy movement in the air while jumping. Meaning, if you jump to the right you can still move to the left in the air , feels odd. What do you guys think?

    thanks for the help by the way. attached is screen shot from my project

    http://files.me.com/daniel_blade_olson/1fyow3
  • ChristianpowerChristianpower Member Posts: 12
    you could find out at what time in the jump you want it to speed up so lets say 0.5 seconds after press then put
    (other wise)
    timer=0.6
    change velocity to 450
    and then put slightly more until you find what increase you want
Sign In or Register to comment.