Help with a jump who piss me off!!§§

AasimarAasimar Member Posts: 74
edited November -1 in Working with GS (Mac)
Hi guys,

I need your help for a simple jump, that pissed me off!§§§!
I tryed many differents things but my jump isn't like I want...

The theory is simple and easy to write in code but with GS, it's an other world.

I have a guy who's jumping when I push a button.
I need to have a progressive jump :

If it's a little push, the guy jump a little, if it's a long push, the guy do a big jump.

I need to use a Y min and a Y max like :

MinY = 100, MaxY = 500

When it's a little push, he use the min value : 100
When it's a long push, he use a value between min and max : 100 -> 500 OR 500 if it's not possible.
If the button's pressed a lot like 1 or 2 second, can't exceed 500 and the guy is automatically jumping 500.

I tryed with accelerate and it work but it's not smooth and regular.
I tryed with a release fonction, it work, but not like I want.
I tryed many many things but... No ! I think it's possible with GS but I don't know how.

Any help ? someone has done this before ?

S.

Comments

  • HachikoHachiko Member Posts: 330
    You can find it in my running game template plus lots of other things :P, see the "Interested in a Canabalt like template" topic.
    There are many ways to do it. One, for example, is to deactivate the acceleration made for gravity, add a value to the motion linear Y, and when the mouse is released or the max height of the jump is reached, reactivate the gravity and stop changing the value :) But there are plenty of others.
Sign In or Register to comment.