   Collision help
  So I am trying to write a code where a player can only jump if they are standing on a collidable object. Here is the script to check for collision: bool check_collisiontop( Square A, SDL_Rect B ) {float leftA, rightA, bottomA, topA; int leftB, rightB, topB, bottomB; leftA = A.x; rightA = A.x + A.w; topA = A.y;bottomA = A.y + A.h; leftB = B.x;rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; if(( bottomA + 1) == topB ){ if( rightA  >= leftB ){if( leftA  <= rightB ){return true;}}}return false;}Now the problem is checking if the person is actually touching the ground. I am trying to see if the coordinates on the Y plane will match up to be on the same level, but my collision removal script (so to speak) just pulls the object away from the collision depending on how it entered. Here is the pulling away script:while ( check_collision( mySquare, wall) == true && (xVel > 0) ){x -= 1;}How do I make the check top collision work?   
  Do you have gravity in your game?If so how i've done this in the past is when you try to apply the force of gravity to the player (downward pull), if it fails to move the player the full amount downwards, set a variable "bPlayerIsOnGround" to true, else set it to false.Then in your jumping code, only preform a jump if bPlayerIsOnGround is true.   ;  Lol thanks for the help, but I fixed it. It seemed that some values where floats and others where integers, causing problems.   