Relative Content

Tag Archive for pythonpygamepong

Pygame collision problems, pong game

I’m having a problem where the ball in my pong game doesn’t always detect when it touches a paddle, if it touches the same paddle twice in a row it just goes straight through, this happens when the opponent misses the ball, since then its respawned to go back to the winner of the point.
The game consist of a main module and a game module, the game module has a class that controlls everything related to the game, the only thing the main class has to do to make the game run is call the next_step() function, and this is where the problem lies.
Every time the next step function is run it checks for collisions between the ball and the paddle. Does anyone have an idea as to why this problem is occuring?