I want the player not move on the x axis

Godot Version

4.3

Question

I am new to godot and I am trying to make a working ping pong game. I am stuck with the player where I can move player vertically but the pong touches the sides of the player it attaches to it and makes it to move along with untill I press a key.
Here is code of the player

extends CharacterBody2D

@export var speed = 400

func _physics_process(delta):
	velocity = Vector2.ZERO
	player_movement()
	move_and_slide()
	print("Velocity.x:", velocity.x)
	print("Velocity.y:", velocity.y)
	
func player_movement():
	
	# Getting Y axis strength
	var movement_store = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
	velocity.y = movement_store * speed
	velocity.x = 0

You can place StaticBodies in the corners to stop the player
Or you can add a condition that can only be made if y is within the desired range of the move