def update_player_velocity(self):
    'Update velocity based on key state.'
    if (self.left_pressed and (not self.right_pressed)):
        self.player_sprite.change_x = (- PLAYER_MOVEMENT_SPEED)
    elif (self.right_pressed and (not self.left_pressed)):
        self.player_sprite.change_x = PLAYER_MOVEMENT_SPEED
    else:
        self.player_sprite.change_x = 0
Update velocity based on key state.
def update_player_velocity(self):
    
    if (self.left_pressed and (not self.right_pressed)):
        self.player_sprite.change_x = (- PLAYER_MOVEMENT_SPEED)
    elif (self.right_pressed and (not self.left_pressed)):
        self.player_sprite.change_x = PLAYER_MOVEMENT_SPEED
    else:
        self.player_sprite.change_x = 0