   Collison
  I am having problems with collsion. I have two class one called Ball and block. In the main code i have called functions from Block to get the co ordinates of the Block. Each block is a position in a array. Then i call the function to see if the collsion has happened in Ball suppling the co ordinates of that block i want to test to see if it has collided.But it doesnt work here is the code of the Test of Collsion On the Block in the Class Ball.bool Ball::CheckForBrickCollision(float TopLeftX,    float TopRightX,    float BottomLeftY, float TopLeftY,    float BottomLeftX,    float BottomRightX,float BottomRightY,    float TopRightY){    bool Hit;    if  ((ball_xpos>=TopLeftX ) && (ball_xpos<=TopRightX)&&    (ball_ypos>=BottomLeftY ) && (ball_ypos<=TopLeftY)&& (ball_xpos>=BottomLeftX ) && (ball_xpos<=BottomRightX)&&    (ball_ypos>=BottomRightY ) && (ball_ypos<=TopRightY))    { Hit = true;  // reflect x-axis velocity    ball_dx=-ball_dx;// update position  ball_xpos+=ball_dx;   }   else{   Hit = false;}return(Hit);    }the function for some reason never returns true even thought i know that the co orinates are passed right to it.Any help would be greatfulthanks alot in advance for any help 
  I don't think there is an other reason for the wrong return value but the case that the right variables are not passed to the function. One thing you could check is if you haven't accidentily switched x/y or something.EDIT: post the function that calls the collision detection function and the ball class contents, the problem is out there,  somewhere!   [edited by - Tree Penguin on February 12, 2004 8:16:33 AM]