   SDL Jumping code help
  So I got this jumping code that is meant to set the initial velocity to 600, than every time the code goes through the velocity would go down by increments of 50. I have gravity set at 300. Here is the codeif (dojump == true){if ((check_collision( mySquare, wall )) || (yS == SCREEN_HEIGHT - SQUARE_HEIGHT)){if(firsttime){yVel = JUMPHEIGHT;firsttime = false;}if (yVel > 0){yVel -= JUMPDCELL;}else{dojump = false;}}else{dojump = false;}} yS += ( gravity * (deltaTicks / 1000.f)) - (yVel * (deltaTicks / 1000.f )) ; //If the square went too far to the left or right or has collided with the wallif( yS < 0 ){yS = 0;}else if( yS + h > SCREEN_HEIGHT ){   //Move back   yS = SCREEN_HEIGHT - h;    }while( ( check_collision( mySquare, wall ) ) && ( yVel == 0 ) ){yS -= 1;}while( ( check_collision( mySquare, wall ) ) && ( yVel > 0 ) ){yS += 1;dojump = false;}}The problem is that it only jumps at the ground level, but also that the increments of 50 don't come at all. Any ideas? Thanks   
  }else{dojump = false;}}else{dojump = false;}Seems to set dojump to false if dojump is true   ;  It does that if there is no collision. How can you jump in mid air? And the other one it does it after all the increments have gone. AKA the velocity is at 0.   ;  Oh, I see that. I think you need to post the collision code too.   ;bool check_collision( Square A, SDL_Rect B ) {float leftA, rightA, topA, bottomA; int leftB, rightB, topB, bottomB; leftA = A.xS; rightA = A.xS + A.w; topA = A.yS; bottomA = A.yS + A.h; leftB = B.x;rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; if( bottomA <= topB ){ return false;} if( topA >= bottomB ) {return false;} if( rightA <= leftB ) { return false;} if( leftA >= rightB ) {return false;} return true; };  Never mind I fixed it.   ;The popular MMO, which originally launched in 2003, has recently replaced its character creation system with an entirely new one, and here, CCP's senior staff takes Gamasutra readers on a tour of the concepts and methods that resulted in the soon-to-launch tool.  View the full article