The player is already jumping, but i want it to jump progressively like this: Each time he jumps he start to go up fast, but when i release the “w” key he should just begin falling. I just cant get it working properly, to start jumping fast ,then to decrease the jumping speed,but also to begin falling when the key was released. My code for jumping looks like this:
private var jumpPower:Number=8;
private var hFriction:Number=0.85;
private var gravity:Number = 0.3;
//jump
if (collide("solid",x,y+1)) {
onTheGround=true;
ySpeed = 0;
if (Input.check(Key.W)) {
ySpeed-=jumpPower;
}
} else {
ySpeed += gravity;
}
ySpeed *= vFriction;
Any tips/ideas/bits of code to help? ty >.<