• Advertisement
Sign in to follow this  

RYU jumping forward while not jumping up HELP

This topic is 4713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi guys i am making a street of rage/beat em up using sf3 characters, now here is my problem i got to jump upwards when pressing UP key now so if i press up and right he jump forwards but if i press up then right he does that i don;t want him to jum forwards while just pressing up i am confused i know ther eis a simple solution someone help me here is my code theese r the controls part if (DXUCheckKeyDown(DIK_UP)&&(!ryuJumping.isJump)){ ryuWeakPunch.alive=FALSE; ryuMediumPunch.alive=FALSE; ryuHeavyPunch.alive=FALSE; ryuHeavyKick.alive=FALSE; ryuLowKick.alive=FALSE; ryuMediumKick.alive=FALSE; ryuStance.alive=FALSE; ryuWalking.alive=FALSE; ryuCrouching.alive=FALSE; ryuJumping.posx=ryuWalking.posx; ryuJumping.posy=ryuWalking.posy; ryuJumping.alive=TRUE; ryuJumping.isJump=TRUE; ryuJumping.jumpstart=-26; ryuJumping.gravity=+2; ryuJumping.jumpspeed=4; //ryuJumping.posy=GROUND; ryuJumping.curSprite=0; } if (DXUCheckKeyDown(DIK_UP)&&DXUCheckKeyDown(DIK_RIGHT)&&(!jumpingForwardRightKey) &&(!jumpingForwardLeftKey)){ jumpingForwardRightKey=TRUE; } if (DXUCheckKeyDown(DIK_UP)&&DXUCheckKeyDown(DIK_LEFT)&&(!jumpingForwardLeftKey) &&(!jumpingForwardRightKey)){ jumpingForwardLeftKey=TRUE; } and the render part for the jumping ryuJumping.posy += ryuJumping.jumpstart; ryuJumping.jumpstart = ryuJumping.jumpstart+ryuJumping.gravity; if(jumpingForwardRightKey) { ryuJumping.posx += 10; } if(jumpingForwardLeftKey) { ryuJumping.posx -= 10; } if(ryuJumping.jumpstart>=0&&ryuJumping.isJump){ ryuJumping.posy += ryuJumping.jumpstart;//*ryuJumping.jumpspeed; if(ryuJumping.posy>=GROUND) { //ryuJumping.posy=GROUND; ryuJumping.jumpstart = 0; ryuJumping.gravity = 0; ryuJumping.isJump=FALSE; ryuJumping.alive=FALSE; ryujumptimer=0; ryujumpcur=ryuJumping.curSprite+1; ryuWalking.posx=ryuJumping.posx; jumpingForwardRightKey=FALSE; jumpingForwardLeftKey=FALSE;

Share this post


Link to post
Share on other sites
Advertisement
ok i fixed my solution i thought about and so in a real jump situation u can only jump forqard while ur still on the ground weeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement