Sustained Jumping

For questions about using Classic.

Post » Tue Feb 09, 2010 4:22 am

I'm trying to make a sidescrolling platformer with mario-like jumping, but Jump Sustain (and the other values that go along with it) for the Platform Behavior makes it feel strange. It isn't even smooth. It looks like you are jumping then a tiny pause, then you lift up higher. It doesn't feel like variable jump height, but rather variable number of consecutive jumps.

Anyone know a better way?
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Tue Feb 09, 2010 6:16 am

I was dealing with that problem but I fixed with this, check it out:
When Z key was pressed and Player is on ground, set a GravityTimer to 10
If GravityTimer > 0, Substract 1 from GravityTimer
If GravityTimer = 0, set vertical speed to 0
If Z key is released, set vertical speed to 0.

That way, if you keep the button pressed, you will jump the same height you wanted, but if you release the button, the player will stop.

Just play with that values (GravityTimer and that stuff) and you'll get what you want, or atleast I did. :lol:

Good luck!
?When everyone feels hope at the same time, wonderful things can happen.
B
5
G
3
Posts: 67
Reputation: 1,059

Post » Tue Feb 09, 2010 7:13 am

Mr. Wolf, what are your Platform settings? Often it's just a matter of tweaking the settings until you get what feels right.

Post your .cap if you can.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Feb 09, 2010 6:37 pm

[quote="Carlos182":1s3jhtx9]I was dealing with that problem but I fixed with this, check it out:
When Z key was pressed and Player is on ground, set a GravityTimer to 10
If GravityTimer > 0, Substract 1 from GravityTimer
If GravityTimer = 0, set vertical speed to 0
If Z key is released, set vertical speed to 0.

That way, if you keep the button pressed, you will jump the same height you wanted, but if you release the button, the player will stop.

Just play with that values (GravityTimer and that stuff) and you'll get what you want, or atleast I did. :lol:

Good luck![/quote:1s3jhtx9]
I read the thread you started about it, but I couldn't get the right values either (and I suspect events are better for this anyway). I don't see GravityTimer or Vertical Speed anywhere though. Did you use private variables?
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Tue Feb 09, 2010 7:36 pm

Yes, they are private variables. It's just a timer I created just to stop the player, if not, he will keep elevating forever.
?When everyone feels hope at the same time, wonderful things can happen.
B
5
G
3
Posts: 67
Reputation: 1,059

Post » Tue Feb 09, 2010 7:44 pm

I still don't see the need for making your own jump sustain. As I said before it's just a matter of changing the settings until you get it right.

But whatever, I guess. Carry on...
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Feb 09, 2010 10:14 pm

From messing with the Platform values more, I do not think there is any way you can achieve a proper jump sustain with it that looks natural.

Let's say I want to have the player move up X pixels per X ms while Shift is held but end jump while keeping achieved momentum if Shift is released, I don't see any way to do this with the Platform behavior. Right now it looks forced. It doesn't look smooth or realistic. If you reach the top of you jump, you instantly fall as if you hit a ceiling. It would look natural if you could carry force after the jump ended. Also, there arent enough options for altering jump speed while still being able to end the jump before the player has reached the height of the Jump Strength.

I haven't been able to get it right with events either, but I'm not nearly as knowledgeable as a lot of other people. If anyone can find a proper way to do it, that would be wonderful.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Tue Feb 09, 2010 11:53 pm

HEY, LISTEN! You have two options here.

1. Post your .cap like I asked earlier so I can see if it's something you're doing wrong or if it's actually a bug or what.

or

2. Continue thinking that you can't make Jump Sustain work without even getting any help on the matter.

It might be messed up! Who knows? NOBODY KNOWS UNTIL YOU POST WHAT YOU'RE DOING ARRRGGHHHHHHHHHHHHHHH!!!! Saying "I just don't think it works" over and over again isn't going to make it work.

</frustration>



So... pretty please, with sugar on top, post your .cap :)

And if you still don't want to for whatever reason, you can't say I didn't try.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Feb 10, 2010 12:55 am

Deep breaths Deadeye, deep breaths...
:lol: :lol: :lol: :lol:

I know what you mean though.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests