PYGAME Block Animation with a wall

The blocks are supposed to bouce of the wall as they do from the edges
of the screen.
However, they sometimes simply float through the wall.