Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualwtfmates

Posted 24 October 2012 - 07:23 AM

Alright, so I've got some nice collision detection going on and the ball's Y position is multiplied by -1 every time it hits a wall or a paddle, like so:

if (ballPosition.Y < 0 || ballPosition.Y > maxY)
ballSpeed.Y *= -1;

but i'm finding that it isn't enough. My ball keeps getting stuck going through the same movements. I don't even have to move my paddle when this happens and can just leave it hanging out in the corner while I go grab a beer.

Could someone help me out with this?

#1wtfmates

Posted 24 October 2012 - 07:01 AM

Alright, so I've got some nice collision detection going on and the ball's Y position is multiplied by -1 every time it hits a wall or a paddle, like so:

if (ballPosition.Y < 0 || ballPosition.Y > maxY)
ballSpeed.Y *= -1;

but i'm finding that it isn't enough. My ball keeps getting stuck going through the same movements. I don't even have to move my paddle when this happens and can just leave it hanging out in the corner while I go grab a beer.

Could someone help me out with this?

PARTNERS