king_pong.py
def reset_positions(self):
                """
                Moves the players to a center position
                and reset the direction and speed of
                the ball randomly within acceptable range.
                """
                self.playerx, self.playery = SCREEN_WIDTH-PADDLE_X_DISTANCE, PADDLE_Y_DISTANCE
                self.cpux, self.cpuy = PADDLE_X_DISTANCE, PADDLE_Y_DISTANCE
                self.ballx, self.bally = SCREEN_WIDTH/2, SCREEN_HEIGHT/2
                self.ball_speed_x = random.choice(
                        range(-self.top_speed+1, -int(2*self.top_speed/3)) +
                        range(int(2*self.top_speed/3), self.top_speed))
                self.ball_speed_y = random.choice(
                        range(-self.top_speed+1, -int(2*self.top_speed/3)) +
                        range(int(2*self.top_speed/3), self.top_speed))

                Moves the players to a center position
                and reset the direction and speed of
                the ball randomly within acceptable range.
                
Moves the players to a center position
and reset the direction and speed of
the ball randomly within acceptable range.
Moves the players to a center position and reset the direction and speed of the ball randomly within acceptable range .
def reset_positions(self):
                self.playerx, self.playery = SCREEN_WIDTH-PADDLE_X_DISTANCE, PADDLE_Y_DISTANCE
                self.cpux, self.cpuy = PADDLE_X_DISTANCE, PADDLE_Y_DISTANCE
                self.ballx, self.bally = SCREEN_WIDTH/2, SCREEN_HEIGHT/2
                self.ball_speed_x = random.choice(
                        range(-self.top_speed+1, -int(2*self.top_speed/3)) +
                        range(int(2*self.top_speed/3), self.top_speed))
                self.ball_speed_y = random.choice(
                        range(-self.top_speed+1, -int(2*self.top_speed/3)) +
                        range(int(2*self.top_speed/3), self.top_speed))
def reset_positions ( self ) : self . playerx , self . playery = SCREEN_WIDTH - PADDLE_X_DISTANCE , PADDLE_Y_DISTANCE self . cpux , self . cpuy = PADDLE_X_DISTANCE , PADDLE_Y_DISTANCE self . ballx , self . bally = SCREEN_WIDTH / 2 , SCREEN_HEIGHT / 2 self . ball_speed_x = random . choice ( range ( - self . top_speed + 1 , - int ( 2 * self . top_speed / 3 ) ) + range ( int ( 2 * self . top_speed / 3 ) , self . top_speed ) ) self . ball_speed_y = random . choice ( range ( - self . top_speed + 1 , - int ( 2 * self . top_speed / 3 ) ) + range ( int ( 2 * self . top_speed / 3 ) , self . top_speed ) )
Moves the players to a center position
and reset the direction and speed of
the ball randomly within acceptable range.
Moves the players to a center position and reset the direction and speed of the ball randomly within acceptable range .
"""
                Moves the players to a center position
                and reset the direction and speed of
                the ball randomly within acceptable range.
                """
self