Fallthrough woes [double jump fixed]

0 favourites
  • 11 posts
From the Asset Store
Jump on alphabets in the proper order and reach the sun!
  • Here's a capx with the problems I'm going to ask about in this post.

    https://dl.dropbox.com/u/22615804/pendulum_doublejump_fallthrough.capx

    Ok, so I've been trying to make a jump sustain and double jump in C2 for a little while now. I completely ditched the "simulate jump" feature of the platform behaviour, working only with the Vector.Y component. I actually managed to get a jump sustain that worked kinda like I wanted (before I started messing with it to limit the jumping that is).

    After that I went on to implementing double jump. Since the way I made the custom jump allowed for infinite mid air jumps I figured I'd just limit it.

    Now I have run into some issues and I don't know how to fix, or work around, them.

    First, the double jump is inconsistent.

    It seems that double jumping is finnicky at best.

    If I tap lightly/quickly, I can jump in midair two times from standing.

    If I hold the jump button for too long (have not figured out the specifics on this)I can't do a midair jump at all.

    I've commented the parts of my event sheet that controls these things. The event sheet is "Control".

    Also, seemingly as a result from using this way to create jumps, I can't use the fall through function at all. Not sure how to work around this yet. If you have any ideas I'd appreciate it.

    Thanks.

  • Set a Ver to player lets Say "jump"

    Wen platform jumps "W is pressed" add 1 to variable

    if Variable is Equal to 2 or less allow platform to jump

    wen platform lands set Var back to 0

    So the player will not accomplish jump past 2 additions of.

    hope this helps. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • You clearly didn't check the capx. I'm already doing this (although counting down instead of up), and it doesn't work properly for some reason.

  • You clearly didn't check the capx. I'm already doing this (although counting down instead of up), and it doesn't work properly for some reason.

    I don't have to check I know it works lol

    x2jump2 by N7Effect, on Flickr

    This is actually a quadruple jump since the group doesn't start till first jump.

    Make sure on landed or isn't jumping or whatever means make Doublejump Variable zero again to repeat.

  • Instead of adding to a variable, try subtracting from it.

    Let's say you have a var "jumps_allowed" and set it to a initial value of 1.

    Then;

    If keyboard W was pressed

    and player.platform movement "is jumping"

    and player.jumps_allowed > 0

    Then

    Subtract 1 from player.jumps_allowed

    Do the double jump

    ----

    I think this way is better so you can have as many jumps as you want, since you can just add the max value whenever you want.

    Also don't forget to reset the variable to it's initial value when player is on the ground.

  • I don't have to check I know it works lol

    Oh for the love of peanuts...

    I told you I was already doing it and something wasn't working. The entire reason I posted the capx was so people could spot where the problem was. Luckily for you I spotted the problem just now and have fixed it.

    Now, moving on to the other problem. Fall through. Doing the jumps this way seems to block me from using fall through. I have this:

    +Player.Platform is on floor

    +Keyboard.Down arrow is down

    +Keyboard.On X pressed

    -Player.Fall Platform down through jump-thru

    This worked when I was using "simulate jump", but not now.

    I'm figuring it's because I'm forcing the VectorY up and down instead of letting the behavior handle it completely.

  • Erndog2k

    The reason you look at capx's is because not everyone's events are set up the same way, so they need some suggestions that will work with their particular setup.

    inkBot

    Of course, ironically, I don't have time to check the capx right now (on my way into work), but quick question: on your jump events, do you have a condition that says "+Keyboard.Down arrow is NOT down" ?

    Sometimes, depending upon the way your events are setup, others can be overridden if they've got common conditions. Sometimes the best way to isolate them is to do inverted conditions.

    Like I said, I can't check it now, but if you don't solve it later I'll give your capx a look when I get back.

  • ... quick question: on your jump events, do you have a condition that says "+Keyboard.Down arrow is NOT down" ?

    Nope. Here's an updated capx:

    https://dl.dropbox.com/u/22615804/pendulum_fallthrough.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Event 71 is setting the player's y vector to a small value all the time when you're not jumping. So the player is constantly falling and never actually on the ground.

    And if you're using x for both falling through and jumping you'd want to set it up so you don't jump while down arrow is down.

  • Event 71 is setting the player's y vector to a small value all the time when you're not jumping. So the player is constantly falling and never actually on the ground.

    I've checked that and as far as the platform behaviour is concerned, when the character is grounded it "is on floor"

    And if you're using x for both falling through and jumping you'd want to set it up so you don't jump while down arrow is down.ot really an option. Being able to jump (either from standing or crouch) and fall through platforms using the same button is what I'm aiming for. It's also pretty standard control scheme layout.

    Though you did give me an idea. I moved the events that pull the player down up to an "else" of 'player is on floor' removing them from the "jumping" group, and did this:

    +Player.is on floor

    +Keyboard.Down arrow is down

    +Player.Is overlapping "platform" at offset (0,2)

    -System.Set group "Jumping" Deactivated

    ++Keyboard.On X pressed

    --Player.Fall down through jump-thru

    --System.Wait 0.2 seconds

    --System.Set group "Jumping" Activated

    (In case the way I write events is confusing.

    + = condition, - action, ++ = sub event condition, -- = sub event action)

    So what i'm doing is that while I'm standing on a platform and pressing down jumping is disabled, instead of disabling it when i'm pressing dow, period. I then reactivate jumping shortly after to allow midair jumps after falling through.

    Now, whil this works, it's not without problems either. If I hold down the key after falling through, the player will start moving upwards as the jumping group is reactivated. Currently trying to fix. I'll see about getting a new capx up soon.

  • What do think of this? I think it covers everything...

    doubleJumpAndFallthrough.capx

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