def METHOD_NAME(self):
    # Calculate speed based on the keys pressed
    self.player_sprite.change_x = 0
    self.player_sprite.change_y = 0
    if self.up_pressed and not self.down_pressed:
        self.player_sprite.change_y = MOVEMENT_SPEED
    elif self.down_pressed and not self.up_pressed:
        self.player_sprite.change_y = -MOVEMENT_SPEED
    if self.left_pressed and not self.right_pressed:
        self.player_sprite.change_x = -MOVEMENT_SPEED
    elif self.right_pressed and not self.left_pressed:
        self.player_sprite.change_x = MOVEMENT_SPEED